OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: The-Architect on 26 Jun 2007, 23:17:02
-
A while ago Bedges wrote a great little script that checked how many enemy units were left on a map.
I tried it with ArmA and It doesn't seem to work right.
Could someone look at it please?
Linkage.
;calculate number of east on the map and report
;wait a moment, as the trigger array needs time to populate
~2
;assign the count to a variable and report back
_east_num = {alive _x} count all_east
hint format ["There are currently %1 East units left on the map", {alive _x} count all_east]
;keep the number up to date
#loop
?({alive _x} count all_east < _east_num) : hint format ["There are now %1 East units left on the map", {alive _x} count all_east]; _east_num = {alive _x} count all_east
~3
;if there are less than 30, end the script
?(_east_num < 30):goto "loop"
hint "There are now fewer than 30 East troops on the map"
exit
http://www.ofpec.com/forum/index.php?topic=28952.0
-
is all_east = thislist in trigger's activation?
-
Yeah, that did it.
A trigger covering all the map, triggered by East present, with your code in the on activation.
and a unit that starts the script with his init.
Cheers. :D
-
I often find myself searching for lengths on end trying to find that last enemy unit before i can end a mission.
Could i use a similar script to tell me when there is only X amount of enemy left alive in a certain trigger area,
??? & then showing me where they are on map? & even if they have not been spotted in a friendlies line of sight?
-
Check this (the attached example I mean):
Lee's exploding triggers (http://www.ofpec.com/forum/index.php?topic=29200.0)