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

[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 Chieftain

    Joined:
    Aug 22, 2012
    Messages:
    1,695
    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 Artist

    Joined:
    Aug 30, 2013
    Messages:
    9,238
    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 Chieftain

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

Share This Page

Ebates: Get Paid to Shop