1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[XML] Code to make a playerperk grant a free building in every city isn't working, and I'm not sure why

Discussion in 'CivBE - Modding Help & Mod Creation' started by Galgus, Oct 26, 2017.

  1. Galgus

    Galgus Emperor

    Joined:
    Aug 22, 2012
    Messages:
    1,705
    The building is showing up in the civilopedia and is unbuildable otherwise, as intended, but the code to grant it isn't working and the Database log doesn't show an error.

    I'm using the modular building quests mod resource, and the idea is for a quest perk to give a the building in all cities.

    This is the relevant code. Is it possible that trying to add yields to the reef feature is causing the problem?

    Code:
    <PlayerPerks>
            <Row>
                <Type>PLAYERPERK_UTOPIA_PROJECT_ALL</Type>
                <Help>TXT_KEY_PLAYERPERK_UTOPIA_PROJECT_FOOD</Help>
                <Freebuilding>BUILDING_UTOPIA_FOREST</Freebuilding>
            </Row>
            <Row>
                <Type>PLAYERPERK_UTOPIA_PROJECT_TILE</Type>
                <Help>TXT_KEY_PLAYERPERK_UTOPIA_PROJECT_CULTURE</Help>
            </Row>
        </PlayerPerks>



    Code:
    <BuildingClasses>
            <Row>
                <Type>BUILDINGCLASS_UTOPIA_FOREST</Type>
                <DefaultBuilding>BUILDING_UTOPIA_FOREST</DefaultBuilding>
                <Description>TXT_KEY_BUILDING_UTOPIA_FOREST</Description>
            </Row>
        </BuildingClasses>
     
        <Buildings>
            <Row>
                <Type>BUILDING_UTOPIA_FOREST</Type>
                <BuildingClass>BUILDINGCLASS_UTOPIA_FOREST</BuildingClass>
                <Cost>-1</Cost>
                <ConquestProbability>0</ConquestProbability>
                <PrereqTech>TECH_HABITATION</PrereqTech>
                <Description>TXT_KEY_BUILDING_UTOPIA_FOREST</Description>
                <Civilopedia>TXT_KEY_BUILDING_UTOPIA_PROJECT_PEDIA</Civilopedia>
                <IconAtlas>BW_ATLAS_1</IconAtlas>
                <PortraitIndex>62</PortraitIndex>
            </Row>
        </Buildings>
     
  2. Ryika

    Ryika Lazy Wannabe Artista

    Joined:
    Aug 30, 2013
    Messages:
    9,395
    Freebuilding needs, contrary to what it states, a BuildingClass, not a Building-type.
    So you need to do:

    Code:
           <Row>
                <Type>PLAYERPERK_UTOPIA_PROJECT_ALL</Type>
                <Help>TXT_KEY_PLAYERPERK_UTOPIA_PROJECT_FOOD</Help>
                <Freebuilding>BUILDINGCLASS_UTOPIA_FOREST</Freebuilding>
            </Row>
    
     
  3. Galgus

    Galgus Emperor

    Joined:
    Aug 22, 2012
    Messages:
    1,705
    Thanks again.
     

Share This Page