Home   Help Search Login Register  

Author Topic: Follow That Truck  (Read 641 times)

0 Members and 1 Guest are viewing this topic.

Abyss

  • Guest
Follow That Truck
« on: 01 Jan 2004, 21:22:44 »
hi guys i found a thing that is supposed to let a car follow anoyther one but it dont work it goes somthing like this.

Car1>12car2

Car1 domove car2

i cant rember where each one is supposed to go in right now but ive got the papre with it on some where but anyway when i put the in the fields that it tells me to i get some kind of error message can anyone help

Offline rhysduk

  • Former Staff
  • ****
Re:Follow That Truck
« Reply #1 on: 01 Jan 2004, 21:36:26 »
Personally i dont see how these peices of syntax can enable a car to follow another :)

Quote
Car1 domove car2

This will get a car to move to another car (the position of) AND

Quote
Car1>12car2

How can one car be greater than another   :o  ???

Unless somene can enlighten me ...

Rhys
Reviewed Missions Board: Please Read the User's Guide before posting!

Pride and Joy 1 (HW100-T)

Quid Novi

  • Guest
Re:Follow That Truck
« Reply #2 on: 01 Jan 2004, 21:41:03 »
Code: [Select]
_car1 = _this select 0
_car2 = _this select 1
_car3 = _this select 2

~0.2
_car3 DoFollow _car1

#Follow

~0.5
_car2 DoMove getPos _car1

~0.2
? (_car2 distance _car1)< 20 : DoStop _car2
? (_car1 distance _car3) > 50 : _car3 DoMove getPos _car2
? (_car2 distance _car3) < 20 : DoStop _car3
? (_car2 distance _car3) > 20 : _car3 DoFollow _car1

? (w1 In _car1) AND (driver _car2 != objNull) : GoTo "Follow"

this is a little script i used for a mission... basically it was to make 3 cars follow each other and stop if one guy got out... thats the last line which can be voided in this script as long as you add a loop (goto : "Follow")

exec it using:
Code: [Select]
[carname1, carname2, carname3] exec "script.sqs"
for 2 cars, just add in 2 names... should still work

Abyss

  • Guest
Re:Follow That Truck
« Reply #3 on: 02 Jan 2004, 11:55:56 »
yeah that script seems like that will do thanks  ;D

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Follow That Truck
« Reply #4 on: 04 Jan 2004, 12:18:20 »
ill improve dat script ;)

Code: [Select]
_count = count _This
_i = 1

#follow
(_this select _i) dofollow (_this select (_i-1))

? ((_this select _i) distance (_this select (_i-1))) < 15 : DoStop (_this select _i)
? ((_this select _i) distance (_this select (_i-1))) > 25 : (_this select _i-1)
DoMove getPos  (_this select _i)

? stopfollowscript : exit
? _i < count : _i=_i+1; goto "follow"
~0.5
_i = 1
goto "follow"

now u can do da same thing w/ as meny cars as u want ;) ;D

just exec like dat

[car1,car2,etc....] exec "scriptname.sqs"

nd wen u want em 2 stop just turn dis cari (stopfollowscript) 2 true

:cheers:

LCD OUT

P.S if it solved ur prob - press da prob solved botton
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta