Problem Swapping Strategic View Textures

jtheis85

Chieftain
Joined
Aug 30, 2011
Messages
6
YET ANOTHER UPDATE: This keeps getting weirder. I decided to just google that error message and see what comes up. It turns out, other people who aren't even modding the game are getting that exact message in their database.log. Sure enough, when I fire up Civ and load a regular vanilla game with no mods, that error is sitting there in the logfile with a freshly run timestamp. It seems that it's just a total coincidence that I picked a test mod that had some pre-existing error. That said, I have no idea now what is wrong with my mod. Does anyone know if doing a swap like this is possible?

ANOTHER UPDATE: OK, I'm still having my problem. Even after including the full contents of the file with no "update" tags, I get the same database error. What gives?

UPDATE: Nevermind, I found my problem. Apparently Civ doesn't deal with all XML files the same way. This kind of XML file doesn't use the "update" syntax, as it doesn't interact with the database. Solution is to add a complete copy of the whole file modified as I need it to be.

I'm trying to do a simple swap of textures in the strategic view, but I'm running into a problem.

I have a file, MODciv5artdefines_sv_terrain.xml. It contains:

Code:
<?xml version="1.0" encoding="utf-8"?>
<SVFeatureArtInfos>
	<Update>
		<Set Asset="MODsv_terrainhexocean.dds"/>
		<Where Type="ART_DEF_TERRAIN_OCEAN"/>		
	</Update>
</SVFeatureArtInfos>

I also have a flat black texture file, MODsv_terrainhexocean.dds. When I load the mod, the texture isn't replaced as I expect. The standard ocean tile is there in the strategic view. (It's worth noting that I do have Reload Strategic View checked in the mod properties).

When I check the database.log file, I find this:

Code:
[1920.871] constraint failed
[1920.871] While executing - 'INSERT INTO ArtDefine_StrategicView(StrategicViewType, TileType, Asset) VALUES(?,?,?)'
[1924.225] Validating Foreign Key Constraints...
[1925.036] Passed Validation.
[1925.395]

I've tried fiddling with a number of things, the .xml tags, the Content tab. Am I supposed to add the .dds file to the content tab? If so, with what settings? I tried "InGameUIAddin" and that didn't seem to do it.

Thanks in advance.
 
The problem is that you're doing it all wrong; if it's not a <GameData> table, you CANNOT use the usual <Update> syntax, and cannot do OnModActivated/UpdateDatabase. For art asset files, you replace the ENTIRE file at once, using the VFS.

That means that if you want to modify, say, the unit member art defines file, you have to copy the entire file over into your mod and then tweak the existing values or add new entries as needed. This makes your mod completely incompatible with any other mods adjusting the same file.

Basically, you have to do one of three things to get a mod to include your file:
1> If it's <GameData> XML or SQL, you use the Update/Row syntax, and activate using OnModActivated/UpdateDatabase.
2> If it's custom-made Lua (i.e., not a modified version of any existing file), you use InGameUIAddin.
3> If it's ANYTHING ELSE, you use VFS. (Note that some files simply ignore VFS. For instance, you can't change the sound definition files to add new sounds; even if you try to load it into VFS, the game explicitly uses the file in its base directory. Ergo, we can't add new sounds.)
 
UPDATE: I was wrong. Using VFS and a simple mod with only the replaced texture (no XML) I was able to change the strategic view tile texture. Making it too complicated I guess.

However, this worries me still. What things are currently considered "unmoddable" by the community? I may need to open a new thread for this question.

----

Very interesting. I believe I tried using the VFS for this and got no noticeable results. Perhaps the strategic view textures are one of those files the game ignores?

If all sounds are "out", and some textures like this are also "out", what else is unmoddable? Or rather, what IS moddable? I'm doing intelligence gathering for a team planning what we hope is a total conversion mod. If enough assets are unmoddable, we may just have to give up.
 
Back
Top Bottom