Skip to content

Commit 6a3c01a

Browse files
authored
[Customized] Allow the aircraft to enter area guard mission and not crash immediately without any airport (#1844)
- When a `guard` command (`[G]` by default) or a `area guard` command (`[Ctrl]+[Alt]`) is issued, the aircraft will search for targets around the position (for `guard` is the current location, for `area guard` is the target position) and return immediately when ammos are depleted. - If the target is not found, or if there is still ammo when the target is destroyed, it will continue to hover over the guarded area. - `ExtendedAircraftMissions.FastScramble` controls whether the aircraft can scramble when its airport has been destroyed. - `ExtendedAircraftMissions.UnlandDamage` controls the damage suffered by the aircraft every 4 frames when there is no airport for the aircraft to land. If the value is negative, it will crash immediately. Not recommended to use when `ExtendedAircraftMissions` is not enabled. In `rulesmd.ini`: ```ini [General] ExtendedAircraftMissions.UnlandDamage=-1 ; integer [SOMEAIRCRAFT] ; AircraftType ExtendedAircraftMissions.FastScramble= ; boolean, default to [General] -> ExtendedAircraftMissions ExtendedAircraftMissions.UnlandDamage= ; integer, default to [General] -> ExtendedAircraftMissions.UnlandDamage ``` ![飞机守卫](https://github.com/user-attachments/assets/7ed4c69c-e5e7-41f6-97d6-8f45d910adb3)
1 parent b54c036 commit 6a3c01a

File tree

9 files changed

+319
-46
lines changed

9 files changed

+319
-46
lines changed

CREDITS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ This page lists all the individual contributions to the project by their author.
545545
- Fix for pathfinding crashes on big maps due to too small pathfinding node buffer
546546
- Fix an issue that units' `LaserTrails` will always lags behind by one frame
547547
- Fix an issue that the currently hovered planning node not update up-to-date, such as using hotkeys to select technos
548+
- Allow the aircraft to enter area guard mission and not crash immediately without any airport
548549
- **Ollerus**:
549550
- Build limit group enhancement
550551
- Customizable rocker amplitude

docs/Fixed-or-Improved-Logics.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -325,24 +325,29 @@ FiringForceScatter=true ; boolean
325325
### Extended Aircraft Missions
326326

327327
- Aircraft will now be able to use waypoints.
328-
- When a `guard` command (`[G]` by default) is issued, the aircraft will search for targets around the current location and return immediately when target is not found, target is destroyed or ammos are depleted.
329-
- If the target is destroyed but ammos are not depleted yet, it will also return because the aircraft's command is one-time.
328+
- When a `guard` command (`[G]` by default) or a `area guard` command (`[Ctrl]+[Alt]`) is issued, the aircraft will search for targets around the position (for `guard` is the current location, for `area guard` is the target position) and return immediately when ammos are depleted.
329+
- If the target is not found, or if there is still ammo when the target is destroyed, it will continue to hover over the guarded area.
330330
- When an `attack move` command (`[Ctrl]+[Shift]`) is issued, the aircraft will move towards the destination and search for nearby targets on the route for attack. Once ammo is depleted or the destination is reached, it will return.
331331
- If the automatically selected target is destroyed but ammo is not depleted yet during the process, the aircraft will continue flying to the destination.
332332
- In addition, the actions of aircraft are also changed.
333333
- `ExtendedAircraftMissions.SmoothMoving` controls whether the aircraft will return to the airport when the distance to the destination is less than half of `SlowdownDistance` or its turning radius.
334334
- `ExtendedAircraftMissions.EarlyDescend` controls whether the aircraft not have to fly directly above the airport before starting to descend when the distance between the aircraft and the landing point is less than `SlowdownDistance` (also work for aircraft spawned by aircraft carriers).
335335
- `ExtendedAircraftMissions.RearApproach` controls whether the aircraft should start landing at the airport from the opposite direction of `LandingDir`.
336+
- `ExtendedAircraftMissions.FastScramble` controls whether the aircraft can scramble when its airport has been destroyed.
337+
- `ExtendedAircraftMissions.UnlandDamage` controls the damage suffered by the aircraft every 4 frames when there is no airport for the aircraft to land. If the value is negative, it will crash immediately. Not recommended to use when `ExtendedAircraftMissions` is not enabled.
336338

337339
In `rulesmd.ini`:
338340
```ini
339341
[General]
340-
ExtendedAircraftMissions=false ; boolean
341-
342-
[SOMEAIRCRAFT] ; AircraftType
343-
ExtendedAircraftMissions.SmoothMoving= ; boolean, default to [General] -> ExtendedAircraftMissions
344-
ExtendedAircraftMissions.EarlyDescend= ; boolean, default to [General] -> ExtendedAircraftMissions
345-
ExtendedAircraftMissions.RearApproach= ; boolean, default to [General] -> ExtendedAircraftMissions
342+
ExtendedAircraftMissions=false ; boolean
343+
ExtendedAircraftMissions.UnlandDamage=-1 ; integer
344+
345+
[SOMEAIRCRAFT] ; AircraftType
346+
ExtendedAircraftMissions.SmoothMoving= ; boolean, default to [General] -> ExtendedAircraftMissions
347+
ExtendedAircraftMissions.EarlyDescend= ; boolean, default to [General] -> ExtendedAircraftMissions
348+
ExtendedAircraftMissions.RearApproach= ; boolean, default to [General] -> ExtendedAircraftMissions
349+
ExtendedAircraftMissions.FastScramble= ; boolean, default to [General] -> ExtendedAircraftMissions
350+
ExtendedAircraftMissions.UnlandDamage= ; integer, default to [General] -> ExtendedAircraftMissions.UnlandDamage
346351
```
347352

348353
### Fixed spawn distance & spawn height for airstrike / SpyPlane aircraft

docs/Whats-New.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You can use the migration utility (can be found on [Phobos supplementaries repo]
1010

1111
### From vanilla
1212

13-
- Map trigger action `125 Build At...` now plays buildup by default if available, this can be toggled off using the third parameter (values other than 0). See [required changes for `fadata.ini`](#for-map-editor-final-alert-2) on how to enable the parameter in map editor.
13+
- Map trigger action `125 Build At...` now plays buildup by default if available, this can be toggled off using the third parameter (values other than 0). See [required changes for `fadata.ini`](#for-map-editor-final-alert-2) on how to enable the parameter in map editor.
1414
- `IsSimpleDeployer` units now obey deploying facing constraint even without deploying animation. To disable this, set `DeployDir` (defaults to `[AudioVisual] -> DeployDir`) to -1.
1515
- `Vertical=true` projectiles now default to completely downwards initial trajectory/facing regardless of if their projectile image has `Voxel=true` or not. This behavior can be reverted by setting `VerticalInitialFacing=false` on projectile in `rulesmd.ini`.
1616
- `Vertical=true` projectiles no longer move horizontally if fired by aircraft by default. To re-enable this behaviour set `Vertical.AircraftFix=false` on the projectile.
@@ -446,6 +446,7 @@ New:
446446
- Randomized anims for several behaviors (by Ollerus)
447447
- Shield respawn animation and weapon (by Ollerus)
448448
- Customize the chained damage of the wall (by TaranDahl)
449+
- Allow the aircraft to enter area guard mission and not crash immediately without any airport (by CrimRecya)
449450
450451
Vanilla fixes:
451452
- Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya)

0 commit comments

Comments
 (0)