Jump to content

Recommended Posts

I am just curious on how you might actually use the position  command to find the position of a location of one of the major towns such as Athira or Sofia, clearly the locations are marked out somewhere because the editor already has a list of locations and 3D markers placed. I simply could not find a way to do this, so I've come to the people of the forums to save me.


Just to be clear, I don't want to find the location of the nearest town based on an object or a marker, just if it is possible from the built in game locations

 

Thank you, Pizza Man

Share this post


Link to post
Share on other sites

Check the link for the location command you posted - there are a bunch of useful and relevant commands at the bottom of the page, like locationPosition.

  • Like 1

Share this post


Link to post
Share on other sites
6 minutes ago, Harzach said:

Check the link for the location command you posted - there are a bunch of useful and relevant commands at the bottom of the page, like locationPosition.


I understand you can get the location of a location, but these are based on the position of an object, a maker or a created location,

If I could use this and do something like locationPosition 'Athira'; that that would be great. Maybe i'm just missing something cause I have gone through all the relevant functions.

Just wondering the game hides the locations of all the built in towns somewhere really

Share this post


Link to post
Share on other sites

Looking through the related commands and their descriptions/examples, it seems as though it should be possible to return the position of a specific location. Honestly, I've never done it before, but I'm pretty sure there are missions in the wild that do this. I found a couple of forum topics on the subject that lead me to believe it might not be the most straight-forward process, though.

  • Like 1

Share this post


Link to post
Share on other sites

Not sure if this is what you want, but you can retrieve all locations like this:

_locations = nearestLocation [[worldSize/2,worldSize/2],[],(worldSize/2) * 1.4142];

Then you'd need to further filter for location names if you want a specific one.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites
On 10/12/2018 at 2:09 AM, Grumpy Old Man said:

Not sure if this is what you want, but you can retrieve all locations like this:


_locations = nearestLocation [[worldSize/2,worldSize/2],[],(worldSize/2) * 1.4142];

Then you'd need to further filter for location names if you want a specific one.

 

Cheers

 

After testing, I don't think this would work sadly

Share this post


Link to post
Share on other sites
On 12/10/2018 at 12:27 PM, NumbNutsJunior said:

 

After testing, I don't think this would work sadly

 

It works, really, though add an "s" to nearestLocation so it becomes nearestLocations.

 

Alternatively if you want just one location use nearestLocation:

_loc = nearestLocation [getPos player, "nameCity"];

nameCity might need to be changed to  nameCapital, NameVillage or one of the other classes in CfgLocationTypes.

 

A third option is just to get away with locations all together and just place a game logic where you want it, name it and use getPos. 

Share this post


Link to post
Share on other sites
On 12.10.2018 at 3:11 AM, NumbNutsJunior said:

Just wondering the game hides the locations of all the built in towns somewhere really

All locations are in config files with their positions. Check entries in this config: configFile >> "CfgWorlds" >> worldName >> "Names", filter by type, PROFIT.

{
  diag_log format ["%1: %2", getText(_x >> "name"), str (getArray (_x>>"position"))]
} forEach (
  'getText(_x >> "type") == "NameCity" || getText(_x >> "type") == "NameCityCapital"' configClasses (configFile >> "CfgWorlds" >> worldName >> "Names")
)

 

UPD: Output:

17:06:12 "Katkoula: [5684.68,3993.67]"
17:06:12 "Balavu: [2677.42,7441.56]"
17:06:12 "Blue Pearl industrial port: [13523,12134.8]"
17:06:12 "Georgetown: [5396.22,10334.7]"
17:06:12 "Lijnhaven: [11802,2662.98]"
17:06:12 "Tuvanaka: [1579.49,11937.8]"
17:06:12 "Moddergat: [9407.35,4133.13]"
17:06:12 "Doodstil: [12861.9,4691.1]"
17:06:12 "Harcourt: [11122.5,5342.93]"
17:06:12 "Tanouka: [9014.23,10214.2]"
17:06:12 "Lifou: [7080.21,8004.08]"
17:06:12 "La Rochelle: [9549.78,13673.4]"
17:06:12 "Nicolet: [6164.67,12864.7]"
17:06:12 "Ouméré: [12984.3,7321.96]"
17:06:12 "Saint-Julien: [5808.6,11213.3]"

 

  • Like 1

Share this post


Link to post
Share on other sites
58 minutes ago, pedeathtrian said:

All locations are in config files with their positions. Check entries in this config: configFile >> "CfgWorlds" >> worldName >> "Names", filter by type, PROFIT.


{
  diag_log format ["%1: %2", getText(_x >> "name"), str (getArray (_x>>"position"))]
} forEach (
  'getText(_x >> "type") == "NameCity" || getText(_x >> "type") == "NameCityCapital"' configClasses (configFile >> "CfgWorlds" >> worldName >> "Names")
)

 

UPD: Output:


17:06:12 "Katkoula: [5684.68,3993.67]"
17:06:12 "Balavu: [2677.42,7441.56]"
17:06:12 "Blue Pearl industrial port: [13523,12134.8]"
17:06:12 "Georgetown: [5396.22,10334.7]"
17:06:12 "Lijnhaven: [11802,2662.98]"
17:06:12 "Tuvanaka: [1579.49,11937.8]"
17:06:12 "Moddergat: [9407.35,4133.13]"
17:06:12 "Doodstil: [12861.9,4691.1]"
17:06:12 "Harcourt: [11122.5,5342.93]"
17:06:12 "Tanouka: [9014.23,10214.2]"
17:06:12 "Lifou: [7080.21,8004.08]"
17:06:12 "La Rochelle: [9549.78,13673.4]"
17:06:12 "Nicolet: [6164.67,12864.7]"
17:06:12 "Ouméré: [12984.3,7321.96]"
17:06:12 "Saint-Julien: [5808.6,11213.3]"

 


This is exactly what I was looking for thank you 

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

×