UpdateDatabase Not Working?

Civgeek

Warlord
Joined
Jul 1, 2004
Messages
237
Location
Canada
I'm wondering if anybody can give some insight in to what might cause the OnModActivated - UpdateDatabase - xxxxx to fail. I created a very simple XML mod (couple of changes to simple values) and did a successful build. The appropriate files are created in the My Games\Civ5\MODS folder and the mod shows as installed in the in-game Mod menu, but the database is not being updated. At first I thought it must be something in my mod itself and spent a lot of time making sure my changes and my "Actions" were correct, but the same thing occurs with downloaded mods such as Queen of the Iceni; the mod will show as installed, the proper files are all in the MOD folder in the right tree locations, but starting a game - from the in-game MOD menu - with the mod enabled doesn't implement the mod. For example I can't play as Celts. Checking the SQL directly in the database with the Firefox SQLite Manager after trying to play the mod I can see none of the changes have been implemented (for example no Celts).

Any suggetsions how to debug this problem? (Win 7 OS if that matters.) Is there a manual way to force the database cache to be flushed and rebuilt?
 
usually it's a very easy to be overlooked syntax error that's doing this.

you can try to just load up a very bare bones modification, a one line sql update for example, with the updatedatabase of course, and then load up "Civ5DebugDatabase.db" in your browser to make sure the changes are in there.

if a full proof mod isnt reflected in there, then its some weird problem you got :confused:

otherwise it's probably some missing < > / \ or something like that
 
usually it's a very easy to be overlooked syntax error that's doing this.

you can try to just load up a very bare bones modification, a one line sql update for example, with the updatedatabase of course, and then load up "Civ5DebugDatabase.db" in your browser to make sure the changes are in there.

if a full proof mod isnt reflected in there, then its some weird problem you got :confused:

otherwise it's probably some missing < > / \ or something like that

I thought syntax as well, but can't see any issues despite a character-by-character check. The changes are very simple (just learning the tool), like change grassland yiield to 5 etc. so not a lot of XML to miscode.
 
Do you mind posting, for example, the grassland yield change? It could just be something you're overlooking because you're new to modding. That's what I did at first anyway!
 
Do you mind posting, for example, the grassland yield change? It could just be something you're overlooking because you're new to modding. That's what I did at first anyway!

I've tried several simple changes, including several cut and pasted from the guide. I'm trying again right now using a tech cost change as follows:

Code:
<GameData>
  <!-- TODO: Insert table creation example here. -->
 
  <!-- TODO: Insert table data example here.-->
  
  <!-- Enter your Game Data here. -->
	<Technologies>
		<Update>
			<Where Type="TECH_POTTERY" />
			<Set>
				<cost>3500</cost>
			</Set>

		</Update>
	</Technologies>
</GameData>
I can verify the mod is getting added to the mod database with the proper action (by checking the Civ5ModsDatabase.db with the SQLite Manager), but the Civ5CoreDatabase.db file doesn't get rebuilt when the mod is loaded.
 
Somebody else used the same example in another thread. Or was that you?

Anyway, that code should work fine so the problem is in the OnModActivated UpdateDatabase part. Do you have the path to the file correct? In the other thread the guy was using

XML\filename.xml instead of
XML/filename.xml

Which I suspect was the problem. So check the path and for any typos in the other columns. It took me way longer that it should have to find a problem yesterday. The problem? I typed "OnModActvated" instead of "OnModActivated".
 
For what it is worth I know the code works 'cause I just posted it into a test.xml file in ModBuddy, slapped the OnModActvated UpdateDatabase stuff in, and the new tech price was correctly integrated into the game. So I even more strongly suspect a typo or path problem in the mod actions screen.
 
For what it is worth I know the code works 'cause I just posted it into a test.xml file in ModBuddy, slapped the OnModActvated UpdateDatabase stuff in, and the new tech price was correctly integrated into the game. So I even more strongly suspect a typo or path problem in the mod actions screen.

Well I've tried both '\' and '/' options and no joy.
 
Somebody else used the same example in another thread. Or was that you?

Anyway, that code should work fine so the problem is in the OnModActivated UpdateDatabase part. Do you have the path to the file correct? In the other thread the guy was using

XML\filename.xml instead of
XML/filename.xml

Which I suspect was the problem. So check the path and for any typos in the other columns. It took me way longer that it should have to find a problem yesterday. The problem? I typed "OnModActvated" instead of "OnModActivated".

Perhaps this was the problem (and my old eyes just didn't see it). Moving the file to the root of the project (so there's no "XML/" in the file field of UpdateDatabase) makes the change in the game.

Thanks for the input!
 
Back
Top Bottom