Jump to content
rkemsley

Check if unit in getMissionLayerEntities

Recommended Posts

Spoiler

{

    if ( ( alive _x ) && ( [ _x ] call BIS_fnc_isCuratorEditable isEqualTo false ) && ( ( side _x ) == east ) && !( _x in getMissionLayerEntities "CampZeloran_Units" ) ) then {

        [ ZeusEast1_1_Curator, [ [ _x ], true ] ] remoteExec [ "addCuratorEditableObjects", 0, true ];

    }

} forEach thisList;

I have a trigger that adds all OPFOR units to the OPFOR Curator (basically reinforcements) when the units enter an area. However, I already have some units in the area that I don't want automatically added to the OPFOR Curator.

 

I have them all grouped in the "MissionLayerEntities" called CampZeloran_Units, however, I am not sure how to tell the computer to check if the unit is in the "getMissionLayerEntities".

 

Please help!

Share this post


Link to post
Share on other sites
2 hours ago, rkemsley said:
  Reveal hidden contents

{

    if ( ( alive _x ) && ( [ _x ] call BIS_fnc_isCuratorEditable isEqualTo false ) && ( ( side _x ) == east ) && !( _x in getMissionLayerEntities "CampZeloran_Units" ) ) then {

        [ ZeusEast1_1_Curator, [ [ _x ], true ] ] remoteExec [ "addCuratorEditableObjects", 0, true ];

    }

} forEach thisList;

I am not sure how to tell the computer to check if the unit is in the "getMissionLayerEntities".

 

https://community.bistudio.com/wiki/in

 

So, depending on how you're defining the units/arrays:

_layerUnits = (getMissionLayerEntities "CampZeloran_Units") select 0;
{
	if !(_x in _layerUnits) then {
		//add the units to curator
	};
} forEach _opForUnits;

 

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

×