Changes Not Taking Effect

Sethanic

Chieftain
Joined
Oct 27, 2014
Messages
4
I'm currently trying to add a new civilization and a new covert operation. So far no changes have showed up in game. This is my second time modding a Civ game. Any simplistic mistakes I could have made would be welcomed.
The Solution says there are no problems. Any ideas?
 
There's a lot of places you might have screwed something up. Are your XML and/or SQL files set to OnModActivated > UpdateDatabase in the mod's properties? Are there any errors reported in Database.log?

So we don't have to guess, just zip up your built mod from your MODS folder and then attach it to a post (i.e., click the Go Advanced, then click Manage Attachments).
 
OK, let's take a look at your database.log. When the game finds an error in a file, it immediately stops trying to process the rest of the file, so there may be more errors, but we can see 2 so far; one in CivBECovertOperations.xml and another in CivBEGameTextInfos_CovertOperations.xml.

The first says "table CovertOperations already exists." In other words, you just copied the file from the base game and made your changes, without removing the table definition. We can't define it twice.

The second says "UNIQUE constraint failed." That means you're trying to add an entry to the database twice where the database has been set to not allow that. In this case, you can't have multiple Text entries for a single Tag in the localization database. Again, you just copied the file from the base game and made your changes.

You only want to deal with the things that have changed. If an entry already exists, use the Update syntax rather than adding a new row. See this cheat sheet. It gives you 2 ways to accomplish it in XML, and another in SQL.
 
Thanks for the information so far, but clarification would be welcomed. So the first part would be written as such from my understanding.

Essentially an <Update></Update> and a <Where></Where>. The cheat sheet also mentioned <Set> which I have no idea how to incorporate into this.
Code:
<GameData>
	<Language_en_US>
		<Update>
			<Where Type="BOOK_THEFT"/>
			<!-- Book Theft -->
			<Row Tag="TXT_KEY_COVERT_OPERATION_BOOK_THEFT_DESCRIPTION">
				<Text>Book [ICON_CULTURE] Theft</Text>
			</Row>
			<Row Tag="TXT_KEY_COVERT_OPERATION_BOOK_THEFT_DESCRIPTION_TT">
				<Text>Steal {1_NumCulture} [ICON_CULTURE] Culture from the city. </Text>
			</Row>
			<!-- Succeeded -->
			<Row Tag="TXT_KEY_BOOK_THEFT_COVERT_OP_SUCCEEDED_UNDETECTED_SUMMARY">
				<Text>[ICON_CULTURE] Books Stolen (Agent Undetected)</Text>
			</Row>
			<Row Tag="TXT_KEY_BOOK_THEFT_COVERT_OP_SUCCEEDED_UNDETECTED_MESSAGE">
				<Text>Our agent stole {1_Culture} [ICON_CULTURE] Culture from {2_CityName} and was undetected.</Text>
			</Row>
			<Row Tag="TXT_KEY_BOOK_THEFT_COVERT_OP_SUCCEEDED_DETECTED_SUMMARY">
				<Text>[ICON_CULTURE] Books Stolen (Agent Detected)</Text>
			</Row>
			<Row Tag="TXT_KEY_BOOK_THEFT_COVERT_OP_SUCCEEDED_DETECTED_MESSAGE">
				<Text>Our agent stole {1_Culture} [ICON_CULTURE] Culture from {2_CityName} but was detected.</Text>
			</Row>
			<Row Tag="TXT_KEY_BOOK_THEFT_COVERT_OP_SUCCEEDED_IDENTIFIED_SUMMARY">
				<Text>[ICON_ENERGY] Books Stolen (Agent Identified)</Text>
			</Row>
			<Row Tag="TXT_KEY_BOOK_THEFT_COVERT_OP_SUCCEEDED_IDENTIFIED_MESSAGE">
				<Text>Our agent stole {1_Culture} [ICON_CULTURE] Culture from {2_CityName} but was identified. The agent escaped!</Text>
			</Row>
			<Row Tag="TXT_KEY_BOOK_THEFT_COVERT_OP_SUCCEEDED_KILLED_SUMMARY">
				<Text>[ICON_ENERGY] Books Stolen (Agent Killed)</Text>
			</Row>
			<Row Tag="TXT_KEY_BOOK_THEFT_COVERT_OP_SUCCEEDED_KILLED_MESSAGE">
				<Text>Our agent stole {1_Culture} [ICON_CULTURE] Culture from {2_CityName} but was killed!</Text>
			</Row>
			<!-- Failed -->
			<Row Tag="TXT_KEY_BOOK_THEFT_COVERT_OP_FAILED_UNDETECTED_SUMMARY">
				<Text>Failed Book [ICON_CULTURE] Theft (Agent Undetected)</Text>
			</Row>
			<Row Tag="TXT_KEY_BOOK_THEFT_COVERT_OP_FAILED_UNDETECTED_MESSAGE">
				<Text>Our agent failed to reach any [ICON_CULTURE] library in {1_CityName} but was undetected.</Text>
			</Row>
			<Row Tag="TXT_KEY_BOOK_THEFT_COVERT_OP_FAILED_DETECTED_SUMMARY">
				<Text>Failed Book [ICON_CULTURE] Theft (Agent Detected)</Text>
			</Row>
			<Row Tag="TXT_KEY_BOOK_THEFT_COVERT_OP_FAILED_DETECTED_MESSAGE">
				<Text>Our agent failed to steal any [ICON_CULTURE] books from {1_CityName}'s local library and was detected.</Text>
			</Row>
			<Row Tag="TXT_KEY_BOOK_THEFT_COVERT_OP_FAILED_IDENTIFIED_SUMMARY">
				<Text>Failed Book [ICON_CULTURE] Theft (Agent Identified)</Text>
			</Row>
			<Row Tag="TXT_KEY_BOOK_THEFT_COVERT_OP_FAILED_IDENTIFIED_MESSAGE">
				<Text>Our agent failed to steal any [ICON_CULTURE] books from {1_CityName} and was identified. The agent escaped!</Text>
			</Row>
			<Row Tag="TXT_KEY_BOOK_THEFT_COVERT_OP_FAILED_KILLED_SUMMARY">
				<Text>Failed Book [ICON_CULTURE] Theft (Agent Killed)</Text>
			</Row>
			<Row Tag="TXT_KEY_BOOK_THEFT_COVERT_OP_FAILED_KILLED_MESSAGE">
				<Text>Our agent failed to read any [ICON_CULTURE] books from {1_CityName} and was killed!</Text>
			</Row>
			<!-- Aborted -->
			<Row Tag="TXT_KEY_BOOK_THEFT_COVERT_OP_ABORTED_SUMMARY">
				<Text>Book [ICON_CULTURE] Theft Aborted</Text>
			</Row>
			<Row Tag="TXT_KEY_BOOK_THEFT_COVERT_OP_ABORTED_MESSAGE">
				<Text>Stealing [ICON_CULTURE] Books operation was aborted.</Text>
			</Row>
		</Update>
	</Language_en_US>
</GameData>
 
No. <Row> means "Insert a new row." Read the cheat sheet again.

When you post code here, use [ CODE ] [/ CODE ] tags (without the extra spaces). You can use [ SPOILER ][ CODE ] [/ SPOILER ][/ CODE] to additionally put it in a spoiler.

I don't know where you got "Type." There's no type in this table.

Assuming the tag already exists, and you want to change the Text, you'd use:
Code:
    <Language_en_US>
        <Update>
            <Where Tag="TXT_KEY_COVERT_OPERATION_BOOK_THEFT_DESCRIPTION" />
            <Set>
                <Text>Book [ICON_CULTURE] Theft</Text>
            </Set>
        </Update>
        <Update>
            <Where... etc.

Note I mixed the 2 syntaxes. You could use <Set Text="Book [ICON_CULTURE] Theft" /> instead of the <Set>...</Set>, but then it would have caused problems if you used any apostrophes.
 
Back
Top Bottom