OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: ProudPotter2490 on 22 Dec 2005, 20:16:43
-
I'm making a small camera script. I want it to lock onto a car and stay there until a unit reaches a certain waypoint. After that I want it to carry on with the script.
I'm thinking something along the lines of:-
#LOOP1
_cam camSetRelTarget car1
_cam camSetRelPos [-20,7.5,15]
_cam camCommit 0
man say "sound8"
~1
atFuelPump = true (goto:"LOOP2")
goto:"LOOP1"
But I know that wont work. It's the bit at the bottom that needs working on I think. Any ideas? Thanks all.
-
This should work:
?atFuelPump: goto "LOOP2"
-Pilot
-
yep Pilot is correct and also you may want to consider changing the ~1 to something less like ~0.01 you may encounter lag but it will be more smoother since with a wait of 1 second it will be very jumpy since it wont catch up to the car in time
but its best to experimentif not much is going on at that time i use ~0.0
just experiment for the best result for yourself
-
I've never seen the command camSetRelTarget, maybe you meant camSetTarget. :P
Planck
-
IIRC its not CamSetRelTarget it should be
CamSetRelPos not target thats what it says in snYpir's tut
camera id camsetrelpos [0,0.5,1]
thats what it says that will place the camera 0metres to the left/right 0.5 metres behind you and 1 metre of the ground to the object the camera is targetting