Home   Help Search Login Register  

Author Topic: Counting dead bodies in a trigger  (Read 1351 times)

0 Members and 1 Guest are viewing this topic.

Offline Arkon

  • Members
  • *
Counting dead bodies in a trigger
« on: 26 Jun 2007, 19:02:33 »

Hi,

I need to count all the dead bodies in a trigger but to include the bodies from all the sides (West/East/Ind/Civs). I want them all to be placed into one array for further reference in a script... if possible.

To much of a head banger for me, any offers?

Thanks

Offline LeeHunt

  • Former Staff
  • ****
  • John 21:25
Re: Counting dead bodies in a trigger
« Reply #1 on: 26 Jun 2007, 19:53:10 »
hi Arkon,

Here's how you can get a count of the alive units in a trigger, and i'm guessing substituting "not alive" for "alive in the below script will give you what you are looking for:

To get west, east and civilians you need three triggers, all on this basis:

To get all the East soldiers, create a trigger that runs EAST and PRESENT for the area.  name the trigger "triggerEast".

Then in your script put:

_vehListEast = list triggerEast

East_loons = []

{{if (alive _x) then {East_loons = East_loons + [_x]}} forEach crew _x} forEach _vehListEast
-----------------------------------------------

Ok so now East_loons will give you a count of all the East soldiers.  I am guessing substituting not alive _x will give you the bodies/body count.  Then create two other similar triggers for WEST and Civilians.  let me know how that goes

Offline Arkon

  • Members
  • *
Re: Counting dead bodies in a trigger
« Reply #2 on: 26 Jun 2007, 20:18:24 »


Hi Lee,

Thanks for your quick reply, I'll give it a go tonight and get back to you...
Cheers

Arkon

Offline LeeHunt

  • Former Staff
  • ****
  • John 21:25
Re: Counting dead bodies in a trigger
« Reply #3 on: 27 Jun 2007, 16:50:24 »

Offline Arkon

  • Members
  • *
Re: Counting dead bodies in a trigger
« Reply #4 on: 27 Jun 2007, 19:48:40 »


Hi Lee,

Thanks for that, it may well do the trick for me :)

Arkon