Home   Help Search Login Register  

Author Topic: Camera on moving taget  (Read 630 times)

0 Members and 1 Guest are viewing this topic.

O Neil

  • Guest
Camera on moving taget
« on: 20 Mar 2003, 07:22:38 »
Hey

I was wondering, how do you get a camera to STAY infront of a guy in a moving car? Soz if it's the gayest question, but I've got no time to search at the moment.

O Neil

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Camera on moving taget
« Reply #1 on: 20 Mar 2003, 08:05:47 »
You could put the camera in a loop but there must be an other way.

RP

  • Guest
Re:Camera on moving taget
« Reply #2 on: 20 Mar 2003, 18:22:01 »
I belive there's a script for that in the editors depot, you should check it out.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Camera on moving taget
« Reply #3 on: 20 Mar 2003, 18:47:56 »
The script below will place the camera 15 meters in front in a
height of 5 meters of the vehicle of unit jeep1.

:note - vehicle jeep1 i'm using because if the jeep is not
named jeep1, but the driver then the camera wouldn't remain
onto the unit, when the unit has entered the jeep. While if the
jeep is named jeep1, it still makes no difference to the functionality.

Just place a jeep onto the map, name it jeep1 and create
a waypoint to somewhere for it.

Or try to place an empty jeep, then create a soldier close to it
(name it: jeep1), give it a waypoint type: GetIn (onto the jeep) and a second waypoint to somewhere. You will see the camera will remain in front of the unit (wether it's inside or outside the jeep).

:edit - ah yeah, the loop you see in the script is increasing
the local variable _i by 1 (every 0.01 seconds).
The condition to break the loop is: _i has reached 1500
This will be after 15 seconds (if my math-brain is still working
correct).

Code: [Select]
_i = 0
showCinemaBorder=true
titletext ["Camera Test","PLAIN DOWN"]

_cam = "camera" camcreate [0,0,0]  
_cam cameraeffect ["internal", "back"]  
_cam camsettarget vehicle jeep1  
_cam camsetrelpos [0,15,5]  
_cam camSetFOV 0.440
_cam camcommit 0
@camcommitted _cam  

#loop1
_cam camsettarget vehicle jeep1
_cam camsetrelpos [0,15,5]  
_cam camSetFOV 0.440
_cam camcommit 0
~0.01
_i = _i + 1
?(_i < 1500): goto "loop1"

titlecut ["","BLACK OUT",2]  

_cam cameraeffect ["terminate", "back"]  
camdestroy _cam  
titlecut ["","BLACK IN",2]  
exit

~S~ CD
« Last Edit: 20 Mar 2003, 18:52:05 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

O Neil

  • Guest
Re:Camera on moving taget
« Reply #4 on: 21 Mar 2003, 06:20:51 »
...Right, thxs.