Jump to content
avibird 1

Need help with a code to delete group if the group has less then 3 units alive in the group?

Recommended Posts

I have this code in a a trigger to delete a group when all the units in the group are killed except for the squad leader who is usually away from the group with  a dostop command.

 

Trigger expression

Call {{alive _x} count [ m1, m2, m3, m4, m5, m6, m7,m8,m9] < 1}

 

On Activation 

DeleteVehicle GL

 

Is there a way I can have the group deleted if say the group only has <  then 3 units still alive in the group. So if the GL and one of the unit is still alive I would like the entire group to get deleted. 

Share this post


Link to post
Share on other sites

condition:

{alive _x} count units oneGroup < 3

 

Note: the GL is not a specific case, imho.

 

{deleteVehicle _x} count units oneGroup;

Note: after V2.16 released : deleteVehicle units oneGroup;

deteteGroup oneGroup;

 

 

 

 

 

  • Like 1

Share this post


Link to post
Share on other sites

@pierremgi not working message error 

'{alive _x} |#| count grp_oneGroup  < 3' Error count: type Group, expect Array. 

Share this post


Link to post
Share on other sites

Write condition in your trigger like this

(({alive _x} count units grp_oneGroup) < 3);

 

Share this post


Link to post
Share on other sites

I am using jebus spawning script one of the best respawning scripts out there if you have not used it.  The issue is the group variable name does not carry over but the individual units within the group variable names do carry over so I need to use the group leader variable name not the the group variable name to allow the code to work properly. thanks for the help guys.

 

 

Share this post


Link to post
Share on other sites

units works also with a unit (leader or not) of the group:

 

units grp_oneGroup  // array of units of the group

is same as

units leader grp_oneGroup

or even

units oneGuyOfTheGroup  (if a unit is named oneGuyOfTheGroup).

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×