OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Matt_Skillett on 07 Feb 2003, 00:22:57
-
CAn anyone help me with how to use arrays in a mission. ive read a few help guides but they havent helped too much. All i want it for is so that when a group/the enemy gets below a certain number a trigger will activate? i'm ok wit the editor but not too sweet on the code.
Thanks
-
Arrays are one of my betes noire. Fortunatly I seem to get by most of the time and for what you are asking it's not a big deal. You need code, but only one line and its very easy. In the condition field of you trigger write
condition: count units theGroup < 3
or something - I can never remember the exact syntax for anything, so look it up in the command reference. But that's basically what you want. If the vital number was the total number of loons in two (or more) groups you would have
condition: (count units Group1)+(count units Group2) < 5
again check the syntax.
If it was the total number of baddies on the whole map, then make a big trigger covering the whole map
activation: East present Repeatedly
condition: thislist < 6
as with ever answer I give, check the syntax, you may have to play with it.
Hope that all makes sense. :)
Have a look at Johan Gustafsson's scripting tute in References, if you haven't already, that might help.
-
macguba has the correct syntax.
For that last condition insert a count as the first word yourself ;)
-
don't look at me, it was pure luck .... ;D
count thislist < 6