OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Captain Crunch on 14 Apr 2007, 06:08:31

Title: CountSide command
Post by: Captain Crunch on 14 Apr 2007, 06:08:31
Hi.

I would like to make a trigger that will send choppers back to the base when most their enemies are dead. In the trigger's condition field I thought I'd put a snippet using the Count, Countside, CountFriendly or CountEnemy commands. Like:

Code: [Select]
RACS CountFriendly < 5
But ofcourse the syntax isn't right. Can anybody help me? Thank You.
Title: Re: CountSide command
Post by: Trash Can Man on 14 Apr 2007, 08:49:34
RACS countSide list triggerOne    :dunno: maybe this will help...


TCM
Title: Re: CountSide command
Post by: h- on 14 Apr 2007, 09:57:20
Why would you use the countSide/Enemy/Friendly since you can make the trigger to be activated only by the side you want so you do not need such commands.. :scratch:

Title: Re: CountSide command
Post by: Captain Crunch on 14 Apr 2007, 14:27:44
h-, Your help has been great once again. It works perfectly, and whats more, it is clear and simple. Thank You.

EDIT:

Oh, one more question about this Count command, what if I want to count cargo units in a chopper? Or just to count units in a chopper? Is this possible too?
Thanks.

Jason
Title: Re: CountSide command
Post by: h- on 14 Apr 2007, 15:56:16
For counting the whole bunch of people inside a chopper, use count crew choppername.
The command crew (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=c#crew) returns everybody in the chopper (or in any vehicle) in order of [commander,driver,gunner,cargo] (if I remember correctly..)

For counting cargo there are several ways:
- Make a 'note' of the cargo position amount in an empty chopper in the init.sqs/sqf and save it in a global variable, using the command emptyPositions (http://www.ofpec.com/COMREF/ArmAOnly/index.php?action=list&game=All&letter=d#emptyPositions)
Code: [Select]
someglobalvariable = choppername emptyPositions "cargo"and then later on compare that amount with the current empty cargo seats in the chopper and this way you get the number of cargo seats taken, which you can then use in counting the cargo..

- Use the new command getNumber (http://www.ofpec.com/COMREF/ArmAOnly/index.php?action=list&game=All&letter=g#getNumber). If your chopper is for example a blackhawk you can get the amount of cargo it can transport with getNumber
Code: [Select]
getNumber (configFile >> "CfgVehicles" >> "UH60" >> "transportSoldier")Which you can again compare to the empty seats you get with emptyPositions like in the above example

- You can also write a script that goes through the array given by the crew (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=c#crew) command and saves the amount of cargo in some variable. If the unit in the array is not commander, driver nor gunner, it is cargo..
Title: Re: CountSide command
Post by: Captain Crunch on 14 Apr 2007, 16:16:32
 :clap:

Wow. Ok. You are pretty good I can guess. I'll try this out. Thanks again h-!