[R&F] Can you modify science per pop on a per-city basis?

rattatatouille

Warlord
Joined
Jan 26, 2018
Messages
140
There's this in GlobalModifiers.xml

Code:
<Replace Name="SCIENCE_PERCENTAGE_YIELD_PER_POP" Value="50" />

which is where we get the 0.5 (used to be 0.7 before R&F) Science per population.

Is there a way to make it so that if you have, for example, a Library in a city, this modifier gets bumped up to either 70% or 80% but only for that city?

I'm currently working on an overhaul of certain districts to help reward tall play, see.
 
Check out the Modifier MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_PER_POPULATION (which would effect all cities). It is used by the Theoracy government to add a yield based on population in cities with governors. You could re-use portions of it and rewrite the RequirementSet to return True for cities with the conditions you want to provide the bonus to.
 
I figured it out. Here's what I did:

Code:
<Types>
        <Row Type="MODIFIER_SINGLE_CITY_ADJUST_CITY_YIELD_PER_POPULATION" Kind="KIND_MODIFIER"/>
        <Row Type="MODIFIER_SINGLE_CITY_ADJUST_CITY_YIELD_PER_DISTRICT" Kind="KIND_MODIFIER"/>
    </Types>

These two statements are essentially "hijacking" the per pop modifier from Theocracy/Communism and the per district modifier from Democracy.

Code:
<DynamicModifiers>
        <Row>
            <ModifierType>MODIFIER_SINGLE_CITY_ADJUST_CITY_YIELD_PER_POPULATION</ModifierType>
            <CollectionType>COLLECTION_OWNER</CollectionType>
            <EffectType>EFFECT_ADJUST_CITY_YIELD_PER_POPULATION</EffectType>
        </Row>
        <Row>
            <ModifierType>MODIFIER_SINGLE_CITY_ADJUST_CITY_YIELD_PER_DISTRICT</ModifierType>
            <CollectionType>COLLECTION_OWNER</CollectionType>
            <EffectType>EFFECT_ADJUST_CITY_YIELD_PER_DISTRICT</EffectType>
        </Row>
    </DynamicModifiers>

Here is the crux of the modification. Originally, CollectionType was COLLECTION_PLAYER_CITIES (which, as you may suspect, applies it to all cities owned by a particular player) but after I changed it to COLLECTION_OWNER it now only affects it once per city.
 
Top Bottom