Skip to content

Customize the images for building sell and undeploy - #2271

Open
DeathFishAtEase wants to merge 7 commits into
Phobos-developers:developfrom
DeathFishAtEase:Builddown
Open

Customize the images for building sell and undeploy#2271
DeathFishAtEase wants to merge 7 commits into
Phobos-developers:developfrom
DeathFishAtEase:Builddown

Conversation

@DeathFishAtEase

@DeathFishAtEase DeathFishAtEase commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator
SellImage
  • In vanilla, when a building is sold or undeployed, it plays the reversed Buildup image. Now you can customize the images for these two cases and set whether to reverse them separately.

In artmd.ini:

[SOMEBUILDING]         ; BuildingType
Sell=                  ; filename - excluding the .shp extension, defaults to [BuildingType] -> Buildup
Sell.Reverse=true      ; boolean
Undeploy=              ; filename - excluding the .shp extension, defaults to [BuildingType] -> Sell
Undeploy.Reverse=true  ; boolean

Note

When the replacement image is not explicitly set, the Buildup image will be used, and reversal can still work independently.

  • The playback rate of the image sequence when a building undeploys is by default the same as when selling. It can now be independently controlled through the flag below.

In rulesmd.ini:

[SOMEBUILDING]       ; BuildingType
UndeployTime=        ; floating point value, defaults to [BuildingType] -> SellTime

The configuration parameters for displaying images are as follows:

In rulesmd.ini:

[NACNST]
SellBuildupLength=31

[GACNST]
SellBuildupLength=31

In artmd.ini:

[GACNST]
Buildup=GAPILLMK
Sell=NACNSTMK
Undeploy=NACNSTMK
Undeploy.Reverse=false

Tested changing SellTime value and Buildup; the sell sequence still synchronizes and disappears at the same time (the end time is not delayed by the frame count of Buildup), and it synchronizes under both FPS=120 and FPS=1.

Todo:

  • Although it synchronizes under FPS=1, when stepping frame by frame in Frame by frame mode, [GACNST] (Buildup=GAPILLMK) appears to be 1 step faster than [NACNST]; the cause is still under investigation.
  • When the frame count of Buildup is significantly less than that of Sell, the first frame of the sell sequence cannot erase the building body image of [GACNST] in time at higher FPS, causing the sell sequence image to overlap with the building image.
  • Added a LoadTheaterSHP function similar to Ares' approach to handle reading under different theaters; need to confirm whether it can be replaced by reusing the content related to 005F9070 - ObjectTypeClass_Load_Theater_Art, but lack of energy.
    • Keeping LoadTheaterSHP is necessary; it cannot be replaced by 0x5F9070 (ObjectTypeClass_Load_Theater_Art, i.e. vanilla ObjectTypeClass::Load2DArt). Reasons: ① 0x5F9070 is a type-level method that only performs theater-specific loading for the type's own Image (incl. Buildup) and does not accept an arbitrary baseName, additionally mutating type-instance state (Image pointer, MaxDimension, etc.); ② Sell=/Undeploy= are Phobos-only tags that require a generic utility doing "arbitrary filename → theater-letter substitution → fallback to 'G' → fallback to original name → load SHP", which is exactly what LoadTheaterSHP provides; ③ the same logic in Ares is only inlined inside the 0x5F9070 hook with no standalone function, and the vanilla string-replacement function sub_5F96B0 (0x5F96B0) is hooked by Ares and includes g/n/c-prefix special-casing whose semantics differ from the pure A/T substitution, making direct reliance unreliable. Therefore the current self-contained static implementation is kept; if more cross-file call sites appear in the future, it can be extracted to GeneralUtils for reuse.

@DeathFishAtEase DeathFishAtEase self-assigned this Jun 27, 2026
@DeathFishAtEase DeathFishAtEase added ⚙️T1 T1 maintainer review is sufficient ❓Unhardcoding / Customization Make something more tweakable labels Jun 27, 2026
@github-actions

github-actions Bot commented Jun 27, 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.

@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/597/1

@DeathFishAtEase
DeathFishAtEase marked this pull request as ready for review August 18, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚙️T1 T1 maintainer review is sufficient ❓Unhardcoding / Customization Make something more tweakable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants