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

Trouble with new Citystates

Discussion in 'Mod Creation Help' started by Bukest, Mar 28, 2017.

  1. Bukest

    Bukest Chieftain

    Joined:
    Mar 28, 2017
    Messages:
    2
    Gender:
    Male
    Hello guys, I made some custom citystates that I'll use for a custom map, and at the moment one problem happens to me:
    When I want to place the citystate on my map, it doesn't exist.
    But they are shown as leaders. So instead of a CS called Andorra, there is a leader called Andorra, how can I turn Andorra into a citystate?
    I'm new to modding and just wanted to add some CS for a map, so I tried the scheme of the civilizations.xml
    file and this is how it looks like:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <GameInfo>
        <Types>
            <!--CIVILIZATIONS-->
            <Row Type="CIVILIZATION_ANDORRA" Kind="KIND_CIVILIZATION"/>
            <!--LEADERS-->
            <Row Type="LEADER_MINOR_CIV_ANDORRA" Kind="KIND_LEADER"/>
            <!--TRAITS-->
            <Row Type="MINOR_CIV_ANDORRA_TRAIT" Kind="KIND_TRAIT"/>
        </Types>
        <Leaders>
            <Row LeaderType="LEADER_MINOR_CIV_ANDORRA" Name="Andorra" InheritFrom="LEADER_MINOR_CIV_TRADE"/>
        </Leaders>
        <LeaderTraits>
            <Row LeaderType="LEADER_MINOR_CIV_ANDORRA" TraitType="MINOR_CIV_ANDORRA_TRAIT"/>
        </LeaderTraits>
        <Traits>
            <Row TraitType="MINOR_CIV_ANDORRA_TRAIT" Name="Andorra Suzerain Bonus" Description="+1 [ICON_GOLD] and +1 [ICON_CULTURE] for all mountain tiles in your Civilization."/>
        </Traits>     
        <TraitModifiers>     
            <Row TraitType="MINOR_CIV_ANDORRA_TRAIT" ModifierId="MINOR_CIV_ANDORRA_UNIQUE_INFLUENCE_MOUNTAINS_GOLD_BONUS"/>
        </TraitModifiers>
        <Modifiers>
            <!--ANDORRA-->
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_UNIQUE_INFLUENCE_MOUNTAINS_GOLD_BONUS</ModifierId>
                <ModifierType>MODIFIER_ALL_PLAYERS_ATTACH_MODIFIER</ModifierType>
                <SubjectRequirementSetId>PLAYER_IS_SUZERAIN</SubjectRequirementSetId>
            </Row>
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_UNIQUE_INFLUENCE_MOUNTAINS_CULTURE_BONUS</ModifierId>
                <ModifierType>MODIFIER_ALL_PLAYERS_ATTACH_MODIFIER</ModifierType>
                <SubjectRequirementSetId>PLAYER_IS_SUZERAIN</SubjectRequirementSetId>
            </Row>
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_UNIQUE_INFLUENCE_MOUNTAINS_GOLD_BONUS</ModifierId>
                <ModifierType>MODIFIER_PLAYER_ADJUST_PLOT_YIELD</ModifierType>
                <SubjectRequirementSetId>TERRAIN_IS_MOUNTAIN</SubjectRequirementSetId>
            </Row>
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_UNIQUE_INFLUENCE_MOUNTAINS_CULTURE_BONUS</ModifierId>
                <ModifierType>MODIFIER_PLAYER_ADJUST_PLOT_YIELD</ModifierType>
                <SubjectRequirementSetId>TERRAIN_IS_MOUNTAIN</SubjectRequirementSetId>
            </Row>
        </Modifiers> 
        <!-------------------------------------------------------------------------MODIFIER ARGUMENTS------------------------------------------------------------------------->
        <ModifierArguments>
            <!--ANDORRA-->
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_UNIQUE_INFLUENCE_MOUNTAINS_CULTURE_BONUS</ModifierId>
                <Name>ModifierId</Name>
                <Value>MINOR_CIV_ANDORRA_MOUNTAINS_CULTURE_BONUS</Value>
            </Row>
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_MOUNTAINS_CULTURE_BONUS</ModifierId>
                <Name>YieldType</Name>
                <Value>YIELD_CULTURE</Value>
            </Row>
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_MOUNTAINS_CULTURE_BONUS</ModifierId>
                <Name>Amount</Name>
                <Value>1</Value>
            </Row>
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_MOUNTAINS_CULTURE_BONUS</ModifierId>
                <Name>TerrainType</Name>
                <Value>TERRAIN_MOUNTAIN</Value>
            </Row>
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_UNIQUE_INFLUENCE_MOUNTAINS_GOLD_BONUS</ModifierId>
                <Name>ModifierId</Name>
                <Value>MINOR_CIV_ANDORRA_MOUNTAINS_GOLD_BONUS</Value>
            </Row>
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_MOUNTAINS_GOLD_BONUS</ModifierId>
                <Name>YieldType</Name>
                <Value>YIELD_GOLD</Value>
            </Row>
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_MOUNTAINS_GOLD_BONUS</ModifierId>
                <Name>Amount</Name>
                <Value>1</Value>
            </Row>
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_MOUNTAINS_GOLD_BONUS</ModifierId>
                <Name>TerrainType</Name>
                <Value>TERRAIN_MOUNTAIN</Value>
            </Row>
        </ModifierArguments>
        <RequirementSets>
            <Row>
                <RequirementSetId>PLAYER_IS_SUZERAIN</RequirementSetId>
                <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
            </Row>
            <Row>
                <RequirementSetId>TERRAIN_IS_MOUNTAIN</RequirementSetId>
                <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
            </Row>
        </RequirementSets>
        <RequirementSetRequirements>
            <Row>
                <RequirementSetId>PLAYER_IS_SUZERAIN</RequirementSetId>
                <RequirementId>REQUIRES_PLAYER_IS_SUZERAIN</RequirementId>
            </Row>
            <Row>
                <RequirementSetId>TERRAIN_IS_MOUNTAIN</RequirementSetId>
                <RequirementId>REQUIRES_TERRAIN_IS_MOUNTAIN</RequirementId>
            </Row>
        </RequirementSetRequirements>
        <Requirements>
            <Row>
                <RequirementId>REQUIRES_TERRAIN_IS_MOUNTAIN</RequirementId>
                <RequirementType>REQUIREMENT_PLOT_TERRAIN_TYPE_MATCHES</RequirementType>
            </Row>
        </Requirements>
        <RequirementArguments>
            <Row>
                <RequirementId>REQUIRES_TERRAIN_IS_MOUNTAIN</RequirementId>
                <Name>TerrainType</Name>
                <Value>TERRAIN_MOUNTAIN</Value>
            </Row>
        </RequirementArguments>
        <TypeProperties>
            <Row Type="CIVILIZATION_ANDORRA" Name="CityStateCategory" Value="TRADE"/> 
        </TypeProperties> 
        <Civilizations>
            <Row CivilizationType="CIVILIZATION_ANDORRA" Name="Andorra" Description="Andorra city-state" Adjective="Andorra" StartingCivilizationLevelType="CIVILIZATION_LEVEL_CITY_STATE" RandomCityNameDepth="1"/>
        </Civilizations>
        <CivilizationLeaders>
            <Row CivilizationType="CIVILIZATION_ANDORRA" LeaderType="LEADER_MINOR_CIV_ANDORRA" CapitalName="Andorra"/>
        </CivilizationLeaders> 
        <CityNames>
            <Row CivilizationType="CIVILIZATION_ANDORRA" CityName="Andorra"/>
        </CityNames>
        <PlayerColors>
            <Row>
                <Type>CIVILIZATION_ANDORRA</Type>
                <Usage>Minor</Usage>
                <PrimaryColor>COLOR_PLAYER_CITY_STATE_PRIMARY</PrimaryColor>
                <SecondaryColor>COLOR_PLAYER_CITY_STATE_TRADE_SECONDARY</SecondaryColor>
                <TextColor>COLOR_PLAYER_CITY_STATE_TRADE_SECONDARY</TextColor>         
            </Row>     
        </PlayerColors>
    </GameInfo>    
    I hope that someone can help me with my little problem here ^^
     
    Last edited: Mar 28, 2017
  2. kantorr

    kantorr Chieftain

    Joined:
    Mar 1, 2017
    Messages:
    51
    I'll take a look today
     
  3. kantorr

    kantorr Chieftain

    Joined:
    Mar 1, 2017
    Messages:
    51
    upload_2017-4-5_17-22-33.png
    upload_2017-4-5_17-24-38.png

    So I got it to work with hills. Unfortunately, and I hate it too, but I have never been able to give Mountains a yield. So for simplicity I changed all the MOUNTAINS/MOUNTAIN in your code to HILLS.
    Since you didnt upload a modinfo, I don't know what yours looks like. This is what mine looks like with no database or gameplay errors:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <Mod id="90ADBBDF-12FC-4753-BCE1-8238354B6042" version="0.1">
    <Properties>
    <Name>Andorra City-State</Name>
    <Stability>Alpha</Stability>
    <Teaser>ANDOOOOOOOOOOOOOOOOORRRRRRRAAAAA</Teaser>
    <Description>Adds Andorra City-State to your game.</Description>
    <Authors>You</Authors>
    </Properties>
    
    <Settings>
        <Custom id="ANDORRA_SETTINGS">
        </Custom>  
    </Settings>
    
    <Components>
        <UpdateDatabase id="ANDORRA_UPDATE_DATABASE">
            <Properties>
                <LoadOrder>2000</LoadOrder>
            </Properties>
            <Items>
                <File>Andorra.xml</File>
            </Items>
        </UpdateDatabase>
    </Components>
    
    <Files>
        <File>Andorra.xml</File>
    </Files>
    </Mod>
    
    There 2 more things you need to add to implement icons. If you wish I can reply again with instructions on how to do icons, just let me know.

    Errors:
    • There was no MINOR_CIV_ANDORRA_UNIQUE_INFLUENCE_MOUNTAINS_CULTURE_BONUS attached to the trait.
    • You had two modifiers named MINOR_CIV_ANDORRA_UNIQUE_INFLUENCE_MOUNTAINS_GOLD_BONUS. The first modifier (the long name with the PLAYER_IS_SUZERAIN req) is used to attach a modifier to a player. The Owner of MINOR_CIV_ANDORRA_UNIQUE_INFLUENCE_MOUNTAINS_GOLD_BONUS is Andorra. The Subject of that modifier is each Player. If the Subject meets the SubjectRequirementSet of being the suzerain, then the modifier will attach a modifier to that player (Subject). The modifier being ATTACHED is the 2nd shorter named modifier: MINOR_CIV_ANDORRA_HILLS_GOLD_BONUS. That is defined in the modifier arguments for MINOR_CIV_ANDORRA_UNIQUE_INFLUENCE_MOUNTAINS_GOLD_BONUS.
    • PLAYER_IS_SUZERAIN is a vanilla requirementset. Your game would crash if you tried to run it with it redefined in the requirementsetids tags below. If anything is in the vanilla game, it cannot be redefined. If you want to use only part of a vanilla requirementset, copy it, change the requirementsetid to your own and you can keep whichever requirementids are inside it that you wanted and add your own.
    • TERRAIN_MOUNTAIN is not a valid terrain. Check the Terrains.xml in the base assets gameplay data folder for proper names of all the terrains. Both mountains and hills have a separate type for each terrain they're on. As such the requirementset TERRAIN_IS_MOUNTAIN needs 5 requirementids: REQUIREMENT_TERRAIN_IS_DESERT_MOUNTAIN, REQUIREMENT_TERRAIN_IS_GRASS_MOUNTAIN, etc. Your format for the requirementset was perfect, just the wrong arguments for the requirementid.
    • The modifiertype MODIFIER_PLAYER_ADJUST_PLOT_YIELD only accepts 2 arguments as far as I know: YieldType and Amount. You had an extra argument called TerrainType. You had your bases covered for requiring the plot to be a mountain with the subjectrequirementset TERRAIN_IS_MOUNTAIN. It was not necessary nor possible to define that in the modifier arguments.
    • Your requirementset TERRAIN_IS_MOUNTAIN needed to be changed to the type REQUIREMENTSET_TEST_ANY because any of the 5 mountain types would have satisfied the logical argument of being a mountain. However if there were only 1 terrain called TERRAIN_IS_MOUNTAIN, you would have been correct.
    Here is the corrected Andorra.xml:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <GameInfo>
        <Types>
            <!--CIVILIZATIONS-->
            <Row Type="CIVILIZATION_ANDORRA" Kind="KIND_CIVILIZATION"/>
            <!--LEADERS-->
            <Row Type="LEADER_MINOR_CIV_ANDORRA" Kind="KIND_LEADER"/>
            <!--TRAITS-->
            <Row Type="MINOR_CIV_ANDORRA_TRAIT" Kind="KIND_TRAIT"/>
        </Types>
        <Leaders>
            <Row LeaderType="LEADER_MINOR_CIV_ANDORRA" Name="Andorra" InheritFrom="LEADER_MINOR_CIV_TRADE"/>
        </Leaders>
        <LeaderTraits>
            <Row LeaderType="LEADER_MINOR_CIV_ANDORRA" TraitType="MINOR_CIV_ANDORRA_TRAIT"/>
        </LeaderTraits>
        <Traits>
            <Row TraitType="MINOR_CIV_ANDORRA_TRAIT" Name="Andorra Suzerain Bonus" Description="+1 [ICON_GOLD] and +1 [ICON_CULTURE] for all hill tiles in your Civilization."/>
        </Traits>  
        <TraitModifiers>  
            <Row TraitType="MINOR_CIV_ANDORRA_TRAIT" ModifierId="MINOR_CIV_ANDORRA_UNIQUE_INFLUENCE_HILLS_GOLD_BONUS"/>
            <Row TraitType="MINOR_CIV_ANDORRA_TRAIT" ModifierId="MINOR_CIV_ANDORRA_UNIQUE_INFLUENCE_HILLS_CULTURE_BONUS"/>
        </TraitModifiers>
        <Modifiers>
            <!--ANDORRA-->
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_UNIQUE_INFLUENCE_HILLS_GOLD_BONUS</ModifierId>
                <ModifierType>MODIFIER_ALL_PLAYERS_ATTACH_MODIFIER</ModifierType>
                <SubjectRequirementSetId>PLAYER_IS_SUZERAIN</SubjectRequirementSetId>
            </Row>
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_UNIQUE_INFLUENCE_HILLS_CULTURE_BONUS</ModifierId>
                <ModifierType>MODIFIER_ALL_PLAYERS_ATTACH_MODIFIER</ModifierType>
                <SubjectRequirementSetId>PLAYER_IS_SUZERAIN</SubjectRequirementSetId>
            </Row>
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_HILLS_GOLD_BONUS</ModifierId>
                <ModifierType>MODIFIER_PLAYER_ADJUST_PLOT_YIELD</ModifierType>
                <SubjectRequirementSetId>TERRAIN_IS_HILLS</SubjectRequirementSetId>
            </Row>
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_HILLS_CULTURE_BONUS</ModifierId>
                <ModifierType>MODIFIER_PLAYER_ADJUST_PLOT_YIELD</ModifierType>
                <SubjectRequirementSetId>TERRAIN_IS_HILLS</SubjectRequirementSetId>
            </Row>
        </Modifiers>
        <!-------------------------------------------------------------------------MODIFIER ARGUMENTS------------------------------------------------------------------------->
        <ModifierArguments>
            <!--ANDORRA-->
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_UNIQUE_INFLUENCE_HILLS_CULTURE_BONUS</ModifierId>
                <Name>ModifierId</Name>
                <Value>MINOR_CIV_ANDORRA_HILLS_CULTURE_BONUS</Value>
            </Row>
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_HILLS_CULTURE_BONUS</ModifierId>
                <Name>YieldType</Name>
                <Value>YIELD_CULTURE</Value>
            </Row>
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_HILLS_CULTURE_BONUS</ModifierId>
                <Name>Amount</Name>
                <Value>1</Value>
            </Row>
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_UNIQUE_INFLUENCE_HILLS_GOLD_BONUS</ModifierId>
                <Name>ModifierId</Name>
                <Value>MINOR_CIV_ANDORRA_HILLS_GOLD_BONUS</Value>
            </Row>
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_HILLS_GOLD_BONUS</ModifierId>
                <Name>YieldType</Name>
                <Value>YIELD_GOLD</Value>
            </Row>
            <Row>
                <ModifierId>MINOR_CIV_ANDORRA_HILLS_GOLD_BONUS</ModifierId>
                <Name>Amount</Name>
                <Value>1</Value>
            </Row>
        </ModifierArguments>
        <RequirementSets>
            <Row>
                <RequirementSetId>TERRAIN_IS_HILLS</RequirementSetId>
                <RequirementSetType>REQUIREMENTSET_TEST_ANY</RequirementSetType>
            </Row>
        </RequirementSets>
        <RequirementSetRequirements>
            <Row>
                <RequirementSetId>TERRAIN_IS_HILLS</RequirementSetId>
                <RequirementId>REQUIRES_TERRAIN_IS_DESERT_HILLS</RequirementId>
            </Row>
            <Row>
                <RequirementSetId>TERRAIN_IS_HILLS</RequirementSetId>
                <RequirementId>REQUIRES_TERRAIN_IS_PLAINS_HILLS</RequirementId>
            </Row>
            <Row>
                <RequirementSetId>TERRAIN_IS_HILLS</RequirementSetId>
                <RequirementId>REQUIRES_TERRAIN_IS_GRASS_HILLS</RequirementId>
            </Row>
            <Row>
                <RequirementSetId>TERRAIN_IS_HILLS</RequirementSetId>
                <RequirementId>REQUIRES_TERRAIN_IS_TUNDRA_HILLS</RequirementId>
            </Row>
            <Row>
                <RequirementSetId>TERRAIN_IS_HILLS</RequirementSetId>
                <RequirementId>REQUIRES_TERRAIN_IS_SNOW_HILLS</RequirementId>
            </Row>
        </RequirementSetRequirements>
        <Requirements>
            <Row>
                <RequirementId>REQUIRES_TERRAIN_IS_DESERT_HILLS</RequirementId>
                <RequirementType>REQUIREMENT_PLOT_TERRAIN_TYPE_MATCHES</RequirementType>
            </Row>
            <Row>
                <RequirementId>REQUIRES_TERRAIN_IS_PLAINS_HILLS</RequirementId>
                <RequirementType>REQUIREMENT_PLOT_TERRAIN_TYPE_MATCHES</RequirementType>
            </Row>
            <Row>
                <RequirementId>REQUIRES_TERRAIN_IS_GRASS_HILLS</RequirementId>
                <RequirementType>REQUIREMENT_PLOT_TERRAIN_TYPE_MATCHES</RequirementType>
            </Row>
            <Row>
                <RequirementId>REQUIRES_TERRAIN_IS_TUNDRA_HILLS</RequirementId>
                <RequirementType>REQUIREMENT_PLOT_TERRAIN_TYPE_MATCHES</RequirementType>
            </Row>
            <Row>
                <RequirementId>REQUIRES_TERRAIN_IS_SNOW_HILLS</RequirementId>
                <RequirementType>REQUIREMENT_PLOT_TERRAIN_TYPE_MATCHES</RequirementType>
            </Row>
        </Requirements>
        <RequirementArguments>
            <Row>
                <RequirementId>REQUIRES_TERRAIN_IS_DESERT_HILLS</RequirementId>
                <Name>TerrainType</Name>
                <Value>TERRAIN_DESERT_HILLS</Value>
            </Row>
            <Row>
                <RequirementId>REQUIRES_TERRAIN_IS_PLAINS_HILLS</RequirementId>
                <Name>TerrainType</Name>
                <Value>TERRAIN_PLAINS_HILLS</Value>
            </Row>
            <Row>
                <RequirementId>REQUIRES_TERRAIN_IS_GRASS_HILLS</RequirementId>
                <Name>TerrainType</Name>
                <Value>TERRAIN_GRASS_HILLS</Value>
            </Row>
            <Row>
                <RequirementId>REQUIRES_TERRAIN_IS_TUNDRA_HILLS</RequirementId>
                <Name>TerrainType</Name>
                <Value>TERRAIN_TUNDRA_HILLS</Value>
            </Row>
            <Row>
                <RequirementId>REQUIRES_TERRAIN_IS_SNOW_HILLS</RequirementId>
                <Name>TerrainType</Name>
                <Value>TERRAIN_SNOW_HILLS</Value>
            </Row>
        </RequirementArguments>
        <TypeProperties>
            <Row Type="CIVILIZATION_ANDORRA" Name="CityStateCategory" Value="TRADE"/>
        </TypeProperties>
        <Civilizations>
            <Row CivilizationType="CIVILIZATION_ANDORRA" Name="Andorra" Description="Andorra city-state" Adjective="Andorra" StartingCivilizationLevelType="CIVILIZATION_LEVEL_CITY_STATE" RandomCityNameDepth="1"/>
        </Civilizations>
        <CivilizationLeaders>
            <Row CivilizationType="CIVILIZATION_ANDORRA" LeaderType="LEADER_MINOR_CIV_ANDORRA" CapitalName="Andorra"/>
        </CivilizationLeaders>
        <CityNames>
            <Row CivilizationType="CIVILIZATION_ANDORRA" CityName="Andorra"/>
        </CityNames>
        <PlayerColors>
            <Row>
                <Type>CIVILIZATION_ANDORRA</Type>
                <Usage>Minor</Usage>
                <PrimaryColor>COLOR_PLAYER_CITY_STATE_PRIMARY</PrimaryColor>
                <SecondaryColor>COLOR_PLAYER_CITY_STATE_TRADE_SECONDARY</SecondaryColor>
                <TextColor>COLOR_PLAYER_CITY_STATE_TRADE_SECONDARY</TextColor>      
            </Row>  
        </PlayerColors>
    </GameInfo>
    
    Nice work! These are all pretty small issues. You were on the right track.
     
    Last edited: Apr 5, 2017
  4. Bukest

    Bukest Chieftain

    Joined:
    Mar 28, 2017
    Messages:
    2
    Gender:
    Male
    Thanks a lot for the help!What a pity that it doesn't work with mountains though. And I'd really like to know how to create an icon if you won't mind :)
     
  5. kantorr

    kantorr Chieftain

    Joined:
    Mar 1, 2017
    Messages:
    51
    Because I don't use modbuddy or the asset editor (not necessary for icons) I do everything in notepad++. Making perfect CS icons from scratch requires zero artistic skill. I'll post my entire icon workflow here from finding a reference image on Google to final ingame product, when I get back from work.
     

Share This Page