Adding Religion - Totally Stumped.

Ahhuatl

Chieftain
Joined
Oct 1, 2011
Messages
87
I hoping some Modding Guru out there will come to my rescue on this, as I am clueless as to what I'm doing wrong. I've created a mod to add in a religion, modeling it after the XML files for religion found in GK itself. For the life of me I cannot get my religion to appear as a choice. I have two theories as to what it is wrong:

A - Gods and Kings is hard-coded to only allow a particular number of religions. I tried to test this theory by adding a line to delete a religion, then adding its PortraitIndex number to my own religion. The religion I removed was still there when I tested my mod however, suggesting that either don't know the correct command to delete a religion out (see below) or something is amiss with the Mod's execution.

Code:
<Religions> 
<Delete type="RELIGION_TENGRIISM"/> 
<Row> 
<Type>RELIGION_MEXICAYOTL</Type>
<Description>TXT_KEY_RELIGION_MEXICA</Description>
<Civilopedia>TXT_KEY_RELIGION_MEXICA_PEDIA</Civilopedia>
<EarliestFoundDate>-1</EarliestFoundDate> 
<IconAtlas>MEXICA_ATLAS</IconAtlas> 
<PortraitIndex>9</PortraitIndex> 
<IconString>[ICON_RELIGION_MEXICA]</IconString>
</Row> 
</Religions>

B - The Mod needs to update some database I don't know about. In addition to trying to add another religious choice, I've also tried to add another belief in. I've encountered the exact same problem and concluding that the issue might be a hardcoded limit as well, I tried deleting out a belief to no effect as well. This is my first mod and I'm starting to wonder if I set it up incorrectly and the game isn't even loading the mod. Under project properties I've made GK a prerequisite as well as done the OnModActivated UpdateDatabase for the mod's own XML file.

Code:
<Beliefs> 
<Delete type="BELIEF_DANCE_AURORA"/> 
<Row> <Type>BELIEF_CUALLI_OHTLI</Type>
<Description>TXT_KEY_BELIEF_CUALLI_OHTLI</Description>
<ShortDescription>TXT_KEY_BELIEF__CUALLI_OHTLI_SHORT</ShortDescription>
<Pantheon>true</Pantheon> 
</Row>
</Beliefs>

If its necessary, I'll save all the files and the project in a zip and send it someone else for testing. I'd really appreciate any help you guys can offer.
 
suggesting that either don't know the correct command to delete a religion
Code:
<Religions> 
<Delete type="RELIGION_TENGRIISM"/> 
</Religions>

XML is case sensitive, and it's "Type" not "type" in the <Delete> tag

Also, if that's the sum total of the code you're missing the <GameData> element.

And possibly the OnModActivated->UpdataDatabase stuff

Try downloading one of the G&K religion mods from the Steam Workshop and modifying that, it's probably a better starting point as at least you're know that the original code works

HTH

W
 
XML is case sensitive, and it's "Type" not "type" in the <Delete> tag

Caught that after I posted.

Also, if that's the sum total of the code you're missing the <GameData> element.

Nah, just a snippet. I included the game data tags.

Try downloading one of the G&K religion mods from the Steam Workshop and modifying that, it's probably a better starting point as at least you're know that the original code works

Tried that too - none of the mods worked either.
 
Pastafarianism was the base I used after my first attempt failed; I checked it against Rastafarian, there wasn't any major differences.

Here is the total XML code:

Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 6/19/2012 7:06:56 PM -->
<GameData>
	<IconFontTextures>
		<Row>
			<IconFontTexture>ICON_FONT_TEXTURE_MEXICA</IconFontTexture>
			<IconFontTextureFile>MexicaFontIcons</IconFontTextureFile>
		</Row>
	</IconFontTextures>
	<IconFontMapping>
		<Row>
			<IconName>ICON_RELIGION_MEXICA</IconName>
			<IconMapping>1</IconMapping>
			<IconFontTexture>ICON_FONT_TEXTURE_MEXICA</IconFontTexture>
		</Row>
	</IconFontMapping>
	<IconTextureAtlases>
		<Row>
			<Atlas>MEXICA_ATLAS</Atlas>
			<IconSize>16</IconSize>
			<Filename>MEXICA-16.dds</Filename>
			<IconsPerRow>1</IconsPerRow>
			<IconsPerColumn>1</IconsPerColumn>
		</Row>
		<Row>
			<Atlas>MEXICA_ATLAS</Atlas>
			<IconSize>24</IconSize>
			<Filename>MEXICA-24.dds</Filename>
			<IconsPerRow>1</IconsPerRow>
			<IconsPerColumn>1</IconsPerColumn>
		</Row>
		<Row>
			<Atlas>MEXICA_ATLAS</Atlas>
			<IconSize>32</IconSize>
			<Filename>MEXICA-32.dds</Filename>
			<IconsPerRow>1</IconsPerRow>
			<IconsPerColumn>1</IconsPerColumn>
		</Row>
		<Row>
			<Atlas>MEXICA_ATLAS</Atlas>
			<IconSize>48</IconSize>
			<Filename>MEXICA-48.dds</Filename>
			<IconsPerRow>1</IconsPerRow>
			<IconsPerColumn>1</IconsPerColumn>
		</Row>
		<Row>
			<Atlas>MEXICA_ATLAS</Atlas>
			<IconSize>64</IconSize>
			<Filename>MEXICA-64.dds</Filename>
			<IconsPerRow>1</IconsPerRow>
			<IconsPerColumn>1</IconsPerColumn>
		</Row>
		<Row>
			<Atlas>MEXICA_ATLAS</Atlas>
			<IconSize>80</IconSize>
			<Filename>MEXICA-80.dds</Filename>
			<IconsPerRow>1</IconsPerRow>
			<IconsPerColumn>1</IconsPerColumn>
		</Row>
		<Row>
			<Atlas>MEXICA_ATLAS</Atlas>
			<IconSize>128</IconSize>
			<Filename>MEXICA-128.dds</Filename>
			<IconsPerRow>1</IconsPerRow>
			<IconsPerColumn>1</IconsPerColumn>
		</Row>
	</IconTextureAtlases>
	<Religions>
		<Delete Type="RELIGION_TENGRIISM"/>
		<Row>
			<Type>RELIGION_MEXICAYOTL</Type>
			<Description>TXT_KEY_RELIGION_MEXICA</Description>
			<Civilopedia>TXT_KEY_RELIGION_MEXICA_PEDIA</Civilopedia>
			<EarliestFoundDate>-1</EarliestFoundDate>
			<IconAtlas>MEXICA_ATLAS</IconAtlas>
			<PortraitIndex>9</PortraitIndex>
			<IconString>[ICON_RELIGION_MEXICA]</IconString>
		</Row>
	</Religions>
	<LocalizedText>
		<Row Language="en_US" Tag="TXT_KEY_RELIGION_MEXICA">
			<Text>Mexicayotl</Text>
		</Row>
		<Row Language="en_US" Tag="TXT_KEY_RELIGION_MEXICA_PEDIA">
			<Text>
				Mexicayotl, Nahuatl for Mexicaness, embodies the cosmological and religious worldview of the Aztec Empire.
			</Text>
		</Row>
	</LocalizedText>
	<Beliefs>
		<Delete Type="BELIEF_DANCE_AURORA"/>
		<Row>
			<Type>BELIEF_CUALLI_OHTLI</Type>
			<Description>TXT_KEY_BELIEF_CUALLI_OHTLI</Description>
			<ShortDescription>TXT_KEY_BELIEF__CUALLI_OHTLI_SHORT</ShortDescription>
			<Pantheon>true</Pantheon>
		</Row>
	</Beliefs>
	<LocalizedText>
		<Row Language="en_US" Tag="TXT_KEY_BELIEF_CUALLI_OHTLI">
			<Text>Cualli Ohtli</Text>
		</Row>
		<Row Language="en_US" Tag="TXT_KEY_BELIEF__CUALLI_OHTLI_SHORT">
			<Text>
				+1 Faith for each Incense and Jungle tile.
			</Text>
		</Row>
	</LocalizedText>
	<Belief_ResourceYieldChanges>
		<Row>
			<BeliefType>BELIEF_CUALLI_OHTLI</BeliefType>
			<ImprovementType>RESOURCE_INCENSE</ImprovementType>
			<YieldType>YIELD_FAITH</YieldType>
			<Yield>1</Yield>
		</Row>
	</Belief_ResourceYieldChanges>
	<Belief_TerrainYieldChanges>
		<Row>
			<BeliefType>BELIEF_CUALLI_OHTLI</BeliefType>
			<TerrainType>TERRAIN_JUNGLE</TerrainType>
			<YieldType>YIELD_FAITH</YieldType>
			<Yield>1</Yield>
		</Row>
	</Belief_TerrainYieldChanges>
</GameData>
 
Of course. You could download and install the included build and test it yourself....
 
Splitting the belief section and the religion section into two separate XML files did the trick... Thanks for the help guys, when I get this thing off the ground I'll be sure to thank you all.
 
All right, here is the latest build (attached) and my latest problems. I've got the religion and even two beliefs appearing in the game. However when I try to create a belief that uses a tag that is utilized elsewhere in the game, the belief will not appear. I've tried creating a separate XML file that will add the appropriate columns to the Beliefs table but that didn't work either.

Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 6/21/2012 1:49:38 AM -->
<GameData>
	<!-- Table definition -->
	<Table name="Beliefs">
		<Column name="GoldenAge" type="boolean" default="false"/>
		<Column name="GoldenAgeTurns" type="integer" default="0"/>
		<Column name="GoldenAgeMeterMod" type="integer" default="0"/>
		<Column name="GlobalCultureRateModifier" type="integer" default="0"/>
		<Column name="ExpModifier" type="integer" default="0"/>
	</Table>
</GameData>
 

Attachments

More progress! (Perhaps I'm better at this than I thought?)

After farting around with XML for a few hours I decided to just circumvent it and write an SQL script to add the damn tag columns to the Beliefs table. Sure enough, it worked. Now to my two remaining problems which are probably interrelated:

1 - After you select my religion from the row of choices, the page that you choose your different beliefs on appears. Unfortunately the image is skewed to the upper left corner. On this one I am seriously stumped.

2 - One turn after selecting my religion an error message pops up "cannot load font xml file". I'm not sure why this is. Suggestions would be appreciated.
 
Back
Top Bottom