Home   Help Search Login Register  

Author Topic: Count East Units ArmA  (Read 2391 times)

0 Members and 1 Guest are viewing this topic.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Count East Units ArmA
« 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.

Code: [Select]
;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
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Count East Units ArmA
« Reply #1 on: 26 Jun 2007, 23:22:29 »
is all_east = thislist in trigger's activation?

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: Count East Units ArmA
« Reply #2 on: 27 Jun 2007, 01:15:24 »
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
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Carroll

  • Members
  • *
  • Mission Designer (MP-"well tryin to capiche"
Re: Count East Units ArmA
« Reply #3 on: 27 Jun 2007, 12:36:49 »
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?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Count East Units ArmA
« Reply #4 on: 27 Jun 2007, 12:54:01 »
Check this (the attached example I mean):
Lee's exploding triggers