[RESOLVED] Adding Government Ability

Social_Mech

Chieftain
Joined
Feb 8, 2021
Messages
28
I'm trying to add a Government Ability to Digital Democracy.
I want the player to receive +1 Favor for every Broadcast Canter in their empire.
Here is the code:
Code:
<GovernmentModifiers>
        <Delete GovernmentType="GOVERNMENT_DIGITAL_DEMOCRACY"/>
        <Row GovernmentType="GOVERNMENT_DIGITAL_DEMOCRACY" ModifierId="DIGITAL_DEMOCRACY_CITY_AMENITIES"/>
        <Row GovernmentType="GOVERNMENT_DIGITAL_DEMOCRACY" ModifierId="DIGITAL_DEMOCRACY_DISTRICT_CULTURE"/>
        <Row GovernmentType="GOVERNMENT_DIGITAL_DEMOCRACY" ModifierId="SM_DIGITAL_DEMOCRACY_BROADCAST_FAVOR"/>
    </GovernmentModifiers>
    <Modifiers>
        <Row ModifierId="SM_DIGITAL_DEMOCRACY_BROADCAST_FAVOR" ModifierType="MODIFIER_PLAYER_ADJUST_EXTRA_FAVOR_PER_TURN" SubjectRequirementSetId="CITY_HAS_BROADCAST"/>
    </Modifiers>
    <ModifierArguments>
        <Row ModifierId="SM_DIGITAL_DEMOCRACY_BROADCAST_FAVOR" Name="Amount" Value="1"/>
    </ModifierArguments>
    <RequirementSets>
        <Row RequirementSetId="CITY_HAS_BROADCAST" RequirementSetType="REQUIREMENTSET_TEST_ALL"/>
    </RequirementSets>
    <RequirementSetRequirements>
        <Row RequirementSetId="CITY_HAS_BROADCAST" RequirementId="CITY_HAS_BROADCAST_ID"/>
    </RequirementSetRequirements>
    <Requirements>
        <Row RequirementId="CITY_HAS_BROADCAST_ID" RequirementType="REQUIREMENT_CITY_HAS_BUILDING"/>
    </Requirements>
    <RequirementArguments>
        <Row RequirementId="CITY_HAS_BROADCAST_ID" Name="BuildingType" Value="BUILDING_BROADCAST_CENTER"/>
    </RequirementArguments>
It isn't working and I'm not sure why. Does anyone have any idea? Thank you.
 
Because the ModifierType is a player level modifier but you are attempting to add a city level requirement set.

A player is not a city so can never meet the requirement.

DIGITAL_DEMOCRACY_CITY_AMENITIES uses MODIFIER_PLAYER_CITIES_ADJUST_POLICY_AMENITY
DIGITAL_DEMOCRACY_DISTRICT_CULTURE uses MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_PER_DISTRICT

Both are MODIFIER_PLAYER_CITIES_XXX and are therefore implemented at the city level for that player in all the player's cities, and the requirements if any can be applied against each city the player owns.

See
Code:
		<Row>
			<ModifierId>MONARCHY_STARFORT_FAVOR</ModifierId>
			<ModifierType>MODIFIER_PLAYER_CITIES_ADJUST_EXTRA_FAVOR_PER_TURN</ModifierType>
			<SubjectRequirementSetId>CITY_HAS_RENAISSANCE_WALLS</SubjectRequirementSetId>
		</Row>
 
Because the ModifierType is a player level modifier but you are attempting to add a city level requirement set.

A player is not a city so can never meet the requirement.

DIGITAL_DEMOCRACY_CITY_AMENITIES uses MODIFIER_PLAYER_CITIES_ADJUST_POLICY_AMENITY
DIGITAL_DEMOCRACY_DISTRICT_CULTURE uses MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_PER_DISTRICT

Both are MODIFIER_PLAYER_CITIES_XXX and are therefore implemented at the city level for that player in all the player's cities, and the requirements if any can be applied against each city the player owns.

See
Code:
        <Row>
            <ModifierId>MONARCHY_STARFORT_FAVOR</ModifierId>
            <ModifierType>MODIFIER_PLAYER_CITIES_ADJUST_EXTRA_FAVOR_PER_TURN</ModifierType>
            <SubjectRequirementSetId>CITY_HAS_RENAISSANCE_WALLS</SubjectRequirementSetId>
        </Row>
Ah yes, this worked. THANK YOU!
 
Last edited:
Top Bottom