OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: warhammer on 15 May 2003, 00:36:36
-
can i make a unit wait 2 seconds before ejecting?
i want a group to eject from a heli, but not at the same time..
for example: unit1 action ["eject", heli]; "?time=2seconds?" unit2 action ["eject", heli]
is this possible?
-
I would just make several triggers all lined up. Each trigger will eject a different guy from the init field.
-
To create a delay of two seconds in a script write this
~2
I'm not sure if it works in a trigger. Use a script rather than a bunch of triggers: too many triggers can cause lag.
-
The other alternative is to give a game logic unit some waypoints...
You can put the pause in the timeout field (the bit with min, mid and max... just use all the same value) in the gamelogic's waypoint.
This is how BIS did conversations in their official missions without the need for a script.
For more details, check out the tutorials section of the Editor's Depot (http://www.ofpec.com/editors/index.php). ;)
-
It works!
I wrote this script:
_heli= _this select 0
_u1= _this select 1
_u2= _this select 2
_u3= _this select 3
_u4= _this select 4
_u5= _this select 5
_u6= _this select 6
_u7= _this select 7
_u8= _this select 8
_u9= _this select 9
u10= _this select 10
u11= _this select 11
u12= _this select 12
_u1 action ["eject", _heli]
~0.5
_u2 action ["eject", _heli]
~0.5
_u3 action ["eject", _heli]
~0.5
_u4 action ["eject", _heli]
~0.5
_u5 action ["eject", _heli]
~0.5
_u6 action ["eject", _heli]
~0.5
_u7 action ["eject", _heli]
~0.5
_u8 action ["eject", _heli]
~0.5
_u9 action ["eject", _heli]
~0.5
_u10 action ["eject", _heli]
~0.5
_u11 action ["eject", _heli]
~0.5
_u12 action ["eject", _heli]
exit
picture of my script in action:
[img removed]ejectpic1.jpg[/img]
thank you all for the help!
-
A simple loop is much more efficient:
Make a script named "eject.sqs"
_g = _this select 0
_v = _this select 1
_i=0
#loop
_u =(units _g) select _i
_u action ["eject",_v]
unassignvehicle _u
~2
_i=_i+1
?_i<count (units _g):goto "loop"
exit
call this script this way:
[groupname,vehiclename] exec "eject.sqs"
This is basically the same script in the code snippets section.
It works for any number of units in the group and for any vehicle they happen to be in.
:)