Home   Help Search Login Register  

Author Topic: Cam settarget  (Read 638 times)

0 Members and 2 Guests are viewing this topic.

marcus3

  • Guest
Cam settarget
« 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?

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:Cam settarget
« Reply #1 on: 11 Aug 2005, 13:13:12 »
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.
OFPEC | Intel Depot
RETARDED Ooops... Retired!

marcus3

  • Guest
Re:Cam settarget
« Reply #2 on: 11 Aug 2005, 23:22:32 »
at work hu? HA HA HA!!! j/k
o
yes
by the way i could not find it!
« Last Edit: 11 Aug 2005, 23:27:09 by marcus3 »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Cam settarget
« Reply #3 on: 12 Aug 2005, 17:31:34 »
use this:

Code: [Select]
#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

Code: [Select]
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*

Quote
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.

marcus3

  • Guest
Re:Cam settarget
« Reply #4 on: 14 Aug 2005, 14:29:54 »
O sorry my bad ;)

but i got it to work thanks guys!