//*update - IT IS ARMA 3 CORE. it is not CBA like I previously updated. I updated this yesterday to say the problem was CBA, but actually I was incorrect. Same error without any mods at all. It is Arma 3 core bug.
If you use this code:
[] spawn { waitUntil {!isNil "BIS_marta_mainscope"}; player setVariable [ "MARTA_hide", allGroups select {side _x != playerSide}]; };
you get an error when enemy group is detected. Listed below.
18:35:13 Error in expression <N_TYPE"; _icon = (_element getgroupicon _iconID) select 0; _iconname = _groupico> 18:35:13 Error position: <_iconID) select 0; _iconname = _groupico> 18:35:13 Error Undefined variable in expression: _iconid 18:35:13 File A3\modules_f\hc\data\scripts\hc_local.sqf..., line 106 18:35:13 ➥ Context: [] L80 (A3\modules_f\hc\data\scripts\hc_local.sqf) [loop] L93 (A3\modules_f\hc\data\scripts\hc_local.sqf) [] L100 (A3\modules_f\hc\data\scripts\hc_local.sqf) [] L102 (A3\modules_f\hc\data\scripts\hc_local.sqf) [] L108 (A3\modules_f\hc\data\scripts\hc_local.sqf) 18:35:13 Error in expression <_start} else {0}; _array = _array + [[_itemName, [_itemShortcut], format [_sub> 18:35:13 Error position: <_itemName, [_itemShortcut], format [_sub> 18:35:13 Error Undefined variable in expression: _itemname 18:35:13 File \A3\Functions_F\Misc\fn_createmenu.sqf..., line 68 18:35:13 ➥ Context: [] L80 (A3\modules_f\hc\data\scripts\hc_local.sqf) [loop] L93 (A3\modules_f\hc\data\scripts\hc_local.sqf) [] L129 (A3\modules_f\hc\data\scripts\hc_local.sqf) [main] L53 (\A3\Functions_F\Misc\fn_createmenu.sqf) [] L59 (\A3\Functions_F\Misc\fn_createmenu.sqf) [] L68 (\A3\Functions_F\Misc\fn_createmenu.sqf)
the only way to prevent the error is use this beforehand:
player setVariable [ "MARTA_reveal", allGroups select {side _x != playerSide}]; sleep 1;
However that is nonesensical, then you seen the enemy group icons for a moment amd it defeats the purpose- there is a fade animation and gives away all their positions, before the "MARTA_HIDE" kicks in.
even if you have the commands right next to each other without sleep, you still get the error.
player setVariable [ "MARTA_reveal", allGroups select {side _x != playerSide}]; player setVariable [ "MARTA_hide", allGroups select {side _x != playerSide}];
equals error.
Looking at all BIS documentation and the code in the forums, seems like just using "MARTA_HIDE" on groups that have not been detected yet by your side should not throw an error.