Home   Help Search Login Register  

Author Topic: time between actions?  (Read 527 times)

0 Members and 1 Guest are viewing this topic.

warhammer

  • Guest
time between actions?
« 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?

Mr.T

  • Guest
Re:time between actions?
« Reply #1 on: 15 May 2003, 00:47:01 »
I would just make several triggers all lined up. Each trigger will eject a different guy from the init field.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:time between actions?
« Reply #2 on: 15 May 2003, 11:22:53 »
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.
Plenty of reviewed ArmA missions for you to play

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:time between actions?
« Reply #3 on: 16 May 2003, 01:53:58 »
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. ;)

warhammer

  • Guest
Re:time between actions?
« Reply #4 on: 16 May 2003, 09:42:15 »
It works!

I wrote this script:

Code: [Select]
_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!
« Last Edit: 16 May 2003, 09:43:30 by warhammer »

deaddog

  • Guest
Re:time between actions?
« Reply #5 on: 19 May 2003, 20:12:21 »
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.

 :)


« Last Edit: 19 May 2003, 20:13:41 by deaddog »