LeeS
Imperator
You can do it all entirely within your mod via SQL by making a reference to 3rd/4th UC in your mod, so that 3rd/4th US loads 1st, and then within your SQL using something that is unique to 3rd/4th UC to control whether your mod's info is left intact or removed from the Database.
So your procedure within your mod's XML/SQL files is:
So your procedure within your mod's XML/SQL files is:
- In either SQL or XML, add the new units, improvements, buildings for compatibility with 3rd/4th uniques mod.
- Add an SQL file to the mod, and make sure its 'OnModActivated' is lower down the list of stuff your mod has than the code mentioned in step #1. The SQL code of this file then deletes back out of the game's database the unwanted units, buildings, or improvements if 3rd/4th uniques is not active.
You need to find one 'thing' that is completely unique to 3rd UC to control your SQL 'Delete'. Here is an example where I am deleting a building if Enlightenment Era is not active (ie, there is no 'ERA_ENLIGHTENMENT' in the game's Eras table):Code:DELETE FROM Buildings WHERE Type = 'BUILDING_LRS_SCIENCE_EE_MARKER' AND NOT EXISTS (SELECT 1 FROM Eras WHERE Type = 'ERA_ENLIGHTENMENT');
The trick may be in finding something from 3rd UC to 'hang' your SQL delete on - Add a stand-alone xml file and make it the very last thing in your mod that loads into the game's database. If your component is a Building, you then add this code to that final 'clean-up' file:
Code:
<GameData> <DeleteMissingReferences table="Buildings" column="Type"/> </GameData>