1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

(Social Policies) Having difficulties making a mod that changes building yields after adopting Piety

Discussion in 'Civ5 - Project & Mod Development' started by GyaruRespecter, Apr 8, 2020.

  1. GyaruRespecter

    GyaruRespecter Chieftain

    Joined:
    Apr 8, 2020
    Messages:
    14
    Gender:
    Male
    Location:
    Brazil
    The mod I'm trying to make changes, amongst other things, Shrines and Temples to provide +1 Faith when adopting Piety, +1 Happiness when adopting Mandate of Heaven and +1 Culture when adopting Organized Religion. While so far it's managing to do what it needs to do, my issue is that almost everything I'm trying to change doesn't actually show up in the game itself when testing.

    For example, when a Shrine is built after adopting Piety, it does provide +2 Faith in total. However, when I hover over the Shrine building to see the yields, it still shows that it only provides +1 Faith. Same with Organized Religion, after being adopted, it makes the Shrine provide +1 Culture. However, the yields in-game still don't appear when checking the building. Only Happiness seems to appear, with it clearly appearing in the menu alongside +1 Faith.

    Here are the scripts I've put onto so far, based on the buildings I've been referring. The mod also changes a lot of building yields policies from the Aesthetics tree, so I won't actually post everything that isn't relevant.

    <GameData>

    <Policies>
    <Update>
    <Where Type="POLICY_AESTHETICS"/>
    <Set GoldenAgeMeterMod="-25"/>
    </Update>
    <Update>
    <Where Type="POLICY_PIETY"/>
    <Set PolicyCostModifier="0"/>
    </Update>
    <Update>
    <Where Type="POLICY_CULTURAL_CENTERS"/>
    <Set PolicyCostModifier="0"/>
    </Update>
    <Update>
    <Where Type="POLICY_FINE_ARTS"/>
    <Set HappinessToCulture="100"/>
    </Update>
    <Update>
    <Where Type="POLICY_FLOURISHING_OF_ARTS"/>
    <Set WonderProductionModifier="15"/>
    </Update>
    <Update>
    <Where Type="POLICY_ORGANIZED_RELIGION"/>
    <Set FaithCostModifier="-25"/>
    </Update>
    <Update>
    <Where Type="POLICY_REFORMATION"/>
    <Set PolicyCostModifier="0"/>
    </Update>
    <Update>
    <Where Type="POLICY_FREE_RELIGION"/>
    <Set PolicyCostModifier="0"/>
    </Update>
    <Update>
    <Where Type="POLICY_PIETY_FINISHER"/>
    <Set FaithCostModifier="0"
    PolicyCostModifier="-10"/>
    </Update>
    </Policies>
    <Policy_BuildingClassHappiness>
    <Row>
    <PolicyType>POLICY_MANDATE_OF_HEAVEN</PolicyType>
    <BuildingClassType>BUILDINGCLASS_SHRINE</BuildingClassType>
    <Happiness>1</Happiness>
    </Row>
    <Row>
    <PolicyType>POLICY_MANDATE_OF_HEAVEN</PolicyType>
    <BuildingClassType>BUILDINGCLASS_TEMPLE</BuildingClassType>
    <Happiness>1</Happiness>
    </Row>
    </Policy_BuildingClassHappiness>
    <Policy_BuildingClassYieldChanges>
    <Row>
    <PolicyType>POLICY_PIETY</PolicyType>
    <BuildingClassType>BUILDINGCLASS_SHRINE</BuildingClassType>
    <YieldType>YIELD_FAITH</YieldType>
    <YieldChange>1</YieldChange>
    </Row>
    <Row>
    <PolicyType>POLICY_PIETY</PolicyType>
    <BuildingClassType>BUILDINGCLASS_TEMPLE</BuildingClassType>
    <YieldType>YIELD_FAITH</YieldType>
    <YieldChange>1</YieldChange>
    </Row>
    <Row>
    <PolicyType>POLICY_ORGANIZED_RELIGION</PolicyType>
    <BuildingClassType>BUILDINGCLASS_SHRINE</BuildingClassType>
    <YieldType>YIELD_CULTURE</YieldType>
    <YieldChange>1</YieldChange>
    </Row>
    <Row>
    <PolicyType>POLICY_ORGANIZED_RELIGION</PolicyType>
    <BuildingClassType>BUILDINGCLASS_TEMPLE</BuildingClassType>
    <YieldType>YIELD_CULTURE</YieldType>
    <YieldChange>1</YieldChange>
    </Row>
     
  2. irnf

    irnf Chieftain

    Joined:
    May 30, 2020
    Messages:
    11
    I believe it works it just doesn't show up in the tooltip when you hover over the building, and that's normal, it's just how the UI is designed. You can check your civilization's total yield and you should see that it does change.

    Additionally, when you hover over the city's faith yield (or any other yield) it should say something like "+X from buildings". The "+X from buildings" is displayed separately from the particular building that is giving the yield, if that makes sense. And it sums the added yield from all buildings.

    So if you have adopted 2 policies, one gives +1 faith from walls, one gives +2 faith from castle, and the city has both buildings, then you should see "+3 faith from buildings in the city's total faith yield tooltip, and this should be reflected in the civilization's total faith output. It just won't appear in the tooltip for the particular building when you hover over it.
     
  3. GyaruRespecter

    GyaruRespecter Chieftain

    Joined:
    Apr 8, 2020
    Messages:
    14
    Gender:
    Male
    Location:
    Brazil
    Okay, I think I get it, so that's just how the game is coded? But I am confident I played many overhaul mods that changed yields similarly. Did they do that by changing the LUA and UI?
    What would I need to do in order to have the same effect? Should I play with a mod that changes UI, or do I need to make my mod modify the LUA as well?
     
  4. irnf

    irnf Chieftain

    Joined:
    May 30, 2020
    Messages:
    11
    Yeah I'm only familiar with XML, so I guess they changed the UI. And I have no idea how to do that, sorry.
     

Share This Page