Home   Help Search Login Register  

Author Topic: set specific speed  (Read 1188 times)

0 Members and 1 Guest are viewing this topic.

Offline X75TIGER75X

  • Members
  • *
set specific speed
« 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

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: set specific speed
« Reply #1 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
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline X75TIGER75X

  • Members
  • *
Re: set specific speed
« Reply #2 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.
« Last Edit: 01 Nov 2008, 14:15:40 by X75TIGER75X »