Jump to content
Sign in to follow this  
1para{god-father}

Create markers sround a random town

Recommended Posts

Hi Guys,

I need a way to create some zones around a random Village like insurgency markers, not 1 big marker but say 5-10 depending on size of the town , anyone point me in the right direction or has done something like this before.

Thanks

Share this post


Link to post
Share on other sites

I'm sure that there is a good way to find the correct size of the town but something like this?

_center = markerPos "test1";
_size = 4; // 4x4 50m markers
_x = (((_center select 0)-((_center select 0)mod 100))-50);
_y = (((_center select 1)-((_center select 1)mod 100))-50);
_origy = _y;

for "_a" from 0 to _size-1 do 
{
_pos = [_x,_y];
_m=createMarker [format ["mrk%1",random 100000],_pos];
_m setMarkerShape "RECTANGLE";
_m setMarkerSize [50,50];
_m setMarkerBrush "SolidBorder";
_m setMarkerAlpha 0.2;
_m setMarkerColor "ColorRed";
for "_b" from 0 to _size-2 do
{
	_y = _y + 100;
	_pos = [_x,_y];
	_m=createMarker [format ["mrk%1",random 100000],_pos];
	_m setMarkerShape "RECTANGLE";
	_m setMarkerSize [50,50];
	_m setMarkerBrush "SolidBorder";
	_m setMarkerAlpha 0.2;
	_m setMarkerColor "ColorRed";
};
_y = _origy;
_x = _x + 100;
};

Share this post


Link to post
Share on other sites

Owww nice one that is great so far !

So I have a random Town, and a grid over the town , now I need is to work out how big the grid should be to cover the town and houses.

Anyone have any idea how to work that out as I need to cover the whole town and surrounding building within say 200 away

if (isServer) then 
{

	_gamelogic = center;
	_towns = nearestLocations [getPosATL _gamelogic, ["NameVillage","NameCity","NameCityCapital"], 25000]; 
	_RandomTownPosition = position (_towns select (floor (random (count _towns)))); 
	_marker = createmarker ["taskarea",_RandomTownPosition];

_center = markerpos "taskarea";
_size = 4; // 4x4 50m markers
_x = (((_center select 0)-((_center select 0)mod 100))-50);
_y = (((_center select 1)-((_center select 1)mod 100))-50);
_origy = _y;

for "_a" from 0 to _size-1 do 
{
   _pos = [_x,_y];
   _m=createMarker [format ["mrk%1",random 100000],_pos];
   _m setMarkerShape "RECTANGLE";
   _m setMarkerSize [50,50];
   _m setMarkerBrush "SolidBorder";
   _m setMarkerAlpha 0.2;
   _m setMarkerColor "ColorRed";
   for "_b" from 0 to _size-2 do
   {
       _y = _y + 100;
       _pos = [_x,_y];
       _m=createMarker [format ["mrk%1",random 100000],_pos];
       _m setMarkerShape "RECTANGLE";
       _m setMarkerSize [50,50];
       _m setMarkerBrush "SolidBorder";
       _m setMarkerAlpha 0.2;
       _m setMarkerColor "ColorRed";
   };
   _y = _origy;
   _x = _x + 100;
};  

};

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  

×