107 Prereq Buildings

Thomdar

Chieftain
Joined
Sep 8, 2011
Messages
7
Location
Nanaimo
Update 107 invalidated a portion of a mod I'm currently playing around with. My mod added some entries to Building_PrereqBuildingClasses. It was working with 106 but the prereqs no longer had function and were not showing on the updated Civilopedia screen from UP&VE.

This gave me a reason to work with SQL first time but using that to make entries failed to fix the problem. Searching through 107's files I found VEC - General.sql with an entry of DELETE FROM Building_PrereqBuildingClasses; and removed it. Reloading I found the error was fixed. I then looked at 106's version of the file and it had the same statement but didn't break my mod.

I can see VEC - General.sql was updated with 107 to modify the specialists. I cannot confirm the exact reason additions to Building_PrereqBuildingClasses don't go through using sql or xml with 107. Looking at the .db file I can confirm with the line deleted from VEC - General.sql that Building_PrereqBuildingClasses is in the db. When reinserting the line back in the table is empty in the db.

Further testing while I write this shows that 107 invalidates (xml or sql) additions to prereqs table and 106 invalidates prereqs only when using sql to add to the table. Looking at the db the table is empty with 107 but includes my entries with 106 if xml is used.

For my purposes deleting the offending line from your file works but I'm sure you were attempting to move towards your new table for percentages. My deleting might cause additional errors at this time that I'm not aware of yet.

Probably my best bet would be to find a more compatible way to insert into the table, create a new table for my use (would require much more work to ensure what I'm trying to prevent from being built until the right conditions are met and to ensure that the information is shown somewhat usefully in the Civilopedia entries) or rethink what I'm trying to do.
 
Thanks for bringing this up. :)

The reason you encountered a different problem in each version is load order. If your mod runs after VEM deletes Building_PrereqBuildingClasses, VEM removes only vanilla entries. If your mod runs before VEM, it deletes your mod's work, which obviously is a problem. Load order is determined by the order in which mods are installed, so installing VEM v107 made it load after your mod.

I'll fix this with a sql statement adding a "100" entry in Building_PrereqBuildingClassesPercentage for each "-1" entry removed from Building_PrereqBuildingClasses. Currently step #1 is hardcoded and doesn't read the values in step #2. This should hopefully make it compatible with your mod.

If you'd like to explore things further, the information in this file might be helpful:
CiVUP - Civ V Unofficial Patch/Core/Compatibility.txt
 
Back
Top Bottom