OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: 456820 on 21 Dec 2005, 21:38:32
-
how do i check when all squads named (grpalpha, grpbravo and grpcharlie) are in their choppers named (uh601, uh602 and uh603) grpalpha has uh601, grpbravo has uh602 and you should work out which one grpcharlie has
anyway how do i check when all the soldiers of those 3 squads are in their designated chopper then set a variable to true ? (i can do the variable bit but not the first bit)
something like
_x in uh601 foreach units grpalpha
i havent tried it but i dont think its right so i dont see a point of trying
thanks
-
I think you're on the right track. Something like this should work:
Condition field of trigger:
"_x in uh601" foreach units grpalpha and "_x in uh602" foreach units grpbravo and "_x in uh603" foreach units grpcharlie
On Activation:
Variable=true
-Pilot
-
hey thanks alot ill try that ASAP cheers
edit - just tried and i copied it into my trigger's condition field and got this error
"and: Type Nothing, Expected Bool"
any readon for that ?
i myself cant see anything wrong with the syntax
-
I think you're going to have to write a script.
EDIT: Maybe they need brackets like,
Not (me1 in Uh60)
I don't know, just a thought.
-
cheers Architect ill have a go sometime cant now though but shall tomorow cheers
-
...I just tested my code and it didn't work...strange. I did find something that I know works, though. In the On Activation field for the Get In waypoint for grpAlpha, enter:
GrpAlphaIn=true
Do this for the other groups in their Get In waypoints:
GrpBravoIn=true
GrpCharlieIn=true
Then, in a trigger, put the following in the Condition field:
GrpAlphaIn and GrpBravoIn and GrpCharlieIn
On Activation:
Variable=true
-Pilot
-
Count, dear boy, count. What you need is count not forEach
"alive _x" count units grp1 == "_x in chopper1" count units grp1
or something along those lines.
-
*casts a sullen look down at feet*
Yes, sir.
;D
Thanks for that, Macguba. I had completely forgotten about count. What would we poor editors do without you?
-Pilot
-
ha ha indeed thanks alot for that Macguba ill try that out before solving the thread
cheers
-
There is also a little helper for this kind of situations in the function library:
groupInVehicle (http://www.ofpec.com/editors/funcref.php?filter_func=73)
-
cool thanks alot i dont really need it now but it could still come in handy
thanks everyone
topic solved