Based on city-finding scripts I did for A1, I was VERY interested in the new location functions - BIS_fnc_locations.
http://community.bistudio.com/wiki/BIS_fnc_locationsI searched, but could not find any in-depth resources, so I'm starting this thread to share what information I develop, and invite anyone else to contribute what they find.
I am at the very beginning, so this may be super-simple to people.
I started (on Utes) with the city center functions. I began by placing a location game logic with they type city center.
In the init of the test mission, I set it up to hint various things.
private ["_list", "_JTDMarker"];
_JTDMarker = createMarker ["marker", getPos player];
_JTDMarker setMarkerColor "ColorGreen";
_JTDMarker setMarkerShape "ELLIPSE";
_JTDMarker setMarkerSize [50, 50];
_list = ["CityCenter",[position player,1000],true] call bis_fnc_locations;
hint format ["list = %1", _list];
sleep 1;
{
_JTDMarker setMarkerPos getPos _x; // marker for debugging
hint format ["element %1 = %2", _x, getPos _x];
sleep 5;
} forEach _list;
The first hint revealed that it had 5 elements, L1 through L5 (interestingly, not L0 through L4, although I'm certain they were elements 0 through 4 of the array). Using the marker, I *think* that the first entry is actually the player position. Anyway, the in-game map then had this:
You can see that it had small black dots at the locations of the "city centers" that it knew about. An interesting omission is the city on the SE coast. That location had apparently not been registered. (Was that city added with patch 1.03?) It did not register the actual location of the city center GL. It also showed the gray line from each city center to the next.
Also, the Biki refers to a Dynamic Route module (with barely more than a single sentence of information on it), although I could not find that in the modules or the game logics. (Although, there was a "Strategic Reference Layer" or something like that.)
http://community.bistudio.com/wiki/Dynamic_RouteEdit:
Ahhhh... figured it out.
I was limiting the search distance to 1 km... which actually only returned *3* locations 2-5!
I de-PBO'd the Utes PBO and unRapified it. Some interesting stuff. The LHD Khe Sanh is the first name, and I think that's why the cities are identified as 2-6.
Also I grabbed (thanks to Spooner's tip) the fnc_help text. I'm trying to work out how to get the neighbors of cities. They are designated in the config....
And "Eureka"... the magic of "getVariable" and namespace....
Once you get the city centers, you get the information mentioned in the Biki.
Init:
private ["_list", "_typeVar", "_neighbors", "_name"];
waituntil {!isnil "bis_fnc_init"};
//[] call BIS_fnc_help;
_list = ["CityCenter",[position player,2000],true] call bis_fnc_locations;
hint format ["list = %1", _list];
sleep 2;
{
hint format ["element %1 = %2", _x, getPos _x];
sleep 2;
_typeVar = _x getVariable "type";
_neighbors = _x getVariable "neighbors";
_name = _x getVariable "name";
hint format ["%1 ... %2 ... %3", _neighbors, _typeVar, _name];
sleep 2;
} forEach _list;
For more trickiness, get the locations of the neighbors by nesting forEach commands.
{
hint format ["element %1 = %2", _x, getPos _x];
sleep 5;
_typeVar = _x getVariable "type";
_neighbors = _x getVariable "neighbors";
_name = _x getVariable "name";
hint format ["%1 ... %2",_typeVar, _name];
sleep 2;
{
hint format ["near %1 at %2", _x, getPos _x];
sleep 2;
} forEach _neighbors;
} forEach _list;
Now, there's a bunch of other game logics (like City Links) that are less well documented (if that's possible),
from what I can tell.