1) Place an Industrial Shed and Big Dome in the editor or find them.
2) Run SQF below in debug console when in-game
3) "Door X" will appear as an action for doors that are working, this action disappears past 15m of object center.
if !(isNil "selection_evh") then {removeMissionEventHandler ["Draw3D", selection_evh]};
selection_evh = addMissionEventHandler ["Draw3D", {
_cobj = getCursorObjectParams;
_obj = getCursorObjectParams select 0;
_curSel = _cobj select 1;
_sel = (selectionNames _obj) + _curSel;
_selDone = [];
{
if !(_x in _selDone) then {
_color = if (_x in (_cobj select 1)) then {[0,1,0,0.75]} else {[1,0,0,0.75]};
drawIcon3D [
"",
_color,
_obj modelToWorld (_obj selectionPosition [_x,"Geometry"]),
1,
1,
0,
_x,
1
];
_selDone pushBack _x;
};
} forEach _sel;
if (_obj getVariable ["debugAct",true]) then {
_numDoors = [configFile >> "CfgVehicles" >> typeOf _obj, "numberOfDoors",0] call BIS_fnc_returnConfigEntry;
for "_door" from 1 to _numDoors do {
_UAOpenCfg = (configFile >> "CfgVehicles" >> typeOf _obj >> "UserActions" >> format ["OpenDoor_%1",_x]);
_obj addAction [
format["Door %1",_door],
{_type = typeOf (_this select 0); hint _type; [nil,configFile >> "CfgVehicles" >> _type >> "UserActions"] call BIS_fnc_configviewer;},
_x,
([_UAOpenCfg, "priority", 11] call BIS_fnc_returnConfigEntry) + 1,
true,
true,
"",
"",
([_UAOpenCfg, "radius", 1.75] call BIS_fnc_returnConfigEntry),
false,
([_UAOpenCfg, "actionNamedSel", format["Door_%1",_door]] call BIS_fnc_returnConfigEntry)
];
};
_obj setVariable ["debugAct",false];
};
}];
```
if !(isNil "selection_evh") then {removeMissionEventHandler ["Draw3D", selection_evh]};
selection_evh = addMissionEventHandler ["Draw3D", {
_cobj = getCursorObjectParams;
_obj = getCursorObjectParams select 0;
_curSel = _cobj select 1;
_sel = (selectionNames _obj) + _curSel;
_selDone = [];
{
if !(_x in _selDone) then {
_color = if (_x in (_cobj select 1)) then {[0,1,0,0.75]} else {[1,0,0,0.75]};
drawIcon3D [
"",
_color,
_obj modelToWorld (_obj selectionPosition [_x,"Geometry"]),
1,
1,
0,
_x,
1
];
_selDone pushBack _x;
};
} forEach _sel;
if (_obj getVariable ["debugAct",true]) then {
_numDoors = [configFile >> "CfgVehicles" >> typeOf _obj, "numberOfDoors",0] call BIS_fnc_returnConfigEntry;
for "_door" from 1 to _numDoors do {
_UAOpenCfg = (configFile >> "CfgVehicles" >> typeOf _obj >> "UserActions" >> format ["OpenDoor_%1",_x]);
_obj addAction [
format["Door %1",_door],
{_type = typeOf (_this select 0); hint _type; [nil,configFile >> "CfgVehicles" >> _type >> "UserActions"] call BIS_fnc_configviewer;},
_x,
([_UAOpenCfg, "priority", 11] call BIS_fnc_returnConfigEntry) + 1,
true,
true,
"",
"",
([_UAOpenCfg, "radius", 1.75] call BIS_fnc_returnConfigEntry),
false,
([_UAOpenCfg, "actionNamedSel", format["Door_%1",_door]] call BIS_fnc_returnConfigEntry)
];
};
_obj setVariable ["debugAct",false];
};
}];
```