Civ 7 Modding Questions

Jopo

Chieftain
Joined
May 8, 2010
Messages
89
Location
Joensuu, Finland
A few questions if I may?

I´ve been trying to do an xml based database update mod, but I get these error messages...

jopomod-database-updates-ant (UpdateDatabase)
[2025-02-11 17:32:32] Loading data/constructibles-gameeffects-updates-ant.xml
[2025-02-11 17:32:32] Warning: UpdateDatabase - Error Loading XML.
[2025-02-11 17:32:32] ERROR: Modding Framework Apply Actions - Fatal Error when calling Action::Apply. Rollback Required.
[2025-02-11 17:32:32] jopomod-database-updates-ant (UpdateDatabase)
[2025-02-11 17:32:32] Loading data/resources-gameeffects-updates-ant.xml
[2025-02-11 17:32:32] Warning: UpdateDatabase - Error Loading XML.
[2025-02-11 17:32:32] ERROR: Modding Framework Apply Actions - Fatal Error when calling Action::Apply. Rollback Required.
[2025-02-11 17:32:32] jopomod-database-updates-ant (UpdateDatabase)
[2025-02-11 17:32:32] Loading data/terrain-updates-ant.xml
[2025-02-11 17:32:32] Warning: UpdateDatabase - Error Loading XML.
[2025-02-11 17:32:32] ERROR: Modding Framework Apply Actions - Fatal Error when calling Action::Apply. Rollback Required.
[2025-02-11 17:32:32] Modding Framework - Finished applying actions
[2025-02-11 17:32:32] ERROR: Failed to apply enabled components.


So, my question is, where is the error, is it in my modinfo file or in the xml files themselves? Any tips on how to locate said errors?


Also, I looked into the globaldefines commands posted elsewhere, I wonder if it would be possible to increase the city radius to 4 or 5 tiles out, more room for stuff etc.? Anyone up for the task? Thank you!

By the way, a shout to Gedemon for the great Ynamp map mod, good job! When might the Giant and Ludicrous map sizes come out to being playable? The graphics glitch is bothersome indeed, hopefully it gets fixed soon.
 
The errors simply make it sound like it failed at applying the action either because the xml is faulty or the modinfo linking them. You'd probably have to show some code so we know more.
 
Understood, I´ll post my mod as it is so anyone willing to help can take a look and see what´s wrong. Basically I´ve tried following other modders footsteps to make tweaks of my own. Currently I´ve managed to add a few starting units to antiquity start, but right now with new additions it´s not even showing up on mod list inside the game?? Help would be appreciated, thank you!
 

Attachments

Understood, I´ll post my mod as it is so anyone willing to help can take a look and see what´s wrong. Basically I´ve tried following other modders footsteps to make tweaks of my own. Currently I´ve managed to add a few starting units to antiquity start, but right now with new additions it´s not even showing up on mod list inside the game?? Help would be appreciated, thank you!
I haven't drilled too beyond the first 2 xml files, but you have little a bit of work to do here. First think i'd recommend is enabling debugging and getting access to the gameplay database. You'll need to understand the table structure before you update it. See here.

You do have some problems with some unopened/unclosed tags. Eg. Line 30 of your modinfo is a closing </Criteria> tag, but should be an opening tag like <Criteria>.

If you're not already using it, I'd grad VS Code and install one of the xml extensions like redhat lang support. This will allow you to select all and just click "FormatDocument". That will fix your indents and make it much more readable and therefore easier to pick up on things. In many cases it will even highlight syntax errors for you.

Eg. in you gameffects updates, you're trying to modify the GameEffects table (don't worrying about include the xmlns tag there). You're trying to update columns in that table that don't actually exist. That table only has Name and Value columns.

The XML can be a bit misleading because alot of what's in there is actually shupdating many tables at once.

So in this example

XML:
    <Update>
            <Where Modifier id="MOD_ANGKOR_WAT_WORKER_CAP"  ></Where>
            <Set Collection="COLLECTION_PLAYER_CITIES"></Set>
            <Set Amount="5"></Set>   
    </Update>

You actually want to update the ModifierArguments table to change the amount. In the case of Collection - if you indeed want to update that - you will actually need to update DynamicModifiers table instead.

If you haven't already, I would highly recommend reducing your scope for now and just trying to perform a single change, then validate that it works. Then branch out further from there.

All the best.
 
To expand on what PoundedChicken has already answered.

GameEffects span multiple tables. The syntax they use is for practicality, so you define it all at one place instead of across multiple tables. But it's just for creating new effects. It's an alternative to Database tag, not something to be inside of it.

Code:
<?xml version="1.0" encoding="utf-8"?>
<GameEffects xmlns="GameEffects">
    <Modifier id="EFFECT_GRANT_WILCARD_POINT" collection="COLLECTION_OWNER" effect="EFFECT_PLAYER_ATTRIBUTE" permanent="true">
        <SubjectRequirements>
            <Requirement type="REQUIREMENT_PLAYER_LEADER_TYPE_MATCHES">
                <Argument name="LeaderType">LEADER_IBN_BATTUTA</Argument>
            </Requirement>
        </SubjectRequirements>
        <Argument name="AttributeType">ATTRIBUTE_WILDCARD</Argument>
        <Argument name="Amount">1</Argument>
    </Modifier>

    <Modifier id="EFFECT_GRANT_SCIENCE_ON_OVERBUILD" collection="COLLECTION_PLAYER_CITIES" effect="TRIGGER_CITY_GRANT_YIELD_ON_CONSTRUCTIBLE_CREATED">
        <Argument name="YieldType">YIELD_SCIENCE</Argument>
        <Argument name="Percent">50</Argument>
        <Argument name="Overbuilt">true</Argument>
    </Modifier>
</GameEffects>

This creates two effects: one that, upon triggering, grants the player Wildcard Attribute Point If they play as Ibn Battuta; one that causes player's cities, If the player has this trait, to grant Science on Overbuilding equal to 50% of the Building's Production Cost.

If you wish to update existing GameEffect, you must perform Database updates as you do but on the various tables. As PoundedChicken said, you would need to look more into gameplay database to find what to update where. I provide minor example of updating only arguments of existing GameEffect.

Code:
<?xml version="1.0" encoding="utf-8"?>
<Database>
    <ModifierArguments>
        <Update>
            <Where ModifierId="TRAIT_MOD_NINE_PROVINCES_TOWN" Name="Amount" />
            <Set Value="3" />
        </Update>

        <Update>
            <Where ModifierId="MOD_CIV_WONDER_PRODUCTION_HAN" Name="Percent" />
            <Set Value="100" />
        </Update>
    </ModifierArguments>
</Database>

This updates the TRAIT_MOD_NINE_PROVINCES_TOWN assign to Han so that Towns start with 4 Citizens instead of 2 and the Bonus Production they get toward Waiyang Palace to 100% instead of 30%.

If this is all too much, you can always create new GameEffect by copying an existing one and then replace its reference. For example, I could create GameEffect that's copy of TRAIT_MOD_NINE_PROVINCES_TOWN with just the Amount argument changed and then update Han to have my new GameEffect TRAIT_MOD_NINE_PROVINCES_TOWN_JEPPETTO instead of the original one.

Code:
<?xml version="1.0" encoding="utf-8"?>
<GameEffects xmlns="GameEffects">
    <Modifier id="TRAIT_MOD_NINE_PROVINCES_TOWN_JEPPETTO" collection="COLLECTION_PLAYER_CITIES" effect="EFFECT_CITY_ADJUST_POPULATION" permanent="true">
        <SubjectRequirements>
            <Requirement type="REQUIREMENT_CITY_IS_TOWN"/>
            <Requirement type="REQUIREMENT_CITY_IS_ORIGINAL_OWNER"/>
        </SubjectRequirements>
        <Argument name="Amount">3</Argument>
    </Modifier>
</GameEffects>

Code:
<?xml version="1.0" encoding="utf-8"?>
<Database>
    <TraitModifiers>
        <Delete TraitType="TRAIT_HAN_ABILITY" ModifierId="TRAIT_MOD_NINE_PROVINCES_TOWN" />
        <Row TraitType="TRAIT_HAN_ABILITY" ModifierId="TRAIT_MOD_NINE_PROVINCES_TOWN_JEPPETTO" />
    </TraitModifiers>
</Database>

The last could be Update statement but I like this more.

There is similarly something syntactically wrong with the terrain updates file, but I do not know that table enough to instantly see it.
 
Back
Top Bottom