Wednesday 28 August 2013

ARMA 3, probability of presence for group


I recently wanted to create a group of units based on probability; so 50% of the time spawn a group of units at a certain position.

To do this create the group, set the probability of presence of the leader to your desired probability and then for each member of the group set a condition of presence that requires the leader to be present. So,

(alive group_leader);

Job done!



Edit - Added screenshots for clarity:

You can have as many units as you want, in this example I have a player (blue), a group leader (purple civillian in front), and 4 dependent civilians behind. Ordinarily you would have all these units grouped using the group tool (F2) so they work as a team but it is not required.
Units
 Group leader can be configured any way you want, what is required is to have a unique name (make a note of this) and to set a probability of presence (which will set the probability of the whole group spawning).

Group leader config

 Now onto setting up the dependent units. A unit will spawn when the expression in its condition of presence evaluates to true. In this case we want it to evaluate to true when the group leader is present. The syntax for this is
(alive group_leader);
making sure that group_leader is the name of the leader that you configured earlier.
Dependent unit config