kibaBG 54 Posted December 25, 2024 This should be straight forward and easy but I keep getting error _informatorPos is undefined variable. _validHouses = nearestObjects [[7977.27,8239.2,0], ["house"], 7500]; daHouse = selectRandom _validHouses; _builPositions = [daHouse] call BIS_fnc_buildingPositions; _informatorPos = selectRandom _builPositions; informatorGRP = createGroup [civilian, true]; informator = informatorGRP createUnit ["C_Man_casual_1_F_tanoan", _informatorPos, [], 0, "CAN_COLLIDE"]; Maybe there is no building positions in the randomly found house? Share this post Link to post Share on other sites
Schatten 290 Posted December 25, 2024 4 hours ago, kibaBG said: Maybe there is no building positions in the randomly found house? Exactly. 1 Share this post Link to post Share on other sites
pierremgi 4906 Posted December 25, 2024 Try with nearestTerrainObjects if map houses. And use buildingPos private _houses = nearestTerrainObjects [[7977.27,8239.2,0],["house"], 750,false,false]; private _validHouses = _houses select { (_x buildingPos -1) isNotEqualTo []}; private _informatorHouse = selectRandom _validHouses; private _informatorPos = selectRandom ( _informatorHouse buildingPos -1); private _informator = createGroup Civilian createUnit ["C_Man_casual_1_F_tanoan", _informatorPos, [], 0, "CAN_COLLIDE"]; _informator setDir (boundingCenter _informatorHouse getDir _informator); 2 1 Share this post Link to post Share on other sites
kibaBG 54 Posted December 25, 2024 @pierremgi Saves the day again, Merry Christmas btw ! 1 Share this post Link to post Share on other sites