Author Topic: Airport Customization Order  (Read 2220 times)

Captain Kevin

  • Beta tester
  • Hero Member
  • *****
  • Posts: 1884
  • Captain Kevin
    • Captain Kevin
Airport Customization Order
« on: July 02, 2024, 02:35:12 am »
In looking at the manual for how to customize the airport using Python, it says here "you’ll be free to Rename and Regroup the existing parking positions in any way you want, included the ability to control the order of the Terminals, overriding the default alphabetical order." Unfortunately, I don't see anything in the manual that says how to do that unless I'm just stupid. I would like the terminals to be listed first, followed by the cargo areas and hangars. How do I go about doing this.
Captain Kevin

virtuali

  • Administrator
  • Hero Member
  • *****
  • Posts: 51426
    • VIRTUALI Sagl
Re: Airport Customization Order
« Reply #1 on: July 10, 2024, 02:52:33 pm »
I realized the manual doesn't cover this. There's an extra optional numeric parameter in the CustomizedName instruction, which can be used to alter the ordering of terminals so, following one of the examples in the manual, by doing this:

parkings = {
  GATE_A : {
    None : ( CustomizedName(“Terminal 1|Gate #”, 2), ),
  },
  GATE_B : {
    None : ( CustomizedName(“Terminal 2|Gate #”, 1), ),
  }
}


You are forcing Terminal 2 to show before Terminal 1 in the list.
« Last Edit: September 28, 2024, 10:25:55 am by virtuali »

Captain Kevin

  • Beta tester
  • Hero Member
  • *****
  • Posts: 1884
  • Captain Kevin
    • Captain Kevin
Re: Airport Customization Order
« Reply #2 on: July 10, 2024, 08:05:10 pm »
Excellent. I will give that a shot. Thank you.
Captain Kevin

Captain Kevin

  • Beta tester
  • Hero Member
  • *****
  • Posts: 1884
  • Captain Kevin
    • Captain Kevin
Re: Airport Customization Order
« Reply #3 on: July 10, 2024, 09:28:45 pm »
Umberto, I gave it a shot, but for some reason, everything got messed up, and it's only showing one gate for Terminal B, as noted in the screenshot. I've attached all the files involved.
Captain Kevin

Captain Kevin

  • Beta tester
  • Hero Member
  • *****
  • Posts: 1884
  • Captain Kevin
    • Captain Kevin
Re: Airport Customization Order
« Reply #4 on: September 27, 2024, 11:11:59 am »
Wondering if the above issue has been looked at, as it's been 11 weeks since I asked. This is happening with FlyTampa Boston if this helps.
Captain Kevin

virtuali

  • Administrator
  • Hero Member
  • *****
  • Posts: 51426
    • VIRTUALI Sagl
Re: Airport Customization Order
« Reply #5 on: September 28, 2024, 10:37:26 am »
Wondering if the above issue has been looked at, as it's been 11 weeks since I asked. This is happening with FlyTampa Boston if this helps.

There was nothing wrong with GSX, I wrote that sample code by memory, and it wasn't correct, the ordering number is an optional parameter of the CustomizedName function, so it goes like this:

None : ( CustomizedName(“Terminal 1|Gate #”, 2), ),

NOT like this, as I initially posted:

None : ( CustomizedName(“Terminal 1|Gate #”, ), 2 ),

I edited my previous post with the correct syntax, and I attached the complete fixed file, which show all gates ordered as you wanted.

Note that, you originally set different priorities to parking spots with the same group name, and this will cause "de-grouping", which is not what you probably wanted. Usually, you want to give all gates in the same group the same priority, so I changed the file this way. Of course, if you really wanted to have the spots separated, you can do it that way, by giving each spot a different priority.

I'm sorry for the confusion.

Captain Kevin

  • Beta tester
  • Hero Member
  • *****
  • Posts: 1884
  • Captain Kevin
    • Captain Kevin
Re: Airport Customization Order
« Reply #6 on: September 28, 2024, 08:57:11 pm »
It works now. Thanks. The reason I had it set the way I did before was I had tried it the other way, but it didn't work, so I wasn't sure if I had misunderstood how it was supposed to work. Obviously, this was before I knew the syntax was incorrect.
Captain Kevin