Having my mod load images

GildedDuke

Chieftain
Joined
Jul 3, 2012
Messages
26
I've been following Kael's modding guide, and I'm trying to add .dds files to my mod for the icon atlas, the map, and the Dawn of Man image. I have all the dds files copied into an art folder in the modding file structure. All of the dds files seem to be formatted correctly.

When I try to do something like

<Update>
<Set MapImage="Nuke2.dds"/>
<Where Type ="CIVILIZATION_IROQUOIS"/>
</Update>

It says that it cannot load Nuke2.dds

However if I include the full file path like this:

<Update>
<Set MapImage="C:\Users\kevib\Documents\Firaxis ModBuddy\TheEternalWar\TheEternalWar\Art\Nuke2.dds"/>
<Where Type ="CIVILIZATION_AMERICA"/>
</Update>
It loads up just fine. My worry is that the links will all break when I upload the map, as not everybody is going to have the same directory structure. Am I missing something about adding the image files? Should I worry about the file structure breaking upon upload?
 
Kael's guide is outdated, some things have changed since it was published.

In ModBuddy, there is a file properties window (normally it's the right side of the screen below "solution explorer"). Select your image file, and in the properties window set "Import into VFS" to true. Then you'll be able to use your image without specifying path.
 
Now I notice that this seems to be an option on all files, including map and xml files. Should they all be set to true to be included with the uploaded mod?
 
No, it shouldn't be set to true for XML and SQL files that update the database, and for LUA files that are used as "UI addins". It should be set to true for maps, art files, and all files that replace the original ones.
 
It should be set to true for maps, art files, and all files that replace the original ones.

Also, any Lua files that are intended to be included by other files (utility routines and such).

Basically, there are three ways to load something:
> OnModActivated/UpdateDatabase for gamedata XML and SQL
> InGameUIAddin or one of its counterparts, for executable Lua (anything with Event or GameEvent listeners inside it)
> "Import into VFS = true" for everything else

If you accidentally turn VFS on for a gamedata XML it won't usually cause any issues, but if you put VFS on for any Lua you've also loaded through an addin declaration then it'll screw things up badly. (It'll execute the functions twice, but the second time some of its arguments will be nulls.)
 
Back
Top Bottom