Home   Help Search Login Register  

Author Topic: How do you script a squad to...  (Read 1116 times)

0 Members and 1 Guest are viewing this topic.

JackDVS

  • Guest
How do you script a squad to...
« on: 25 Jan 2005, 02:10:59 »
How do you script a squad to eject from a moving vehicle, with or without having the driver/pilot make a waypoint for it.

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re:How do you script a squad to...
« Reply #1 on: 25 Jan 2005, 14:37:33 »
Wrong board, BTW...

WITHOUT A WAYPOINT:

If you want a delay between soldiers coming out of the vehicle, use this:

Code: [Select]
_i = 0
_k = count units NameOfYourGroup

#Loop

_j = units NameOfYourGroup select _i
_j action [{EJECT}, NameOfYourVehicle]
unassignvehicle _j

~1

_i = _i + 1

? (_i == _k) : exit
goto "Loop"
Adjust the '~1' to whatever delay you want in seconds.

If you don't need a delay, you can use this:

Code: [Select]
"_x action [{EJECT}, NameOfYourVehicle]" forEach units NameOfYourGroup
"unassignvehicle _x" forEach units NameOfYourGroup
Syntax not tested, but it should be OK.

Give your group a name first with a command in group member's init field:

Code: [Select]
gw = group thisAnd use that name in the scripts.

Or you can customize these scripts to suit your needs, for example making them a more generic form scripts that take arguments.

You got the idea.
« Last Edit: 25 Jan 2005, 14:40:14 by Baddo »