Mods conditional on Ruleset used

Arstahd

Chieftain
Joined
Apr 20, 2006
Messages
85
I've just recently purchased the expansions and have begun work on updating my mods to be compatible. How do I set parts of a mod to only be enabled if a particular ruleset is in effect?

For example, my Civics mod will need to change the prereqs of the newly added GS civics, but only if I'm using GS rules. Is there a way to only insert those changes if GS is used?
 
OK, I managed to cobble together something that works.

My mod reorganizes the Civics tree so it started by wiping out all CivicPrereqs. I then assigned new prereqs to all vanilla Civics. This works fine until I run GS rules where the newly added Civics now have no prereqs. I couldn't just add prereqs for those Civics because they won't exist in Vanilla or R&F causing undefined target errors. I figured out how to only insert those prereqs if the Civic exists first.

Using the following SQL code for each GS Civic prereq:
Code:
INSERT INTO CivicPrereqs (Civic, PrereqCivic) SELECT 'CIVIC_ENVIRONMENTALISM', 'CIVIC_RAPID_DEPLOYMENT' WHERE EXISTS (SELECT 1 FROM Civics WHERE CivicType = 'CIVIC_ENVIRONMENTALISM');
This performs the INSERT but only after checking for the target Civic with the WHERE EXISTS bit.
 
Top Bottom