Page MenuHomeFeedback Tracker

Add "allUnitsKilled" or "notAlive" group eventhandler
New, NormalPublic

Description

There were quite some nice group eventhandlers introduced in A3 patch 2.10.

What is missing is a group eventhandler which fires when all units of a group were killed. So one doesn't constantly have to check if there is still a unit alive in a group to respawn the group for example.

Something like
group addEventhandler ["allUnitsKilled", {do some stuff}]

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Feature Request

Event Timeline

Xeno created this task.Feb 26 2023, 2:58 PM
Xeno changed Category from General to Feature Request.Feb 26 2023, 3:00 PM

I'd suggest "UnitKilled" event handler instead. There you can check if everyone is dead as well doing something on individual unit death.

Xeno added a comment.EditedFeb 27 2023, 9:19 AM

Samatra, there is already a killed EH.

This is about an event handler only firing when all units in a group are dead.. Needed for AI groups in Co-op missions for example.

Currently you have to constantly iterate over all units of a group to check if all units are down.

So virtually like the empty group EH which only fires when all units in a group are deleted.

Samatra, there is already a killed EH.

This is about an event handler only firing when all units in a group are dead.. Needed for AI groups in Co-op missions for example.

Currently you have to constantly iterate over all units of a group to check if all units are down.

So virtually like the empty group EH which only fires when all units in a group are deleted.

I meant group's "Killed" event handler, which is added to the group and fires each time group unit dies. Unless you mean there is already one in https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Group_Event_Handlers

Example:

_group addEventHandler ["UnitKilled", {
	params ["_group", "_unit"];
	if(units _group findIf {alive _x} < 0) then {
		// Everyone is dead
	};
}];
dedmen set Ref Ticket to AIII-55571.Mar 1 2023, 11:10 AM