allow large aeroplane on short runway patch

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
xarick
Transport Coordinator
Transport Coordinator
Posts: 337
Joined: 26 Feb 2015 00:52

allow large aeroplane on short runway patch

Post by xarick »

Adds an expert game setting, under Limitations.

"Allow large aeroplanes to use airports with short runways" - When disabled, large aeroplanes do not land, can't be ordered and are not available for purchase on airports with short runways.

It is defaulted to enabled. Loading old savegames will treat the setting as being enabled.

Download latest version (v6) here -> viewtopic.php?p=1194136#p1194136

List of changes/features:

- If a helicopter/airplane needs to be sent to a hangar during a service request, and there are no airports with hangars in the orders (travelling between heliports), or the airplane cannot land (runway too short), a nearby hangar outside the orders will be searched. If the distance to a found hangar is shorter than the distance to the helistation/airport the helicopter/airplane is headed to, the helicopter/airplane is sent to that hangar.

- Helicopters with 'service at helipads' enabled, will only do so when 'disable servicing when servicing set to none' is disabled, or, if enabled, when 'vehicle breakdowns' is not set to none.

- When leaving a terminal or helipad, aircraft may be sent to hangars first if they need automatic servicing and/or if there's a pending replace in the case of helicopter, before heading for take off.

- In the case of helicopters on heliports (no hangars) with 'service at helipads' enabled, pending replace will trigger right after entering flying mode, after taking off, avoiding automatic servicing check altogether.

- When searching for a nearby hangar with aircraft range limits, try to determine the correct last and next destinations and then ensure these are within range.

- When aircraft is heading to hangar, allow it to go to the current airport hangar, if the aircraft is still on the ground, even if it can no longer land on it.

- When manually skipping to a 'go to hangar' order in the order list, while the aircraft is flying, direct the aircraft to the correct location of the hangar.

- Removes 'go to hangar' orders from all aircraft when replacing an airport with hangar with another without hangar (heliport).

- When replacing an airport with another, cancel current orders of type 'go to depot' from aircraft still heading to it if the rebuilt airport doesn't have a hangar (helicopter vs heliport), or if the airplane can't land on the rebuilt airport (large plane vs runway too short).

- Reassure the current airport has an hangar when an aircraft wants to head to its hangar, instead of blindly sending to it. If it doesn't, it goes to takeoff instead.

- Removed unneccessary code which was causing aircraft to cancel their servicing order upon landing.

- Fixed two bugs where airplanes could be sent to helicopter station depots. https://bugs.openttd.org/task/6636

- After disabling 'large plane on short runway', aircraft that have "go to hangar" in their order list, may end heading to "unreachable" hangars. Manually sending them to hangar afterwards, will now first ensure that they can still head to the same hangar, otherwise, send them to another, reachable nearest hangar.

- When disabling 'large plane on short runway', at the exact moment it's toggled off, ensure all manually ordered 'go to hangar" orders can still head to the same hangar, otherwise, send them to another, reachable nearest hangar.

- Fixed a displaying issue with the message about airplanes heading to airports with short runways. If there was more than 1 airport with short runways in the orders, this message would not display, another one would which could be misleading or confusing.

- Added error messages regarding the use of airports with short runways when assigning orders to large aircraft: share orders, copy orders, add order


screenshot valid for v1
Image

screenshot valid for v6, v5, v4, v3, v2, v1
Image

previous versions (v3, v2, v1)
[+] Spoiler
v3 - When searching for a nearby hangar with aircraft range limits, ensure the destination of the current order is not the airport the aircraft is currently at, when the aircraft is already going for take off.
- When aircraft is heading to hangar, allow it to go to the current airport hangar, if the aircraft is still on the ground, even if it can no longer land on it.
- No longer specify in code that automatic services are of type ODATFB_NEAREST_DEPOT even if the hangar was found this way. It was causing nothing to be displayed in the vehicle status bar. It's not needed, after all.
- Helicopters with 'service at helipads' enabled, will only do so when 'disable servicing when servicing set to none' is disabled, or, if enabled, when 'vehicle breakdowns' is not set to none.
- When leaving a terminal or helipad, aircraft may be sent to hangars first, if they need automatic servicing and/or if there's a pending replace in the case of helicopter, before taking off.
- In the case of helicopters on heliports (no hangars) with 'service at helipads' enabled, pending replace will trigger right after entering flying mode, after taking off, avoiding automatic servicing check altogether.
- Removes 'go to hangar' orders from order backups as well, when replacing an airport with another without hangar (heliport).
- When disabling 'large plane on short runway', at the exact moment it's toggled off, ensure all manually ordered 'go to hangar" orders can still head to the same hangar, otherwise, send them to another, reachable nearest hangar.
- After disabling 'large plane on short runway', aircraft that have "go to hangar" in their order list, may end heading to "unreachable" hangars. Manually sending them to hangar afterwards, will now first ensure that they can still head to the same hangar, otherwise, send them to another, reachable nearest hangar.
v2

- Specify in code the 'go to nearby hangar' order is of type ODATFB_NEAREST_DEPOT, in regards to point 1).
- Changed messages of the kind "(...) airport runway is too short for this vehicle" to "(...) airport runway is too short for this aeroplane".
- Removes 'go to hangar' orders from all aircraft when replacing an airport with hangar with another without hangar (heliport).
- When replacing an airport with another, cancel current orders of type 'go to depot' from aircraft still heading to it, if the rebuilt airport doesn't have a hangar (helicopter vs heliport), or if the airplane can't land on the rebuilt airport (large plane vs runway too short).
- When manually skipping to a 'go to hangar' order in the order list, while the aircraft is flying, direct the aircraft to the correct location of the hangar.
- Removed unneccessary code which was causing aircraft to cancel their servicing order upon landing.
Last edited by xarick on 19 Nov 2017 22:04, edited 5 times in total.
Formerly known as Samu
xarick
Transport Coordinator
Transport Coordinator
Posts: 337
Joined: 26 Feb 2015 00:52

Re: allow large aeroplane on short runway patch

Post by xarick »

v6
- Fixed an issue with v4, where searching for a nearby hangar with aircraft range limits could determine a station without airport.

[+] Spoiler
previous versions (v5, v4) v5
- Fixed another issue with v3, where helicopters were overriding manual and part-of-orders "go to hangar" orders when checking for a pending replace after arriving at a helipad with 'service at helipads' enabled.
- Reassure the current airport has an hangar when an aircraft wants to head to its hangar, instead of blindly sending to it. If it doesn't, it goes to takeoff instead.

v4

- When searching for a nearby hangar with aircraft range limits, try to determine the correct last and next destinations and then ensure these are within range.
- Fixed an issue with v3, where Helicopters were not searching for a nearest hangar when there was a pending replace, while having "service to nearest hangar" orders in the order list, with 'service at helipads' enabled.
- Avoid message repetition, by adding a descriptive message for whenever failing to manually send an aircraft to hangar.
Formerly known as Samu
xarick
Transport Coordinator
Transport Coordinator
Posts: 337
Joined: 26 Feb 2015 00:52

Re: allow large aeroplane on short runway patch

Post by xarick »

same patch sliced into 23 patch files.
Attachments
allow large aeroplane on short runway patches.zip
(24.92 KiB) Downloaded 274 times
Formerly known as Samu
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 2 guests