Home   Help Search Login Register  

Author Topic: Vehicles Counting as Civilians  (Read 1056 times)

0 Members and 1 Guest are viewing this topic.

Offline Hellbender

  • Members
  • *
Vehicles Counting as Civilians
« on: 09 Nov 2007, 17:35:34 »
I have a trigger that counts how many civilians are alive. If the count drops below 6, the objective is failed. It's tried and true, and works fine when I test it!

The problem is that in my mission, the empty (civilian) vehicles that are parked in the town seem to count as live civilians, so of course that screws up the count!

Is there anything I can do about that or do I have to simply take the vehicles into account in my trigger?

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Vehicles Counting as Civilians
« Reply #1 on: 09 Nov 2007, 19:02:55 »
I'm assuming you are using a condition of
Code: [Select]
(count thisList) < 6

You'll also find that a vehicle counts as one, whether it is empty or it is a bus filled with civilians. You need to both ignore vehicles and count all the crew in those vehicles.

You could try the condition:
Code: (Trigger condition) [Select]
men = 0; { men = men + (count (crew _x)) } forEach thisList; men < 6

which counts the total number of civilians within the trigger area, including those on foot or currently in vehicles, but not including the vehicles themselves.
« Last Edit: 09 Nov 2007, 19:06:07 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Hellbender

  • Members
  • *
Re: Vehicles Counting as Civilians
« Reply #2 on: 09 Nov 2007, 23:36:18 »
Thanks Spooner!

That did the trick!  :good: