Smart Games 76 Posted August 3, 2019 I use a function that needs the coordinates of a trigger. trigger init: null = [(getpos this),thislist] spawn fnc_enemy_spawn; But (getpos this) for a trigger doesn´t work.. Any ideas? Share this post Link to post Share on other sites
gc8 981 Posted August 3, 2019 11 minutes ago, Smart Games said: But (getpos this) for a trigger doesn´t work.. It should work. are you sure this is pointing to a trigger? Share this post Link to post Share on other sites
POLPOX 779 Posted August 3, 2019 thisTrigger instead. 2 Share this post Link to post Share on other sites
Larrow 2823 Posted August 3, 2019 Triggers do not have an init. Condition, Activation or DeActivation. thisTrigger 3 Share this post Link to post Share on other sites
Smart Games 76 Posted August 3, 2019 thats my function: fnc_enemy_spawn = { _pos = _this select 0; _count = count (_this select 1); hint format ["%1 %2", _count, _pos]; if (_count >= 5) then {} else { _rnd = floor (random 2); if (_rnd == 1) then { _group = createGroup east; _rnd = floor (random 5); for "i" from 1 to _rnd do { _unit = (selectRandom UDSSR_Men) createUnit [_pos, _group]; }; [_group, _pos] call bis_fnc_taskDefend; }; if (_rnd == 2) then { _group1 = createGroup east; _group2 = createGroup east; _rnd = floor (random 5); _rnd2 = floor (random 3); for "i" from 1 to _rnd do { _unit = (selectRandom UDSSR_Men) createUnit [_pos, _group1]; }; for "i" from 1 to _rnd2 do { _unit = (selectRandom UDSSR_Men) createUnit [_pos, _group2]; }; [_group1, _pos] call bis_fnc_taskDefend; [_group2, _pos, 250] call bis_fnc_taskPatrol; }; }; }; the _count works, for _pos it shows "array". And i get the error message: undefined variable in expression _pos 1 Share this post Link to post Share on other sites
Smart Games 76 Posted August 3, 2019 thistrigger works fine, thx Share this post Link to post Share on other sites