Jump to content

Sign in to follow this  
jakkob4682

need help with script

Recommended Posts

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
  Reveal hidden contents

Untested

Edited by stanhope
Edited to fix some mistakes I made

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×