Jump to content
Sign in to follow this  
jakeplissken

Getting name of town or city at location.

Recommended Posts

Hello. I am using this code to create a marker on the map that tells players of the location to capture. This does work for some towns, but for Molos it prints Delfinaki.
 

_loc = text nearestLocation [getPos man1, "NameVillage"];

_marker28 = createMarker ["Objective.", position player ];
_marker28 setMarkerPos [14697.7,13000.5,53.9098];
_marker28 setMarkerShape "ICON";
_marker28 setMarkerColor "Default";
_marker28 setMarkerType "flag_NATO";
_marker28 setMarkerText format ["Seize: %1", _loc];

I tried this, but got an error, something about it being an array and not an object.

 

_loc = text nearestLocation [getPos man1, ["NameVillage","NameCity","NameCityCapital"]];

_marker28 = createMarker ["Objective.", position player ];
_marker28 setMarkerPos [14697.7,13000.5,53.9098];
_marker28 setMarkerShape "ICON";
_marker28 setMarkerColor "Default";
_marker28 setMarkerType "flag_NATO";
_marker28 setMarkerText format ["Seize: %1", _loc];

Everything else is working except this code. I guess I am missing something simple. Thanks for any help you can give me.

Is there a way to put the multiple options into this,

Share this post


Link to post
Share on other sites
private _lcs = [];
{	private _lct = _forEachIndex;
	{	_lcs pushBack [text _x, _lct, locationPosition _x, direction _x, size _x, rectangular _x];
	} forEach nearestLocations [getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition"), [_x], worldSize];	
} forEach [/*"NameLocal", */"NameVillage", "NameCity", "NameCityCapital"];

name location

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  

×