Page MenuHomeFeedback Tracker

Add commands like allUnitsEast, allUnitsWest,allUnitsIndependent
Acknowledged, WishlistPublic

Description

I would be great to have an engine command to select units based on side.

The following examples are used very often, and always require to go through an array of all units first, and then selecting the units of the correct side with a if condition.

Example_1:

{
	if (side _x isEqualTo WEST) then
	{
		_x addEventHandler
		[
			"HandleDamage",
			{
				_returnDamage = (_this select 2);
				if ((side (_this select 0)) isEqualTo (side (_this select 3))) then
				{
					_returnDamage = 0;
				};
				_returnDamage;
			}
		];
	};
} forEach allUnits;

Example_2:

{
	if (side _x == EAST) then
	{
		 _x setBehaviour "COMBAT" 
	};
}forEach allUnits;

The main advantages of those new commands would be the improved legibility and lower performance impact.

Example_1 with allUnitsWest:

{
	_x addEventHandler
	[
		"HandleDamage",
			{
			_returnDamage = (_this select 2);
			if ((side (_this select 0)) isEqualTo (side (_this select 3))) then
			{
				_returnDamage = 0;
			};
			_returnDamage;
		}
	];
} forEach allUnitsWest;

Example_2 with allUnitsEast:

{
      _x setBehaviour "COMBAT" 
}forEach allUnitsEast;

Details

Legacy ID
3285397837
Severity
None
Resolution
Open
Reproducibility
Always
Operating System
Windows 7
Category
Feature Request

Event Timeline

R3vo set Category to Feature Request.Aug 28 2015, 10:59 AM
R3vo set Reproducibility to Always.
R3vo set Severity to None.
R3vo set Resolution to Open.
R3vo set Legacy ID to 3285397837.May 8 2016, 12:35 PM
R3vo updated the task description. (Show Details)Aug 12 2019, 5:19 PM
R3vo set Operating System to Windows 7.
R3vo updated the task description. (Show Details)