EpochModTeam / Epoch

Epoch Survival Game Mode for ARMA 3
http://epochmod.com/
Other
91 stars 82 forks source link

error with use of EPOCH_worldObjectType #850

Closed vbawol closed 7 years ago

vbawol commented 7 years ago
10:06:55 Error in expression <["_modelName",""]];

_selectedConfig = (_modelName splitString " .") joinString >
10:06:55   Error position: <_modelName splitString " .") joinString >
10:06:55   Error Undefined variable in expression: _modelname
10:06:55 File mpmissions\__CUR_MP.Malden\epoch_code\compile\functions\EPOCH_worldObjectType.sqf, line 37
10:06:55 Error in expression <heckType;
} else {
_return = (getNumber(_finalConfig >> _checkType) == 1);
};

_>
10:06:55   Error position: <_finalConfig >> _checkType) == 1);
};

_>
10:06:55   Error Undefined variable in expression: _finalconfig
10:06:55 File mpmissions\__CUR_MP.Malden\epoch_code\compile\functions\EPOCH_worldObjectType.sqf, line 61
10:06:55 Error in expression <;
};
};
};

_finalConfig = (_config >> _selectedConfig);
if (_checkType isEqual>
10:06:55   Error position: <_selectedConfig);
if (_checkType isEqual>
10:06:55   Error Undefined variable in expression: _selectedconfig
10:06:55 File mpmissions\__CUR_MP.Malden\epoch_code\compile\functions\EPOCH_worldObjectType.sqf, line 54
10:06:55 Error in expression <check] call EPOCH_worldObjectType;};if (_ok) exitWith {};} forEach _nearObjects;>
10:06:55   Error position: <_ok) exitWith {};} forEach _nearObjects;>
10:06:55   Error Undefined variable in expression: _ok

source is: https://github.com/EpochModTeam/Epoch/blob/experimental/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_self.hpp#L118

condition = "_nearObjects = nearestObjects [player, [], 2];_check = 'water';_ok = false;{if (alive _x) then {_ok = [_x, _check] call EPOCH_worldObjectType;};if (_ok) exitWith {};} forEach _nearObjects;_ok";
Ignatz-HeMan commented 7 years ago

Tested it and it comes from the mosquitos / HouseFlys / HoneyBee. They disappear exactly on script run.

I made a test script in a loop to check, what cause the undefined variable:

`[] spawn { test = true; test3 = [];

while {test} do {
    {
        test2 = [_x, typeof _x, str _x, getpos _x, getmodelinfo _x];
        _object = _x;
        _selectedConfig = "";
        if (_object isEqualType objNull && !(isNull _object)) then {
            if (!isNull _object) then {
                if !(_object isKindOf "All") then {
                    (getModelInfo _object) params [["_modelName",""]];
                    if (isnil "_modelName") then {
                        test3 = pushback test2;
                    };
                    _selectedConfig = (_modelName splitString " .") joinString "_";
                } else {
                    _selectedConfig = typeOf _object;
                };
            };
        } 
        else {
            if (_object isEqualType "") then {
                _findStart = _object find ": ";
                if (_findStart != -1) then{
                    _start = _findStart + 2;
                    _selectedConfig = ((_object select [_start]) splitString " .") joinString "_";
                };
            };
        };
    } foreach (nearestobjects [player,[],100]);
    systemchat "running";
}

}`

The result of test3: [ [<NULL-object>,"Mosquito","1822076: mosquito.p3d",[23703.5,18534.9,1.31999],["mosquito.p3d","a3\animals_f\mosquito.p3d",false]], [<NULL-object>,"HouseFly","1822095: fly.p3d",[23530.1,18647.9,1.04924],["fly.p3d","a3\animals_f\fly.p3d",false]], [<NULL-object>,"HouseFly","1822096: fly.p3d",[23530.1,18646.9,1.46307],["fly.p3d","a3\animals_f\fly.p3d",false]], [<NULL-object>,"ButterFly_random","1822101: butterfly.p3d",[23244.7,18234.9,0.77814],["butterfly.p3d","a3\animals_f\butterfly.p3d",true]], [<NULL-object>,"HoneyBee","1822145: honeybee.p3d",[23599.5,18171.9,0.403757],["honeybee.p3d","a3\animals_f\honeybee.p3d",false]], [<NULL-object>,"ButterFly_random","1822160: butterfly.p3d",[23825.5,18026.8,0.146935],["butterfly.p3d","a3\animals_f\butterfly.p3d",true]], [<NULL-object>,"HoneyBee","1822163: honeybee.p3d",[23776.1,17970.2,0.441523],["honeybee.p3d","a3\animals_f\honeybee.p3d",false]] ]

Solution: https://github.com/EpochModTeam/Epoch/pull/852

vbawol commented 7 years ago

Sweet thanks! @Ignatz-HeMan