Jump to content
Sign in to follow this  
lkincheloe

Getting the name of a location from NearestLocations

Recommended Posts

I had an idea for a mission I'm working on to put the name of an area detected by NearestLocations as the name of a marker being created at said area. So that when the area is cleared in EOS I can display a message that reads "You have cleared (town name), nice work!", however I can't seem to find any documentation regarding the actual process for getting the name.

Here's the sample from the code I'm using:

_towns = nearestLocations [getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition"), ["NameVillage"], 25000];
ztowns = [];
{
   _pos = position _x;
   _m = createMarker [format ["mrk%1",random 100000],_pos];
ztowns = ztowns + [_m];
   _m setMarkerShape "ELLIPSE";
   _m setMarkerSize [200,200];
   _m setMarkerBrush "Solid";
   _m setMarkerAlpha 0.5;
   _m setMarkerColor "ColorYellow";
} forEach _towns;

Would it be a simple matter of just using _x where random 100000 is to get it? Or would there be another step to it?

Share this post


Link to post
Share on other sites

name location

Edit: Didnt notice kju's comment on that page but as noted it does not work for general locations , use TEXT as shown below by sxp2high

Edited by Larrow

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  

×