1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

How to make a building that increases a yield based on population of that city?

Discussion in 'Mod Creation Help' started by MistaScriblez, Nov 24, 2017.

  1. MistaScriblez

    MistaScriblez Chieftain

    Joined:
    May 17, 2014
    Messages:
    18
    Location:
    Los Angeles
    Basically a civ 5 library, where a pop will give half a science. All buildings in civ 6 give flat bonuses.
     
  2. Mopafid

    Mopafid Chieftain

    Joined:
    Nov 20, 2017
    Messages:
    8
    Gender:
    Male
    You talking about the amount of pop that is actively working the building?

    I'm presuming you're talking about how districts work, that can with extra buildings fit 1-3 pop, and give more output per pop?
     
  3. sclera

    sclera Chieftain

    Joined:
    Nov 13, 2013
    Messages:
    25
    No, he's talking about the way Libraries worked in Civ 5. 2 pop = 1 science.
     
  4. criZp

    criZp Chieftain

    Joined:
    Jul 19, 2013
    Messages:
    436
    Location:
    Nidaros, Norway
    Might be an idea to check how libraries are coded in civ 5.
     
  5. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    5,139
    Location:
    Illinois, USA
    Firaxis provided a specific game-table in the database for this effect as an inherent part of Civ5, which is not available in Civ6. So the method used for the Civ5 Library will not apply to Civ6.
     
  6. dagriggstar

    dagriggstar Chieftain

    Joined:
    Mar 23, 2006
    Messages:
    510
    Location:
    Adelaide, Australia
    This is based on my industrial mod, except I am pretending that it's a library.

    Code:
    <GameData>
        <BuildingModifiers>
            <Row>
                <BuildingType>BUILDING_LIBRARY</BuildingType>
                <ModifierId>BUILDING_LIBRARY_SCIENCE_PER_POP_1</ModifierId>
            </Row>
        </BuildingModifiers>
        <Modifiers>
            <Row>
                <ModifierId>BUILDING_LIBRARY_SCIENCE_PER_POP_1</ModifierId>
                <ModifierType>MODIFIER_BUILDING_YIELD_CHANGE</ModifierType>
                <SubjectRequirementSetId>LIBRARY_SCIENCE_PER_POP_COUNT_1</SubjectRequirementSetId>
                <RunOnce>false</RunOnce>
                <Permanent>false</Permanent>
            </Row>
        </Modifiers>
        <ModifierArguments>
            <Row>
                <ModifierId>BUILDING_LIBRARY_SCIENCE_PER_POP_1</ModifierId>
                <Name>BuildingType</Name>
                <Value>BUILDING_LIBRARY</Value>
            </Row>
            <Row>
                <ModifierId>BUILDING_LIBRARY_SCIENCE_PER_POP_1</ModifierId>
                <Name>Amount</Name>
                <Value>0.5</Value>
            </Row>
            <Row>
                <ModifierId>BUILDING_LIBRARY_SCIENCE_PER_POP_1</ModifierId>
                <Name>YieldType</Name>
                <Value>YIELD_SCIENCE</Value>
            </Row>
        </ModifierArguments>
        <RequirementSets>
            <Row>
                <RequirementSetId>LIBRARY_SCIENCE_PER_POP_COUNT_1</RequirementSetId>
                <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
            </Row>
        </RequirementSets>
        <RequirementSetRequirements>
            <Row>
                <RequirementSetId>LIBRARY_SCIENCE_PER_POP_COUNT_1</RequirementSetId>
                <RequirementId>COUNT_POP_1</RequirementId>
            </Row>
        </RequirementSetRequirements>
        <Requirements>
            <Row>
                <RequirementId>COUNT_POP_1</RequirementId>
                <RequirementType>REQUIREMENT_COLLECTION_COUNT_ATLEAST</RequirementType>
            </Row>
        </Requirements>
        <RequirementArguments>
            <Row>
                <RequirementId>COUNT_POP_1</RequirementId>
                <Name>CollectionType</Name>
                <Value>COLLECTION_CITY_PLOT_YIELDS</Value>
            </Row>
            <Row>
                <RequirementId>COUNT_POP_1</RequirementId>
                <Name>Count</Name>
                <Value>1</Value>
            </Row>
        </RequirementArguments>
    </GameData>
    That code should add 0.5 science to any city that has 1 population once a library has been built in that city. If you copy/paste that code, replace anywhere that has "1" with 2, you should then create code that will add 0.5 science to any city with a library that has 1 population AND another 0.5 science to any city with a library that has 2 population. You have to keep copy/pasting code (Next time replacing the 2s with 3s etc) until you reach a population amount high enough you don't think anyone will get to. In my industrial mod (Powerplant adds +1 production per 8 population regionally, or more accurately +0.125 production per 1 population), I went all the way to 30. It's labour intensive but it works.
     

Share This Page