Home   Help Search Login Register  

Author Topic: Stay on car untill 'X' = true;  (Read 611 times)

0 Members and 3 Guests are viewing this topic.

ProudPotter2490

  • Guest
Stay on car untill 'X' = true;
« 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.
« Last Edit: 22 Dec 2005, 20:18:23 by ProudPotter2490 »

Offline Pilot

  • Contributing Member
  • **
Re:Stay on car untill 'X' = true;
« Reply #1 on: 22 Dec 2005, 21:17:23 »
This should work:

?atFuelPump: goto "LOOP2"

-Pilot

Offline 456820

  • Contributing Member
  • **
Re:Stay on car untill 'X' = true;
« Reply #2 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

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Stay on car untill 'X' = true;
« Reply #3 on: 22 Dec 2005, 23:18:50 »
I've never seen the command camSetRelTarget, maybe you meant camSetTarget.   :P


Planck
I know a little about a lot, and a lot about a little.

Offline 456820

  • Contributing Member
  • **
Re:Stay on car untill 'X' = true;
« Reply #4 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