Hello there, I'm new to the modding scene for Civ and I'm stumbling on an issue.
I'm making a small mod that plays with the overlays in the building placement UI, and the JavaScript changes I made are working perfectly fine.
I also need to change a single row in: text/en_us/UIText.xml
And that is where I am getting stuck, here's the relevant bit of log from the modloader (in bold the part about the <UpdateText> action that is failing):
[2025-02-18 23:22:29] betterbuildingplacementui-scripts (ImportFiles)
[2025-02-18 23:22:29] Loading base-standard/ui/interface-modes/interface-mode-place-building.js
[2025-02-18 23:22:29] Loading core/ui/utilities/utilities-core-textprovider.js
[2025-02-18 23:22:29] betterbuildingplacementui-text (UpdateText)
[2025-02-18 23:22:29] Creating database save point.
[2025-02-18 23:22:29] Loading text/en_us/UIText.xml
[2025-02-18 23:22:29] Error: Unable to open C:/Users/<mywindowsusername>/AppData/Local/Firaxis Games/Sid Meier's Civilization VII/Mods/BetterBuildingPlacementUi/text/en_us/UIText.xml
[2025-02-18 23:22:29] Successfully released save point.
And here is the relevant bit of my modinfo:
I'm sure some experienced modder will easily spot some silly mistake. In that case, thanks a lot in advance!
PS: in the snippet above I'm using that weird any-age criteria as part of my attempts to fix this, I started with the usual "always" criteria and had the same issue.
I'm making a small mod that plays with the overlays in the building placement UI, and the JavaScript changes I made are working perfectly fine.
I also need to change a single row in: text/en_us/UIText.xml
And that is where I am getting stuck, here's the relevant bit of log from the modloader (in bold the part about the <UpdateText> action that is failing):
[2025-02-18 23:22:29] betterbuildingplacementui-scripts (ImportFiles)
[2025-02-18 23:22:29] Loading base-standard/ui/interface-modes/interface-mode-place-building.js
[2025-02-18 23:22:29] Loading core/ui/utilities/utilities-core-textprovider.js
[2025-02-18 23:22:29] betterbuildingplacementui-text (UpdateText)
[2025-02-18 23:22:29] Creating database save point.
[2025-02-18 23:22:29] Loading text/en_us/UIText.xml
[2025-02-18 23:22:29] Error: Unable to open C:/Users/<mywindowsusername>/AppData/Local/Firaxis Games/Sid Meier's Civilization VII/Mods/BetterBuildingPlacementUi/text/en_us/UIText.xml
[2025-02-18 23:22:29] Successfully released save point.
And here is the relevant bit of my modinfo:
XML:
<ActionCriteria>
<Criteria id="always">
<AlwaysMet/>
</Criteria>
<Criteria id="any-age" any="true">
<AgeInUse>AGE_ANTIQUITY</AgeInUse>
<AgeInUse>AGE_EXPLORATION</AgeInUse>
<AgeInUse>AGE_MODERN</AgeInUse>
</Criteria>
</ActionCriteria>
<ActionGroups>
<ActionGroup id="betterbuildingplacementui-scripts" scope="game" criteria="any-age">
<Actions>
<ImportFiles>
<Item>base-standard/ui/interface-modes/interface-mode-place-building.js</Item>
<Item>core/ui/utilities/utilities-core-textprovider.js</Item>
</ImportFiles>
</Actions>
</ActionGroup>
<ActionGroup id="betterbuildingplacementui-text" scope="game" criteria="any-age">
<Actions>
<UpdateText>
<Item>text/en_us/UIText.xml</Item>
</UpdateText>
</Actions>
</ActionGroup>
</ActionGroups>
I'm sure some experienced modder will easily spot some silly mistake. In that case, thanks a lot in advance!
PS: in the snippet above I'm using that weird any-age criteria as part of my attempts to fix this, I started with the usual "always" criteria and had the same issue.