Jump to content
h4wek

How to get parameters of Runways (allAirports) from maps

Recommended Posts

I would like to spawn in my mission planes on runway controlled by specific side or chosen by position near sector taken by one of sides, I can check of course number of airports/runways by "allAirports" command but if I want to check their positions by for example:

 

position allAirports#0

 

is impossibile, the same with search for takeoff start poasition (in definition of dynamic ruways it is specified probably by this way is not possibile to check this variables), the same situation is with names of airports (0,1,2,3......) if I want to use foreach command it returns error beacouse type of _x is unknown for this command. i supose that is some way to get data from dynamic runways but how?

Share this post


Link to post
Share on other sites

The data available is in the map's config. If I recall correctly the airfields position can be retrieved from "ilsPosition" but this is not the center of the airfield..

 

check this thread for some info: 

 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for help position of airfield  is in field 

configfile >> "CfgWorlds" >> "Stratis" >> "ilsPosition"

but when is more than one airfield like on tanoa or altis this field have only one record :) of biggest runway on map only so this method is not eunogh for this problem - i temporary solve problem by static invisible helpad placed on begining of runway but is not dynamic way as i want to implement to my mission (mision would be adapt to map automatically and this is not automatic 😞

 

  • Like 1

Share this post


Link to post
Share on other sites

Yes the rest of the airfields are in :  

configfile >> "CfgWorlds" >> worldname >> "SecondaryAirports"

you can loop through that like I did in the getNearestAirfieldId function in the thread I linked to

  • Like 1

Share this post


Link to post
Share on other sites

Sorry You have right - problem soved - I don't understand only why all airports are not in this Secondary will be easier to count all.

Share this post


Link to post
Share on other sites
3 minutes ago, h4wek said:

Sorry You have right - problem soved - I don't understand only why all airports are not in this Secondary will be easier to count all.

 

I think that's because of backwards compatibility. I guess back in the days there were only single airfield maps

  • Like 1

Share this post


Link to post
Share on other sites

Ok I done it by positions and dir  array for map runways returning (place for plane to start with direction of it):

 

All_airfields = [];
if (count allAirports > 0) then {
                 private _first = [getArray (configfile >> "CfgWorlds" >> worldname >> "ilsPosition"),getArray (configfile >> "CfgWorlds" >> worldname >> "ilsDirection")];
                 All_airfields pushbackunique _first;
                 private _next = [];
                 _sec = (configfile >> "CfgWorlds" >> worldname >> "SecondaryAirports");
                 for "_i" from 0 to (count _sec - 1) do
                 {
                     All_airfields pushbackunique [getarray ((_sec select _i) >> "ilsPosition"),getarray ((_sec select _i) >> "ilsDirection")];
                 };
};

  • Like 2

Share this post


Link to post
Share on other sites

It seems that you have created a variable that is not used. _next is intialised to an empty array but it is not used subsequently. Unless of course, you use it at some other place futher down that you haven't shown here.

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

×