[XML] How properly modify expeditions rewards?

folioblade

Chieftain
Joined
Feb 15, 2025
Messages
4
I'm trying to modify the expedition bonuses. I took the Expedition affinity bonos mod as an example and did some things. Unfortunately it didn't work.
I reduced the scope of the problem, and only updated the weights(ChanceWeight) in <PlotBonus_ResourceChanceWeights> from 1 to 0. At the moment the mini edit looks like this:
XML:
<GameData>
    <PlotBonus_ResourceChanceWeights>
        <Update>
            <Where PlotBonusType="PLOT_BONUS_BIG_AFFINITY_PROGRESS" ResourceType="RESOURCE_ALIEN_SKELETON"/>
            <Set ChanceWeight="0"/>
        </Update>
        <Update>
            <Where PlotBonusType="PLOT_BONUS_BIG_AFFINITY_PROGRESS" ResourceType="RESOURCE_ALIEN_SKELETON_OCEAN"/>
            <Set ChanceWeight="0"/>
        </Update>
    </PlotBonus_ResourceChanceWeights>
</GameData>
Log entries that can indicate the problem:
The entry in Database.log appears when I perform an expedition. It does not appear at the mods loading screen
Code:
[99975.406] no such column: Type
[99975.406] In Query - select * from Affinity_Levels where Type = ? LIMIT 1
Entries in lua.log also appear during the game.
Lua.log
Code:
[99975.312] Big Affinity Progress plot bonus for player 0
[99975.328] Culture plot bonus for player 0
[99975.453] PlotBonusPopup: PlotBonusPopup, Blur On
[99975.562] PlotBonusPopup: PlotBonusPopup, Blur Off
[99975.578] PlotBonusPopup: PlotBonusPopup, Blur On
[99976.531] PlotBonusPopup: PlotBonusPopup, Blur Off

If I edit the source files CIVBEPlotBonuses.xml, and set the weights to 0, then from my observations, the expedition rewards are actually changed (e.g. no affinity points as award, only alien unit).
Editing the files seems to work fine with all expeditions, except for progenitor ruins.
If I change the weights of the progenitor ruins, the notification window does not appear and no rewards are accrued (empty useless expedition ), but this is some other problem.
 
Last edited:
My mistake, I forgot to add the database update action. Going back to the main mod, I added some new plot bonus entries and the corresponding lua files and text. I also added a modified PlotBonusSystem file from the AwesomePodsAndRuins mod via the modbuddy. And I got a common issue with airborne terrain. So the question is, how do I configure the lua files properties in modBuddy to make it all work? Because I can't edit the field "type" in file properties. Here are the instructions from the Utilities: Modular Script Loading steamworkshop page.
Spoiler Modular Script Loading :

How to implement in your mods:
  • In your mod, either add a dependency to this mod, or copy all of this mod's replacement Lua files to your mod and set them to VFS = true.
  • When defining a new item, such as a new Covert Operation, make sure the <ScriptName> tag is set to be your Lua filename without its extension.
  • Ensure your Lua file is set to VFS = true, but you must alsoadd the Lua file through the Content tab, and you must use a Type appropriate to the type of content you are adding. Note that you must manually enter in the Types listed below, as they are not part of the default types in ModBuddy. The Types are:
    • Covert Operations: CovertOperationsAddin
    • Minor Power Scripts: MinorPowersAddin
    • Personality Scripts: PersonalityAddin
    • Plot Bonus Scripts: PlotBonusAddin
    • Quest Scripts: Quest *
    • Quest Objective Scripts: QuestObjective *
      * note the lack of ''Addin'' after these two -- this is how they were ''implemented'' in the fall patch but it's somewhat broken. Best to use Firaxis's method for when (if) they fix it, so that your mod will no longer have a dependency on this when they do.
[/LIST]
 
Last edited:
It seems I have managed to add the renamed Lua file through the Content tab. And the stuff partly works, except for the Sounding Bells. No expedition end notification. Maybe it's because I changed the weights of both rows, i.e. ALL of them
Spoiler sounding bells :

XML:
<PlotBonus_ResourceChanceWeights>      
       <Row>
            <PlotBonusType>PLOT_BONUS_TECH_PROGRESS_SOUNDING_BELL</PlotBonusType>
            <ResourceType>RESOURCE_SOUNDING_BELL_OCEAN</ResourceType>
            <ChanceWeight>1</ChanceWeight>
        </Row>
        <Row>
            <PlotBonusType>PLOT_BONUS_FAR_TECH_PROGRESS_SOUNDING_BELL</PlotBonusType>
            <ResourceType>RESOURCE_SOUNDING_BELL_OCEAN</ResourceType>
            <ChanceWeight>2</ChanceWeight>
        </Row>
        <Update>
            <Where PlotBonusType="PLOT_BONUS_FREE_AFFINITY_LEVEL_SOUNDING_BELL" ResourceType="RESOURCE_SOUNDING_BELL_OCEAN"/>
            <Set ChanceWeight="0"/>
        </Update>
        <Update>
            <Where PlotBonusType="PLOT_BONUS_BIG_AFFINITY_PROGRESS_KRAKEN_NEST" ResourceType="RESOURCE_KRAKEN_NEST_OCEAN"/>
            <Set ChanceWeight="0"/>
        </Update>
</PlotBonus_ResourceChanceWeights>

Is there any limitations in updating the stock weights?
 
Last edited:
To make the new Alien Ruins and Sounding Bells plot bonuses appear and work correctly(probably) I had to add these weird zero-weight rows, relating to other resources - Skeleton and Settlement. Actually, they could probably be any(?).
Spoiler wierd rows :

XML:
<PlotBonus_ResourceChanceWeights>
        <Row>
            <PlotBonusType>PLOT_BONUS_FREE_ALIEN_UNIT</PlotBonusType>
            <ResourceType>RESOURCE_SOUNDING_BELL_OCEAN</ResourceType>
            <ChanceWeight>0</ChanceWeight>
        </Row>
        <Row>
            <PlotBonusType>PLOT_BONUS_FREE_ALIEN_UNIT</PlotBonusType>
            <ResourceType>RESOURCE_ALIEN_RUIN</ResourceType>
            <ChanceWeight>0</ChanceWeight>
        </Row>
        <Row>
            <PlotBonusType>PLOT_BONUS_FREE_ALIEN_UNIT</PlotBonusType>
            <ResourceType>RESOURCE_ALIEN_RUIN_OCEAN</ResourceType>
            <ChanceWeight>0</ChanceWeight>
        </Row>
        <Row>
            <PlotBonusType>PLOT_BONUS_BIG_CULTURE</PlotBonusType>
            <ResourceType>RESOURCE_SOUNDING_BELL_OCEAN</ResourceType>
            <ChanceWeight>0</ChanceWeight>
        </Row>
        <Row>
            <PlotBonusType>PLOT_BONUS_BIG_CULTURE</PlotBonusType>
            <ResourceType>RESOURCE_ALIEN_RUIN</ResourceType>
            <ChanceWeight>0</ChanceWeight>
        </Row>
        <Row>
            <PlotBonusType>PLOT_BONUS_BIG_CULTURE</PlotBonusType>
            <ResourceType>RESOURCE_ALIEN_RUIN_OCEAN</ResourceType>
            <ChanceWeight>0</ChanceWeight>
        </Row>
</PlotBonus_ResourceChanceWeights>

I came to these accidentally and have no idea why they have such an effect. I can only suppose that it is related to the IDs, though I already had a remapper(just in case).
 
Back
Top Bottom