Home   Help Search Login Register  

Author Topic: script editing  (Read 435 times)

0 Members and 1 Guest are viewing this topic.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
script editing
« on: 28 Nov 2004, 05:53:21 »
hello,
How can i change this script
Code: [Select]
_grp = _this select 0
_vehicle = _this select 1

_aunits = units _grp
_i = 0
_j = count _aunits

#Here
(_aunits select _i) action ["EJECT",_vehicle]
_i=_i+1
~.4
?_j>_i:goto "Here"

exit
that activates using: [grp1,heli1] exec"groupeject.sqs"

into a script that can eject more than 1 group at a time from the same heli.

so you could enter in the init:
[grp1,grp2,grp3,grp4,grp5,heli1] exec"groupeject.sqs

if you dont understand basicly:

I have 5 grps that are in one helo(big helo) and I want the script above to eject them all using this syntax in an activation field of a trigger.(or somthing like it)

[grp1,grp2,grp3,grp4,grp5,heli1] exec groupeject.sqs"

how would i change the script to do this?

thanks

Offline Blanco

  • Former Staff
  • ****
Re:script editing
« Reply #1 on: 28 Nov 2004, 06:15:52 »
You have to put all groupnames in an array first and execute it with

[[grp1,grp2,grp3,...],heli] exec "eject.sqs"


But I use the script below. it doesn't matter who's in the chopper, all men in cargo will jump.

Quote
;[name of heli] exec "eject.sqs"

_helo = _this select 0
_allcrew = crew _helo
? (count crew _helo)<=2 && !isnull driver _helo && !isnull driver _helo :goto "DONE"
_array = []
"if (_x != driver _helo && _x != gunner _helo) then {_array = _array + [_x]}" foreach _allcrew
_allcrew = _array
? count _allcrew == 0 : goto "done"
_c = 0
#eject
_man = (_allcrew select _c)
?!alive _man : goto "skip"
unassignvehicle _man
_man action ["EJECT",_helo]
~0.3
#skip
_c = _c + 1
? _c != count _allcrew : goto "eject"
#done

You only need the name of the heli to run the script.
« Last Edit: 28 Nov 2004, 06:19:30 by Blanco »
Search or search or search before you ask.