Jump to content
Cerbium

How To Get Location Names To Show Up On Screen

Recommended Posts

I've been looking for a few days now and I haven't been able to find a way to get this done.


I've been on a few servers where you enter a town or are near a landmark you get the name of the location to pop up on your screen. I know I could do this by adding a bunch of triggers to my mission that will fire off when I get within the trigger but that seems like quite the task on bigger maps. Is there anyway to have this done in a more automatic way? If so, how could I get this going on my own mission.

Share this post


Link to post
Share on other sites
GetAttributesForGivenLocationTypes = {
	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 _this;
	_lcs
};

// Usage:
private _result = ["NameLocal", "NameVillage", "NameCity", "NameCityCapital"] call GetAttributesForGivenLocationTypes;

// Result:
// [
//   ["airfield",0,[1697.19,5554.18,-5.5],0,[295.45,220.91],false],
//   ["military range",0,[3338.44,5744.44,-4.88803],0,[254.81,199.25],false],
//   ["Old Outpost",0,[4318.72,4398.14,-179.132],0,[121.02,90.49],false],
//   ["Kill Farm",0,[4449.56,6845.08,-91.6142],0,[236.36,176.73],false],
//   ["Xiros",0,[3712.09,7940.36,0.000755993],0,[236.36,176.73],false],
//   ...
// ]

 

  • Like 2

Share this post


Link to post
Share on other sites

Be prepared for some mystifying results, especially on Altis.

 

For a start, the centre of the location is not in the geographical centre of the place, but at the left hand edge of the text label. For example, Agios Dionysios and Aggelochori are offset to the west by a considerable distance.

 

If you're planning to use the x and y to get location size, there are more nasty surprises coming as many of these are apparently random and don't come even close to reflecting the real 'city limits' of these places.

Share this post


Link to post
Share on other sites

You can get a somewhat more accurate size measurement by gradually increasing the radius until the building density drops.

 

 

Share this post


Link to post
Share on other sites
15 hours ago, serena said:

GetAttributesForGivenLocationTypes = {
	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 _this;
	_lcs
};

// Usage:
private _result = ["NameLocal", "NameVillage", "NameCity", "NameCityCapital"] call GetAttributesForGivenLocationTypes;

// Result:
// [
//   ["airfield",0,[1697.19,5554.18,-5.5],0,[295.45,220.91],false],
//   ["military range",0,[3338.44,5744.44,-4.88803],0,[254.81,199.25],false],
//   ["Old Outpost",0,[4318.72,4398.14,-179.132],0,[121.02,90.49],false],
//   ["Kill Farm",0,[4449.56,6845.08,-91.6142],0,[236.36,176.73],false],
//   ["Xiros",0,[3712.09,7940.36,0.000755993],0,[236.36,176.73],false],
//   ...
// ]

 

I'm not very familiar with scripting, where exactly would I put this? 

Share this post


Link to post
Share on other sites
8 hours ago, Tankbuster said:

Be prepared for some mystifying results, especially on Altis.

 

For a start, the centre of the location is not in the geographical centre of the place, but at the left hand edge of the text label. For example, Agios Dionysios and Aggelochori are offset to the west by a considerable distance.

 

If you're planning to use the x and y to get location size, there are more nasty surprises coming as many of these are apparently random and don't come even close to reflecting the real 'city limits' of these places.

I would be utilizing this on Chernarus 

Share this post


Link to post
Share on other sites
5 hours ago, Cerbium said:

I'm not very familiar with scripting, where exactly would I put this? 

My code above does not solve your problem completely, only demonstrates how to get names and other useful attributes of locations.

Share this post


Link to post
Share on other sites
On 10/13/2017 at 5:05 PM, serena said:

My code above does not solve your problem completely, only demonstrates how to get names and other useful attributes of locations.

ok thanks, i'll see if I can get something going.

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

×