avibird 1 141 Posted December 10, 2023 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
pierremgi 4740 Posted December 10, 2023 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; 1 Share this post Link to post Share on other sites
avibird 1 141 Posted December 16, 2023 @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
soldierXXXX 77 Posted December 16, 2023 You forgot to add units command before group just like in the code @pierremgi provided as example. That's why it throws error. Share this post Link to post Share on other sites
avibird 1 141 Posted December 16, 2023 Hey @soldierXXXX I not seeing what you are saying. Share this post Link to post Share on other sites
soldierXXXX 77 Posted December 16, 2023 Write condition in your trigger like this (({alive _x} count units grp_oneGroup) < 3); Share this post Link to post Share on other sites
avibird 1 141 Posted December 17, 2023 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
pierremgi 4740 Posted December 17, 2023 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