Can't get Bonus Yield Changes to work correctly

Matt Inwood

Chieftain
Joined
Oct 16, 2020
Messages
3
I'm trying out modding the tile improvements and am having mixed success. Right now I'm using absurd values to test how it all works out.

I've modded the farm at the base level and with a bonus yield at Mining, and while the mining change shows before I've built the farm, it doesn't persist after the farm is built.

My code is below:
Code:
<GameInfo>
        <Improvement_BonusYieldChanges>
            <Row Id="333" ImprovementType="IMPROVEMENT_FARM" YieldType="YIELD_PRODUCTION" BonusYieldChange="99"  PrereqTech="TECH_MINING"/>
        </Improvement_BonusYieldChanges>

    <Improvement_YieldChanges>
        <!--If the yield change is zero, the value will be changed later.-->
        <Delete ImprovementType="IMPROVEMENT_FARM" YieldType="YIELD_FOOD"/>
        <Row ImprovementType="IMPROVEMENT_FARM" YieldType="YIELD_FOOD" YieldChange="99"/>
    </Improvement_YieldChanges>
</GameInfo>

I don't see any problems with the delete/re-add of the base Farm under `Improvement_YieldChanges`; the bonus one appears in the database, but I'm assuming there's some other downstream dependency that's affecting how it makes
 

Attachments

  • City View.png
    City View.png
    726.3 KB · Views: 50
  • After Build.png
    After Build.png
    389.7 KB · Views: 41
This is what it looked like before I built it; apologies I couldn't get it to attach to the original post.
 

Attachments

  • Before Build.png
    Before Build.png
    993.1 KB · Views: 44
Had an epiphany today and answered my own question; need to initialize that yield type in the base yield change:
Code:
    <Improvement_YieldChanges>
        <!--If the yield change is zero, the value will be changed later.-->
        <Delete ImprovementType="IMPROVEMENT_FARM" YieldType="YIELD_FOOD"/>
        <Row ImprovementType="IMPROVEMENT_FARM" YieldType="YIELD_FOOD" YieldChange="99"/>
        <Row ImprovementType="IMPROVEMENT_FARM" YieldType="YIELD_PRODUCTION" YieldChange="0"/>
    </Improvement_YieldChanges>
 
Back
Top Bottom