jakkob4682 23 Posted March 12, 2021 params ["_center"]; _towns = nearestLocations [getPos _center,["nameCity","nameVillage","nameLocal"],10000]; _markerArray = []; _buildingArray = []; _grp = grpNull; _randomTown = { params ["_list"]; _idx = selectRandom _list; _pos = locationPosition _idx; _mrk = createMarker [text _idx,_pos]; _mrk setMarkerShape "Ellipse"; _mrk setMarkerSize size _idx; _mrk setMarkerColor "ColorRed"; _mrk }; _randomBuilding = { params ["_pos"]; _buildings = nearestObjects [_pos,["House","Building"],300]; _building = selectRandom _buildings; _buildingPos = getPosASL _building; _mrk = createMarker [str(_buildingPos),_buildingPos]; _mrk setMarkerShape "Ellipse"; _mrk setMarkerSize [10,10]; _mrk setMarkerColor "ColorBlue"; _buildingPos }; RydHQ_obj1 = [_towns] call _randomTown; RydHQ_Obj2 = [_towns] call _randomTown; RydHQ_Obj3 = [_towns] call _randomTown; RydHQ_Obj4 = [_towns] call _randomTown; {_markerArray pushBack _x}forEach [RydHQ_Obj2,RydHQ_Obj3,RydHQ_Obj4,RydHQ_obj1]; for "_i" from 1 to 5 do { { _buildingPos = [getMarkerPos _x] call _randomBuilding; _buildingArray pushBack _buildingPos; }forEach [RydHQ_Obj2,RydHQ_Obj3,RydHQ_Obj4,RydHQ_obj1]; }; {_grp = [_x,east,(configfile >> "CfgGroups" >> "East" >> "CUP_O_RU" >> "Infantry_Ratnik_Winter" >> "InfSentry")] call BIS_fnc_spawnGroup}forEach _buildingArray; {[_grp,_x,300,5,[],true] call lambs_wp_fnc_taskPatrol}forEach _buildingArray; true groups spawn as planned but can't figure out how to get the patrol function to fire for each group Share this post Link to post Share on other sites
stanhope 412 Posted March 12, 2021 (edited) Reveal hidden contents params ["_center"]; private _towns = nearestLocations [getPos _center,["nameCity","nameVillage","nameLocal"],10000]; private _randomTown = { params ["_list"]; _idx = selectRandom _list; _pos = locationPosition _idx; _mrk = createMarker [text _idx,_pos]; _mrk setMarkerShape "Ellipse"; _mrk setMarkerSize size _idx; _mrk setMarkerColor "ColorRed"; _mrk }; private _randomBuilding = { params ["_pos"]; _buildings = nearestObjects [_pos,["House","Building"],300]; _building = selectRandom _buildings; _buildingPos = getPosASL _building; _mrk = createMarker [str(_buildingPos),_buildingPos]; _mrk setMarkerShape "Ellipse"; _mrk setMarkerSize [10,10]; _mrk setMarkerColor "ColorBlue"; _buildingPos }; for "_i" from 1 to 4 do { private _mrk = [_towns] call _randomTown; for "_j" from 1 to 5 do { private _buildingPos = [getMarkerPos _mrk] call _randomBuilding; private _grp = [_buildingPos,east,(configfile >> "CfgGroups" >> "East" >> "CUP_O_RU" >> "Infantry_Ratnik_Winter" >> "InfSentry")] call BIS_fnc_spawnGroup; [_grp,_buildingPos,300,5,[],true] call lambs_wp_fnc_taskPatrol }; }; true Untested Edited March 12, 2021 by stanhope Edited to fix some mistakes I made Share this post Link to post Share on other sites