OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: marcus3 on 11 Aug 2005, 12:37:05
-
i am starting to make a intro for a mission of mine with a camera script (this is my first time) so i want the camera to be set behind a dude and the camera to look at a plane takeing off. so i got the camera to go behind the dude but then i put the _cam settarget getpos plane code and then it looked at the place where the plane last was. so, how do u get the camera to follow a person/thing?
-
You have to create a loop that updates the camsettarget every ~0.01 second or so.
I'm at work, so I cannot give you the syntax, but here is what you do...
unPbo the Red Hammer campaign and look in the first mission. ThereÂ's a camera following a flying helo in that one. The camera script is in init.sqs.
They use a counter that determines when the loop is finished, and then they update the script continuosly. have a look at it, it's pretty simple and this is where I learned to make loop scripts.
-
at work hu? HA HA HA!!! j/k
o
yes
by the way i could not find it!
-
use this:
#loop
_camera camsettarget plane_name
_camera camcommit 0
@camcommitted _camera
~0.01
?not stop_following : goto "loop"
create a trigger over where you want the plane to be when you stop looking at it, group the trigger to the plane, and in the 'on activation' field put
stop_following = true
that way the camera will target the plane, keep targeting it until the plane reaches the trigger, and then continue through your camera script as normal.
*bedges puts on his moderator's hat*
at work hu? HA HA HA!!! j/k
o
yes
this has nothing to do with anything relevant. please refrain from typing stuff like this. we like to keep ofpec on-topic, clean and friendly.
-
O sorry my bad ;)
but i got it to work thanks guys!