[R&F] How can we limit the number of cities per civ

It's not well balanced at the moment, but I have a (currently private) mod where I replaced the entire civics tree. One of the things I did was to completely disable building of settlers, create basically a row of civics called "expansion" that will give you a settler in the capital as you complete the civic. That's the only way I can think of placing a hard limit on the number of settlers, to disable having them built and only can be created when you get to certain civics or techs.
 
It's not well balanced at the moment, but I have a (currently private) mod where I replaced the entire civics tree. One of the things I did was to completely disable building of settlers, create basically a row of civics called "expansion" that will give you a settler in the capital as you complete the civic. That's the only way I can think of placing a hard limit on the number of settlers, to disable having them built and only can be created when you get to certain civics or techs.

Could you mention a formula (rows in *.xml) how to disable building of Settlers and to set up their appearance after civic`s completion?
Just one example would be enough.
Thank you very much in advance. :)
 
Disable settlers (CIVIC_SETTLER_20 is put at the very end of the civic tree, because I couldn't be bothered doing more than 20 of the same type of civic)

Code:
<GameData>
    <Units>
        <Update>
            <Where UnitType="UNIT_SETTLER"></Where>
            <Set MustPurchase="TRUE" PrereqCivic="CIVIC_SETTLER_20"></Set>
        </Update>
    </Units>
</GameData>

Creating the modifier
Code:
    <Modifiers>
        <Row>
            <ModifierId>CIVIC_SETTLER</ModifierId>
            <ModifierType>MODIFIER_PLAYER_GRANT_UNIT_IN_CAPITAL</ModifierType>
            <RunOnce>true</RunOnce>
        </Row>
    </Modifiers>
    <ModifierArguments>
        <Row>
            <ModifierId>CIVIC_SETTLER</ModifierId>
            <Name>UnitType</Name>
            <Value>UNIT_SETTLER</Value>
        </Row>
        <Row>
            <ModifierId>CIVIC_SETTLER</ModifierId>
            <Name>Amount</Name>
            <Value>1</Value>
        </Row>
    </ModifierArguments>

Attach modifier to civic
Code:
    <CivicModifiers>
        <Row>
            <CivicType>CIVIC_SETTLER_1</CivicType>
            <ModifierId>CIVIC_SETTLER</ModifierId>
        </Row>
</CivicModifiers>
 
Disable settlers (CIVIC_SETTLER_20 is put at the very end of the civic tree, because I couldn't be bothered doing more than 20 of the same type of civic)

Code:
<GameData>
    <Units>
        <Update>
            <Where UnitType="UNIT_SETTLER"></Where>
            <Set MustPurchase="TRUE" PrereqCivic="CIVIC_SETTLER_20"></Set>
        </Update>
    </Units>
</GameData>

Creating the modifier
Code:
    <Modifiers>
        <Row>
            <ModifierId>CIVIC_SETTLER</ModifierId>
            <ModifierType>MODIFIER_PLAYER_GRANT_UNIT_IN_CAPITAL</ModifierType>
            <RunOnce>true</RunOnce>
        </Row>
    </Modifiers>
    <ModifierArguments>
        <Row>
            <ModifierId>CIVIC_SETTLER</ModifierId>
            <Name>UnitType</Name>
            <Value>UNIT_SETTLER</Value>
        </Row>
        <Row>
            <ModifierId>CIVIC_SETTLER</ModifierId>
            <Name>Amount</Name>
            <Value>1</Value>
        </Row>
    </ModifierArguments>

Attach modifier to civic
Code:
    <CivicModifiers>
        <Row>
            <CivicType>CIVIC_SETTLER_1</CivicType>
            <ModifierId>CIVIC_SETTLER</ModifierId>
        </Row>
</CivicModifiers>
Thank you very much for the help :)
 
In Rise and Fall you should actually be able to do this in a pretty straightforward way using the new effect EFFECT_ADJUST_PLAYER_UNIT_BUILD_DISABLED in conjunction with the requirement type REQUIREMENT_COLLECTION_COUNT_GREATERTHAN where you check if the collection COLLECTION_PLAYER_BUILT_CITIES is greater than 3 in order to disable Settler building. Just attach the modifier/requirement combo to the default leader trait and you should be good to go. You could create a second modifier with the effect EFFECT_ADJUST_DISABLE_SETTLING and the same requirement and you'd prevent players from being able to settle new cities as well with existing Settlers.
 
In Rise and Fall you should actually be able to do this in a pretty straightforward way using the new effect EFFECT_ADJUST_PLAYER_UNIT_BUILD_DISABLED in conjunction with the requirement type REQUIREMENT_COLLECTION_COUNT_GREATERTHAN where you check if the collection COLLECTION_PLAYER_BUILT_CITIES is greater than 3 in order to disable Settler building. Just attach the modifier/requirement combo to the default leader trait and you should be good to go. You could create a second modifier with the effect EFFECT_ADJUST_DISABLE_SETTLING and the same requirement and you'd prevent players from being able to settle new cities as well with existing Settlers.
I don't really understand where should i to add this. Could you explain me?
 
Top Bottom