OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Blanco on 20 Jan 2003, 22:19:45

Title: getout with created vehicles
Post by: Blanco on 20 Jan 2003, 22:19:45
What I trying to do :

I create 3 vehicles with createvehicle, move them to a certain place , when they arrive they all have to disembark

It works great, exept the disembarking...

Here is the script I wrote and forgive me if there are spell errors cause I don't have OFP with me right now...

but first...

3 empty markers : "c1","c2","c3" : these are the spawnplaces
1 empty markers : "m" : these are move pos for each car

"cd1","cd2","cd3"   are the drivers somewhere in the map. cd3 is the Leader and the highest rank


script.sqs

; create the 1th jeep and move the driver in

car1 = "UAZ" createvehicle getmarkerpos "c1"
car1 setdir 45
cd1 assignasdriver car1
cd1 moveindriver car1


; create the 2th jeep and move the driver in

car2 = "UAZ" createvehicle getmarkerpos "c2"
car2 setdir 45
cd2 assignasdriver car2
cd2 moveindriver car2


; create the 3th jeep and move the Leader driver in

car3 = "UAZ" createvehicle getmarkerpos "c3"
car3 setdir 45
cd3 assignasdriver car3
cd3 moveindriver car3


; move,formation and join

cd3 move getmarkerpos "m"
cd3 setformation "column"
[cd1,cd2] join cd3
[cd1,cd2] dofollow cd3


exit

...I want them to disembark at "m", I need it because there is a trigger at "m" and he detects if "c1" or "c2" or "c3" is in it or not. When the drivers stay in the cars the trigger don't work.
I know ordergetin true but there is no ordergetout true command...

I'm using res 1.90.

Blanco

Title: Re:getout with created vehicles
Post by: CrashnBurn on 21 Jan 2003, 02:26:59
You dont need the assignasdriver command if you are moving them in. It's only used for the ordergetin command so you can delete those lines. To make them all get out at the marker put this after the move command-

@ Unitready cd3
"unassignvehicle _x" foreach units groupname

where groupname is the name of cd3's group. Everyone in his group will get out of the vehicles. Here's your code cleaned up a bit:


car1 = "UAZ" createvehicle getmarkerpos "c1"
car1 setdir 45
cd1 moveindriver car1
~1
car2 = "UAZ" createvehicle getmarkerpos "c2"
car2 setdir 45
cd2 moveindriver car2
~1
car3 = "UAZ" createvehicle getmarkerpos "c3"
car3 setdir 45
cd3 moveindriver car3
~1
[cd1,cd2] join cd3
cd3 move getmarkerpos "m"
@ Unitready cd3
"unassignvehicle _x" foreach units groupname

exit
Title: Re:getout with created vehicles
Post by: Blanco on 21 Jan 2003, 20:46:36
cd3 setformation isn't nessecary?
I thought I allready tried @ Unitready cd3 but maybe I forgot a space between @ & unitready...because it gave errors with that line.

@ means : "wait until" right? Does it only work with waypoints?
...and I didn't know about unassignvehicle command...

Ok, I try this  ;) Thanks

Blanco

**** solved ****

Thank you