OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: ProudPotter2490 on 22 Dec 2005, 20:16:43

Title: Stay on car untill 'X' = true;
Post 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:-
Quote
#LOOP1
_cam camSetRelTarget car1
_cam camSetRelPos [-20,7.5,15]
_cam camCommit 0

man say "sound8"

~1

atFuelPump = true (goto:"LOOP2")
goto:"LOOP1"
Quote

But I know that wont work. It's the bit at the bottom that needs working on I think. Any ideas? Thanks all.
Title: Re:Stay on car untill 'X' = true;
Post by: Pilot on 22 Dec 2005, 21:17:23
This should work:

?atFuelPump: goto "LOOP2"

-Pilot
Title: Re:Stay on car untill 'X' = true;
Post by: 456820 on 22 Dec 2005, 22:09:38
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
Title: Re:Stay on car untill 'X' = true;
Post by: Planck on 22 Dec 2005, 23:18:50
I've never seen the command camSetRelTarget, maybe you meant camSetTarget.   :P


Planck
Title: Re:Stay on car untill 'X' = true;
Post by: 456820 on 24 Dec 2005, 19:51:39
IIRC its not CamSetRelTarget it should be
CamSetRelPos not target thats what it says in snYpir's tut

Quote
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