Adding New CS to the Game

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
 
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?
 
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).
 
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.
 
Thanks for this, but a quick question.

<FlavorType>FLAVOR_[ENTERACCORDINGTOYOURCSTRAIT]</FlavorType>

Are the flavors we choose from stuff like hostile/irrational/etc or maritime/religious/etc?
 
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?
 
I got the mod to work, but Goldenrod City's name is instead TXT_KEY_CITYSTATE_GOLDENROD_CITY. How do I fix this problem?
 
I got the mod to work, but Goldenrod City's name is instead TXT_KEY_CITYSTATE_GOLDENROD_CITY. How do I fix this problem?
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.
 

Attachments

  • Civ5SimpleCityState.zip
    6.9 KB · Views: 205
How would you go about importing a custom city state into a map using World Builder?
 
How would you go about importing a custom city state into a map using World Builder?

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).
 
I have a question about city-state personalities

As in Friendly, Neutral, Hostile or Irrational? Those are allocated randomly within the C++ DLL source code
 
Top Bottom