OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: X75TIGER75X on 01 Nov 2008, 01:24:44

Title: set specific speed
Post by: X75TIGER75X on 01 Nov 2008, 01:24:44
Hi guys.  :D

I have a plane flying in the mission, the plane is designed for in camerascripting. but Camerascripting is really inconsistent because the plane is going in different speeds, sometimes the plane is little faster for camera to catch up or much slower.

Is there any script that set strict limit on plane's speed like 200 Speed limit, so AI will not fly over or below the speed.

Thanks to anyone who replied!

-X75tiger75X
Title: Re: set specific speed
Post by: Spooner on 01 Nov 2008, 13:54:57
You probably want to match the plane's speed and position with the camera, rather than manage the plane's speed.

If you are tracking the plane as it moves, remember that you can use camSetTarget to always look directly at it. If you don't want to look directly at it, you could use something like:
Code: (panning to follow plane) [Select]
_camera camSetTarget _plane;
_camera camCommit 0;

Code: (panning to follow a position relative to plane, e.g. to track nose rather than centre of plane) [Select]
_camera camSetTarget (_plane modelToWorld [_xOffset, _yOffset, _zOffset]);
_camera camCommit 0;

Code: (track camera at a steady relative position to the plane model) [Select]
_camera camSetTarget _plane;
_camera camSetRelPos [_xOffSet,_yOffSet,_zOffset]
_camera camCommit 0;

Put any of those inside a waitUntil loop and you will get less jerkiness than if you put them inside a while/sleep 0.01 loop
Title: Re: set specific speed
Post by: X75TIGER75X on 01 Nov 2008, 14:13:44
You probably want to match the plane's speed and position with the camera, rather than manage the plane's speed.

Hmm... I can do that one.

I'm guessing my problem happens because I was testing it at the very beginning of game, So the plane needed to speed up when spawned.
After I camscripted the plane scene, I put AAN News Scene in first then camera following plane in second. Maybe the plane is already reached speed requirement as game start camera scene and it fly away.

I'll try reedit the script.