# [Modding] `<replace>` on terraforming project `resources` applies with zero errors but has no effect in-game
**Game version / setup:** PC, Steam, base game + Boron (Kingdom's End) + Split Vendetta + Cradle of Humanity (Terran) DLCs.
## Goal
A simple balance mod: reduce the credit price, ware amounts, and duration of terraforming projects, and remove the drone delivery phase, via a standard extension using `libraries/terraforming.xml` diff patching.
## Minimal reproduction
Single project, single attribute, nothing else touched:
```xml
<?xml version="1.0" encoding="utf-8" ?>
<diff>
<replace sel="/terraforming/projects/project[@id='res_arcology']/resources/@price">10</replace>
</diff>
```
Placed at `extensions/arcology_price_only/libraries/terraforming.xml`, with a minimal valid `content.xml` (id `arcology_price_only_test`, no dependencies missing, extension shows as active with correct version in-game).
## Expected result
Opening the Arcology project in the terraforming menu should show a price of 10 credits (down from the vanilla 200,000,000).
## Actual result
The project still shows the **exact vanilla values**. This isn't just "looks unchanged" — I confirmed it mathematically: the resource quantities shown for Arcology (69646 advancedelectronics / 17412 claytronics / 174114 hullparts when I tested a related change with modified ware amounts) back-calculate to an *identical* implied market price (~765.8 cr) for all three wares, which only makes sense if the game is still using the original `price="200000000"` and original ware weights (1/4/10) — i.e., the patch is having **zero effect** on the value used at runtime.
## What I've ruled out
- **XML/patch syntax**: valid per `diff.xsd` grammar (RFC 5261-style, matches the pattern used in official DLC diff files and in a community mod I compared against). Tried both attribute-only replace and whole-`<resources>`-element replace (with and without child `<ware>` nodes — confirmed via schema that ware-less resources are valid, "direct payment").
- **Debug log** (`-debug all -logfile`): completely clean for this file, every single time, across many iterations — no `No matching node`, no `Unknown node`, nothing.
- **Extension setup**: correct folder structure, correct `content.xml`, extension shows active with correct version in the in-game Extensions menu, confirmed via first-time "Installing Extension" popup on a brand-new extension ID.
- **Loose files vs `.cat`/`.dat`**: tested both (via X Tools Catalog Tool), same result.
- **`-prefersinglefiles`**: no change.
- **Conflicting extensions**: removed a similar community mod entirely, no other extension patches this file or path.
- **Savegame caching**: tested on a terraforming project never opened before in that save, still no effect.
- **General patch mechanism**: confirmed working — an identical single-attribute `<replace>` on `libraries/wares.xml` (changing Energy Cells price) applies correctly and is visible in-game immediately.
So the diff mechanism itself works, and applies cleanly to this exact file with zero logged errors, but the resulting value is not what the game actually uses when computing project cost.
## Question
Is it possible that some or all of the terraforming project economic calculations (price/resource scaling, delivery drone counts) have been moved to internal/hardcoded logic in a relatively recent update, rather than being read live from `libraries/terraforming.xml` at project-display/launch time? I found an old comment on an unrelated mod (Faster Workforce Growth) mentioning that some workforce-growth parameters "are no longer working" because Egosoft changed related code, and that this was tied to terraforming — which would be consistent with what I'm seeing here.
If anyone has a terraforming balance mod that is confirmed still working on the current version, I'd be very grateful to know which specific technique/file/attribute you're patching — happy to share my full test files if useful.
`<replace>` on terraforming project `resources` applies with zero errors but has no effect in-game
The place to discuss scripting and game modifications for X4: Foundations.
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
1 post
• Page 1 of 1
-
Zephelor
- Posts: 1
- Joined: Tue, 12. Jul 22, 14:15

1 post
• Page 1 of 1
Return to “X4: Foundations - Scripts and Modding”
Jump to
- English Forums
- ↳ X4: Foundations
- ↳ X4: Foundations - Spoilers
- ↳ X4: Foundations - Technical Support
- ↳ X4: Foundations - Scripts and Modding
- ↳ Construction Community
- ↳ X Wiki Discussion
- ↳ X Rebirth Universe
- ↳ X Rebirth VR Edition
- ↳ X Rebirth - Technical Support
- ↳ X Rebirth - Scripts and Modding
- ↳ X³: Farnham's Legacy
- ↳ X³: Farnham's Legacy - Scripts and Modding
- ↳ X Trilogy Universe
- ↳ X³: Terran Conflict / Albion Prelude / Farnham's Legacy - Technical Support
- ↳ X³: Terran Conflict / Albion Prelude - Scripts and Modding
- ↳ X³: Reunion, X²: The Threat, X-T and X-BTF - Technical Support
- ↳ X³: Reunion - Scripts and Modding
- ↳ X²: The Threat - Scripts and Modding
- ↳ Creative Universe
- ↳ Off Topic English
- Deutschsprachige Foren
- ↳ X4: Foundations
- ↳ X4: Foundations - Spoilers
- ↳ X4: Foundations - Technische Unterstützung
- ↳ X4: Foundations - Scripts und Modding
- ↳ X Rebirth Universum
- ↳ X Rebirth VR Edition
- ↳ X Rebirth - Technische Unterstützung
- ↳ X Rebirth - Scripts und Modding
- ↳ X³: Farnham's Legacy
- ↳ X³: Farnham's Legacy - Scripts und Modding
- ↳ X Trilogie Universum
- ↳ X³: Terran Conflict / Albion Prelude / Farnham's Legacy - Technische Unterstützung
- ↳ X³: Terran Conflict / Albion Prelude - Scripts und Modding
- ↳ X³: Reunion, X²: Die Bedrohung, X-T und X-BTF - Technische Unterstützung
- ↳ X³: Reunion - Scripts und Modding
- ↳ X²: Die Bedrohung - Scripts und Modding
- ↳ Kreative Zone
- ↳ Off Topic Deutsch
- Forum Français
- ↳ X4: Foundations
- ↳ Support et Aide pour X4: Foundations
- ↳ Script et Modding pour X4: Foundations
- ↳ L'Univers X Rebirth
- ↳ Support et Aide pour X Rebirth
- ↳ Script et Modding pour X Rebirth
- ↳ Support et Aide pour la Trilogie X
- ↳ L'Univers de la Trilogie X
- ↳ Script et Modding pour la Trilogie X
- ↳ Off Topic Français
- Forum Italiano
- ↳ X4: Foundations
- ↳ Supporto Tecnico per X4: Foundations
- ↳ Script e Modding per X4: Foundations
- ↳ L'Universo di X Rebirth
- ↳ Script e Modding per X Rebirth
- ↳ Supporto Tecnico per X Rebirth
- ↳ L'Universo della Trilogia di X
- ↳ Script e Modding per la Trilogia di X
- ↳ Supporto Tecnico per la Trilogia di X
- ↳ Off Topic Italiano
- Polskie Fora
- ↳ Polskie / Polish X-Forum
- ↳ Polskie / Polish Off Topic
- 中文 / Chinese X-Forums
- ↳ X4: Foundations
- ↳ X4: Foundations - 技术支持 / Technical Support
- Other Languages
- ↳ Česky / Czech X-Forum
- ↳ Dansk / Danish X-Forum
- ↳ Español / Spanish X-Forum
- ↳ Nederlands / Dutch X-Forum
- ↳ Português / Portuguese X-Forum
- ↳ Русский / Russian X-Forum
- DevNet: General
- ↳ MSCI Reference
- DevNet: X4: Foundations
- DevNet: X Rebirth
- ↳ XR - Technical Troubleshooting
