OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: klavan on 29 Oct 2005, 12:45:30
-
#Next2
~5.5
player sidechat "I wonder what the hell....."
~3
playsound "GENB_Growl"
"gmer_civie_01" createunit [getmarkerpos "SkePos1",FakeRussi,"mon1=this",0.7,"Private"]
[mon1] join grpnull
@ {!alive _x} foreach [mon1]
~3
hint "done"
exit
I don't receive any error message, but the hint doesn't appears after the created unit is killed. This script is under development and when finished, it will include about 20 created units (mon1 to mon20).
What do you think the problem is?
Thanks
Klavan
-
I think the problem is that forEach does not return anything, so you can't use it as a condition.
-
OK, thank you Baddo.
Klavan
-
try to use
#wait1
~0.5
{if (alive _x) then {goto "wait1"}} foreach [mon1]
-
alternatively...
#Next2
~5.5
player sidechat "I wonder what the hell....."
~3
playsound "GENB_Growl"
"gmer_civie_01" createunit [getmarkerpos "SkePos1",FakeRussi,"mon1=this",0.7,"Private"]
[mon1] join grpnull
@ (({alive _x} count [mon1]) == 0)
~3
hint "done"
exit
simply counts the number of units alive in the array containing mon1, and waits until it's 0.
-
Problem solved!
I've adopted bedges's solution.
Sintax always drive me mad! ;D
Thank to all you guys for your help.
Be prepared to be scared........ 8)
klavan