Skip to content

Customize DefaultToGuardArea per gunner mode - #2371

Open
DeathFishAtEase wants to merge 7 commits into
Phobos-developers:developfrom
DeathFishAtEase:DTGA.Modes
Open

Customize DefaultToGuardArea per gunner mode#2371
DeathFishAtEase wants to merge 7 commits into
Phobos-developers:developfrom
DeathFishAtEase:DTGA.Modes

Conversation

@DeathFishAtEase

Copy link
Copy Markdown
Collaborator

What kind of change is this?

  • New feature, vanilla bugfix or enhancement of a released feature - changelog, docs and credits entries are needed.
  • Improvement to a new (unreleased) feature - docs and credits entries are needed; no changelog entry (Skip Changelog).
  • Bugfix to a new (unreleased) feature - credits entry is needed; no changelog or docs entries (Skip Changelog, Skip Docs).
  • Bugfix to an old (released) feature - changelog and credits entries are needed; no docs entry (Skip Docs).
  • Completely minor change (e.g. a typo fix) - no entries are needed (Skip Changelog, Skip Docs, Skip Credits).

Description

  • Technos with Gunner=yes can now restrict the DefaultToGuardArea and the GUARD_AREA promotion ability to specific gunner modes.

In rulesmd.ini:

[SOMETECHNO]                     ; TechnoType, with Gunner=yes
DefaultToGuardArea.Modes=-1      ; List of integers, IFVMode
DefaultToGuardArea.AIModes=-1    ; List of integers, IFVMode

@DeathFishAtEase DeathFishAtEase self-assigned this Aug 25, 2026
@DeathFishAtEase DeathFishAtEase added ❓New feature Needs testing ⚙️T1 T1 maintainer review is sufficient labels Aug 25, 2026
@phoboscn-bot

Copy link
Copy Markdown

To Chinese users:
This pull request has been mentioned on Phobos CN. There might be relevant details there:

致中文用户:
此拉取请求已在 Phobos CN 上被提及。那里可能有相关详细信息:

https://www.phoboscn.top/t/topic/745/1

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

Comment thread src/Ext/Techno/Hooks.Misc.cpp Outdated
Co-authored-by: Netsu_Negi <71598172+NetsuNegi@users.noreply.github.com>
@Coronia

Coronia commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

is it also possible to remove the hardcoded range of area guard for repair IFV?

@TaranDahl TaranDahl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this won't work if you order a passenger to enter a vehicle that has already been idle.

@DeathFishAtEase

Copy link
Copy Markdown
Collaborator Author

remove the hardcoded range of area guard for repair IFV

According to 0x6F9037, under Area_Guard mission, there is originally no 512 leptons limit; that is for Guard mission.

that has already been idle.

DefaultToGuardArea works like this: even if you directly create a unit with DefaultToGuardArea=true, or have such a unit already in the Guard mission gain the GUARD_AREA promotion ability through external means, it still waits until the next command finishes and returns to idle before making the judgment.

If someone wants passengers to switch to the Area_Guard mission immediately upon entering, that should be implemented as a separate feature.

Comment thread src/Ext/Techno/Hooks.Targeting.cpp
@DeathFishAtEase

DeathFishAtEase commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator Author

Is it necessary to force-write a GuardRange based on parameters such as the weapon's Range when using a repair weapon? A difference in terms of Mission: if a unit's GuardRange exceeds the weapon's Range, under Area_Guard they will approach the enemy, while under Guard they will just stand there staring.

Added a max(512, range) handling to be compatible with the vanilla combination of weapon range and guard radius.

@TaranDahl

Copy link
Copy Markdown
Contributor

even if you directly create a unit with DefaultToGuardArea=true, or have such a unit already in the Guard mission gain the GUARD_AREA promotion ability through external means, it still waits until the next command finishes and returns to idle before making the judgment.

That should be considered a bug.
Bug of the mission system, tho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

❓New feature ⚙️T1 T1 maintainer review is sufficient Tested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants