If for some reason your SQL doesn't seem to work

FredMB

Chieftain
Joined
Oct 28, 2010
Messages
84
Location
Vancouver, Canada
Hello everyone

I was having problems recently with using SQL to increase the number of moves of all units. I was using the following code:

Spoiler :

UPDATE Units
SET Moves=Moves+1
WHERE Moves >= 1;


The SQL was updating the in game units just fine but wouldn't touch the new units I created in a separate XML file.

I was at a loss until I decided to double check the Actions panel in ModBuddy. It turns out the solution was simple.

My SQL file was listed above my XML file. It looks like the actions are performed in the order they are listed. This might have been obvious to most but up until then I didn't pay attention to the order. I deleted the SQL line and re added it at the bottom. That did the trick. The moves were now updated for the in game units and my new units.

Since it took me long enough to figure this one out I thought I'd share.

Cheers.
 
A similar issue with load order applies to working your SQL updates with other mods.

For example if you have the "Queen of Iceni" and "Larger Scale Mod", the new unique units from the former will not have the extra +1 moves from the later. Seems like it's because the game will load the mods based on their folder name, so since "L" comes before "Q", the SQL update from the "Larger Scale Mod" will not have an effect on the new units.

From trying to get them work a while ago I found that simply renaming the folder from "Larger Scale Mod" to "zLarger Scale Mod" will work.

So if you're planning on sharing your mod you might want to add a comment somewhere about this fix.

But then, maybe I missed a way to set the mods' load oder...
 
Back
Top Bottom