1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

[Help Request] Building require foreign continent

Discussion in 'Civ6 - Creation & Customization' started by thecrazyscot, Nov 17, 2016.

  1. thecrazyscot

    thecrazyscot Spiffy

    Joined:
    Dec 27, 2012
    Messages:
    1,668
    What I'm trying to create are Colonial Capitals, and in order to do so I need to be able to (a) require that a building be on a foreign continent and (b) limit the building to one per continent.

    If I only needed (a) this would be pretty easy to do...and could be done via xml only. The problem is I need both (a) and (b). I suspect this will require some lua coding, which I have no familiarity with.

    Would someone who knows some lua be willing to help me with this?
     
  2. acluewithout

    acluewithout Chieftain

    Joined:
    Dec 1, 2017
    Messages:
    723
    @thecrazyscot Did you figure this out? I’m also trying to mod something with a “one per continent “ limit.
     
  3. acluewithout

    acluewithout Chieftain

    Joined:
    Dec 1, 2017
    Messages:
    723
    I'm still trying to figure out a way to determine how to mod a "one per continent" requirement. Can anyone help?

    Some thoughts:
    • Is there anyway to get what continent a city is on in the gameplay context? It's possible in a UI context, because otherwise the game couldn't display continents in the tool tip.

    • Spain's Treasure Fleet ability references a TRAIT_INTERCONTINENTAL_DOMESTIC_FOOD and TRAIT_INTERCONTINENTAL_DOMESTIC_PRODUCTION, but I can't see any requirements for those. Is there something here that could be used?
     
  4. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    5,409
    Location:
    Illinois, USA
    Probably not, tho if you are clever perhaps. The intercontinental bit is handled directly in the modifier arguments
    Code:
    		<Row>
    			<ModifierId>TRAIT_INTERCONTINENTAL_DOMESTIC_FOOD</ModifierId>
    			<Name>YieldType</Name>
    			<Value>YIELD_FOOD</Value>
    		</Row>
    		<Row>
    			<ModifierId>TRAIT_INTERCONTINENTAL_DOMESTIC_FOOD</ModifierId>
    			<Name>Amount</Name>
    			<Value>1</Value>
    		</Row>
    		<Row>
    			<ModifierId>TRAIT_INTERCONTINENTAL_DOMESTIC_FOOD</ModifierId>
    			<Name>Intercontinental</Name>
    			<Value>true</Value>
    		</Row>
    The modifier type used is defined as
    Code:
    		<Row>
    			<ModifierType>MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD_FOR_DOMESTIC</ModifierType>
    			<CollectionType>COLLECTION_OWNER</CollectionType>
    			<EffectType>EFFECT_ADJUST_TRADE_ROUTE_YIELD_FOR_DOMESTIC</EffectType>
    		</Row>
     
  5. isau

    isau Warlord

    Joined:
    Jan 15, 2007
    Messages:
    2,695
    You may be able to do this by using a "dummy" building that appears in a city when it meets the condition of being on another continent. The tricky part is making it fire only once, the first time a city meets the conditions. The dummy building is a prereq to build your special building.

    Altho I've not tried the "unique to one continent" element, the dummy building concept described above is precisely how the "Bedrock" feature of my Quo's Combined Tweaks mod works. It places a dummy "bedrock" building in a city when the city meets certain criteria (builds an Encampment, builds a wonder, aquires X num of deep ocean tiles, etc). The bedrock buildings are prereqs for Ancient Medieval and Ren. walls.

    Keep in mind if you go this route you need a little bit of supporting Lua to repair the dummy buildings if the city gets captured. City captures in general are the biggest PITA about working with dummy buildings... you'd need a way to remove the building from a city under certain conditions.
     

Share This Page