During my modding project XMS2 i discovered that some working scripts are "bugged" due the time when they got added to a command array
as example just lets pick this here:
{
private['_unit', '_x'];
X39_XLib_var_ActionDialog_Executor playMove 'AidlPknlMstpSrasWrflDnon_AI';
_unit = objNull;
{
if(_x getVariable ['X39_MS2_var_UnitInitialized', false]) then { _unit = _x; }; false
} count attachedObjects X39_XLib_var_ActionDialog_Executor;
if(!isNull _unit) then
{
detach _unit; _unit playMove 'AinjPpneMstpSnonWrflDb_release';
}
else
{
systemChat 'WHOOOPS! Something moved TERRIBLY wrong ...'; systemChat 'Seems like ArmA bugs out with SQF AGAIN -.-*'; systemChat 'Please report at XMS2 bugTracker and well ...'; systemChat 'keep attached : /';
};
- call X39_XLib_fnc_ActionDialog_closeDialog; }
there is no issue inside of this peice of code
but arma thinks different:
Error in expression <else> Error position: <else> Error Undefined variable in expression: else Error in expression <else> Error position: <else> Error Undefined variable in expression: else
(sometimes arma also prints that the operation _unit = _x would be invalid ...)
i was able to discover that the issue is bount to the fact that im using a function to register the code (when using the ESC menu this wont happen)