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

Adding New CS to the Game

Discussion in 'Civ5 - Modding Tutorials & Reference' started by Genghis.Khan, Nov 1, 2012.

  1. Genghis.Khan

    Genghis.Khan Person

    Joined:
    Jun 9, 2012
    Messages:
    934
    Location:
    Somewhere
    I noticed while working in my Rise of Rome Scenario that creating New CS is really easy.

    Here´s the code

    Code:
    <GameData>
    <MinorCivilizations>
    <Row>
    		<Type>MINOR_CIV_[ENTERYOURCSNAMEHERE]</Type>
    		<Description>TXT_KEY_CITYSTATE_[ENTERYOURCSNAMEHERE]</Description>
    		<ShortDescription>TXT_KEY_CITYSTATE_[ENTERYOURCSNAMEHERE]</ShortDescription>
    		<Adjective>TXT_KEY_CITYSTATE_[ENTERYOURCSNAMEHERE]</Adjective>
    		<Civilopedia>TXT_KEY_CIV5_[ENTERYOURCSNAMEHERE]_TEXT</Civilopedia>
    		<DefaultPlayerColor>PLAYERCOLOR_MINOR_GRAY</DefaultPlayerColor>
    		<ArtDefineTag>ART_DEF_CIVILIZATION_MINOR</ArtDefineTag>
    		<ArtStyleType>ARTSTYLE_EUROPEAN</ArtStyleType>
    		<ArtStyleSuffix>_EURO</ArtStyleSuffix>
    		<ArtStylePrefix>EUROPEAN </ArtStylePrefix>
    		<MinorCivTrait>MINOR_TRAIT_[MILITARISTIC/RELIGIOUS/MERCANTILE/MARITIME/RELIGIOUS]</MinorCivTrait>
    	</Row>
            <Row>
    			<MinorCivType>MINOR_CIV_[ENTERYOURCSNAMEHERE]</MinorCivType>
    			<CityName>TXT_KEY_CITYSTATE_[ENTERYOURCSNAMEHERE]</CityName>
            </Row>
    </MinorCivilizations>
            <MinorCivilization_Flavors>
    		<Row>
    			<MinorCivType>MINOR_CIV_[ENTERYOURCSNAMEHERE]</MinorCivType>
    			<FlavorType>FLAVOR_EXPANSION</FlavorType>
    			<Flavor>0</Flavor>
    		</Row>
    		<Row>
    			<MinorCivType>MINOR_CIV_[ENTERYOURCSNAMEHERE]</MinorCivType>
    			<FlavorType>FLAVOR_NUKE</FlavorType>
    			<Flavor>0</Flavor>
    		</Row>
    		<Row>
    			<MinorCivType>MINOR_CIV_[ENTERYOURCSNAMEHERE]</MinorCivType>
    			<FlavorType>FLAVOR_WONDER</FlavorType>
    			<Flavor>0</Flavor>
    		</Row>
    		<Row>
    			<MinorCivType>MINOR_CIV_[ENTERYOURCSNAMEHERE]</MinorCivType>
    			<FlavorType>FLAVOR_CITY_DEFENSE</FlavorType>
    			<Flavor>5</Flavor>
    		</Row>
    		<Row>
    			<MinorCivType>MINOR_CIV_[ENTERYOURCSNAMEHERE]</MinorCivType>
    			<FlavorType>FLAVOR_[ENTERACCORDINGTOYOURCSTRAIT]</FlavorType>
    			<Flavor>10</Flavor>
    		</Row>
    </MinorCivilization_Flavors>
    	<Language_en_US>
    		<Row Tag="TXT_KEY_CITYSTATE_SALONA">
    			<Text></Text>
    		</Row>
    		<Row Tag="TXT_KEY_CITYSTATE_[ENTERYOURCSNAMEHERE]_ADJ">
    			<Text></Text>
    		</Row>
    <Row Tag="TXT_KEY_CIV5_[ENTERYOURCSNAMEHERE]_TEXT">
    			<Text></Text>
    		</Row>
    <Row Tag="TXT_KEY_CITYSTATE_[ENTERYOURCSNAMEHERE]_TEXT">
    			<Text></Text>
    		</Row>
    </Language_en_US>
    </GameData>

    Updated
     
  2. UltraRobPrime

    UltraRobPrime Chieftain

    Joined:
    Nov 24, 2012
    Messages:
    57
    I am having trouble getting the mod to work. I've coded eight new CS to the CIV5MinorCivilizations.xml and renamed it for my mod(the original xml is unchanged; I just copied the file and changed it). When I load the mod from the custom game menu, all I get is the background image of the mod menu and the menu music of Civ 5.

    How do I fix this?
     
  3. PawelS

    PawelS Ancient Druid

    Joined:
    Dec 11, 2003
    Messages:
    2,803
    Location:
    Poland
    Civ5 modding is not like Civ4 modding. You can't edit an existing XML file by adding new things and put it in a mod. Your XML file should contain only the new things (new CS in this case), also it shouldn't contain the table definitions (unless you want to add a new table).
     
  4. Genghis.Khan

    Genghis.Khan Person

    Joined:
    Jun 9, 2012
    Messages:
    934
    Location:
    Somewhere
  5. FramedArchitect

    FramedArchitect Reluctant Modder

    Joined:
    Mar 25, 2012
    Messages:
    798
    Location:
    Missouri
    Just a quick note on the above xml.... there are a few embedded tables there so the code will not work as pasted up.

    Also, I always include the <MinorCivilization_Flavors> table, which allows Major AIs to better assess the value of a minor's friendship.
     
  6. PawelS

    PawelS Ancient Druid

    Joined:
    Dec 11, 2003
    Messages:
    2,803
    Location:
    Poland
    Yes, Language_en_US is inside MinorCivilizations, this probably won't work (haven't noticed it earlier). I think MinorCivilization_Flavors affects things like production and research decisions of a CS, not the attitude of majors towards it, but I haven't checked it in the DLL code, so I'm not sure which version is true.

    Also, you will need to add an entry to MinorCivilization_CityNames.
     
  7. Genghis.Khan

    Genghis.Khan Person

    Joined:
    Jun 9, 2012
    Messages:
    934
    Location:
    Somewhere
  8. Genghis.Khan

    Genghis.Khan Person

    Joined:
    Jun 9, 2012
    Messages:
    934
    Location:
    Somewhere
  9. InsanelyApple

    InsanelyApple Prince

    Joined:
    Sep 9, 2012
    Messages:
    520
    Thanks for this, but a quick question.

    Are the flavors we choose from stuff like hostile/irrational/etc or maritime/religious/etc?
     
  10. Genghis.Khan

    Genghis.Khan Person

    Joined:
    Jun 9, 2012
    Messages:
    934
    Location:
    Somewhere
  11. UltraRobPrime

    UltraRobPrime Chieftain

    Joined:
    Nov 24, 2012
    Messages:
    57
    My mod, Goldenrod City Test, shows up in my mod menu in game. When I start a game in the MOD menu, the new CS does not show up. Here is my code:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <GameData>
    	<MinorCivilizations>
    		<Row>
    			<Type>MINOR_CIV_GOLDENROD_CITY</Type>
    			<Description>TXT_KEY_CITYSTATE_GOLDENROD_CITY</Description>
    			<ShortDescription>TXT_KEY_CITYSTATE_GOLDENROD_CITY</ShortDescription>
    			<Adjective>TXT_KEY_CITYSTATE_GOLDENROD_CITY</Adjective>
    			<Civilopedia>TXT_KEY_CIV5_GOLDENROD_CITY_TEXT</Civilopedia>
    			<DefaultPlayerColor>PLAYERCOLOR_MINOR_GOLDENROD</DefaultPlayerColor>
    			<ArtDefineTag>ART_DEF_CIVILIZATION_MINOR</ArtDefineTag>
    			<ArtStyleType>ARTSTYLE_EUROPEAN</ArtStyleType>
    			<ArtStyleSuffix>_EURO</ArtStyleSuffix>
    			<ArtStylePrefix>EUROPEAN </ArtStylePrefix>
    			<MinorCivTrait>MINOR_TRAIT_MERCANTILE</MinorCivTrait>
    		</Row>
    		<Row>
    			<MinorCivType>MINOR_CIV_GOLDENROD_CITY</MinorCivType>
    			<CityName>TXT_KEY_CITYSTATE_GOLDENROD_CITY</CityName>
    		</Row>
    		<MinorCivilization_Flavors>
    			<Row>
    				<MinorCivType>MINOR_CIV_GOLDENROD_</MinorCivType>
    				<FlavorType>FLAVOR_EXPANSION</FlavorType>
    				<Flavor>0</Flavor>
    			</Row>
    			<Row>
    				<MinorCivType>MINOR_CIV_GOLDENROD_CITY</MinorCivType>
    				<FlavorType>FLAVOR_NUKE</FlavorType>
    				<Flavor>0</Flavor>
    			</Row>
    			<Row>
    				<MinorCivType>MINOR_CIV_GOLDENROD_CITY</MinorCivType>
    				<FlavorType>FLAVOR_WONDER</FlavorType>
    				<Flavor>0</Flavor>
    			</Row>
    			<Row>
    				<MinorCivType>MINOR_CIV_GOLDENROD_CITY</MinorCivType>
    				<FlavorType>FLAVOR_CITY_DEFENSE</FlavorType>
    				<Flavor>5</Flavor>
    			</Row>
    			<Row>
    				<MinorCivType>MINOR_CIV_GOLDENROD_CITY</MinorCivType>
    				<FlavorType>FLAVOR_GOLD</FlavorType>
    				<Flavor>10</Flavor>
    			</Row>
    		</MinorCivilization_Flavors>
    	</MinorCivilizations>
    	<Language_en_US>
    		<Row Tag="TXT_KEY_CITYSTATE_SALONA">
    			<Text></Text>
    		</Row>
    		<Row Tag="TXT_KEY_CITYSTATE_GOLDENROD_CITY_ADJ">
    			<Text></Text>
    		</Row>
    		<Row Tag="TXT_KEY_CIV5_GOLDENROD_CITY_TEXT">
    			<Text></Text>
    		</Row>
    		<Row Tag="TXT_KEY_CITYSTATE_GOLDENROD_CITY_TEXT">
    			<Text></Text>
    		</Row>
    	</Language_en_US>
    </GameData>

    My actions are the following:

    OnModActivated
    UpdateDatabase-GOLDENRODCITY.xml

    How do I make this mod work?
     
  12. FramedArchitect

    FramedArchitect Reluctant Modder

    Joined:
    Mar 25, 2012
    Messages:
    798
    Location:
    Missouri
  13. UltraRobPrime

    UltraRobPrime Chieftain

    Joined:
    Nov 24, 2012
    Messages:
    57
    I got the mod to work, but Goldenrod City's name is instead TXT_KEY_CITYSTATE_GOLDENROD_CITY. How do I fix this problem?
     
  14. pokeravi

    pokeravi Warlord

    Joined:
    Aug 13, 2002
    Messages:
    234
    Location:
    Jersey City, NJ
    How would I edit an existing CS in the game? I don't want to add any for the scenario I'm making.
     
  15. Genghis.Khan

    Genghis.Khan Person

    Joined:
    Jun 9, 2012
    Messages:
    934
    Location:
    Somewhere
  16. Plastrader

    Plastrader Chieftain

    Joined:
    Nov 10, 2011
    Messages:
    15
    I dunno if you have got this to work seeing its been a while.
    But maybe it'll help others.

    The reason to this happening is that you haven't defined the text.

    I was to edit the code provided here, but I had to rewrite it so...

    Attached to this post you'll find an example City State (ModBuddy project)*
    If needed I could rewrite it to be the Goldenrod City.




    *Not sure how much I should pack so the .zip contains the solution file.
     

    Attached Files:

  17. MattKan

    MattKan Chieftain

    Joined:
    Jan 31, 2013
    Messages:
    8
    How would you go about importing a custom city state into a map using World Builder?
     
  18. FramedArchitect

    FramedArchitect Reluctant Modder

    Joined:
    Mar 25, 2012
    Messages:
    798
    Location:
    Missouri
    1. Open the map you want to place the new CS on with World Builder.
    2. Load the mod that includes the new city state (this can be done in World Builder under the "Change Mods" top menu option).
    3. Open the Scenario Editor from top menu option, then click on the City States tab.
    4. Use the '+' Button to add a new CS then to the right in the Civilization drop down menu choose the name of the new CS you want to add to the map. Close the Scenario Editor.
    5. Place the CS on the map with Map Editor Tools --> Cities Tab --> Create (Choose the name of the new CS).
     
  19. chrissifniotis

    chrissifniotis GoogleCiv 2.0.0 coming...

    Joined:
    Mar 21, 2009
    Messages:
    639
    Location:
    Sydney, Australia
    I have a question about city-state personalities; in which XML can I find them? I've looking through all the files I believe they should be in and came up with nothing.
     
  20. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,426
    Location:
    Near Portsmouth, UK
    As in Friendly, Neutral, Hostile or Irrational? Those are allocated randomly within the C++ DLL source code
     

Share This Page