[GS] Any way to make projects unique to certain civs?

I'm fairly sure JFD's Calvin Coolidge does this. It is at most R&F, although, depending on how it is done, it may be able to be backtracked to Base. I think most of the tables for Projects were built in for Vanilla outside Projects_XP1, which was a simple table and likely unused for that mod.
 
I've subscribed to JFD's Calvin Coolidge mod and looked through the files. It seems he's used this code:

CREATE TABLE IF NOT EXISTS
Project_TraitType (
ProjectType text default null,
TraitType text default null);
INSERT INTO Project_TraitType
(ProjectType, TraitType)
VALUES ('PROJECT_JFD_DEREGULATE_BUSINESSES', 'TRAIT_LEADER_PROJECT_JFD_DEREGULATE_BUSINESSES');

I attempted to use this in my own solution, substituting his project and trait for mine, and giving my leader the right trait. However, it didn't work. All civs are still able to see the projects in the tech tree as unlockables. Is there something I'm missing? Something to make the game read the new table as a new TraitType?
(Of course, full credit is to be given to JFD for the code)
 
I haven't looked at his code lately but I would be willing to bet the new table is being implemented by an lua script.

Unless a table and its row-data is implemented within the core game DLL or implemented by a mod's lua-code, a new table is essentially just inert text in the game's SQL database.
 
Yes it is possible to do as of the Gathering Storm expansion. My latest mod Spheres of Intrigue does this for the Nomadic Asia sphere. It can be done using just SQL. I'll share an example later.
 
Brazil has a unique project. Without GS, the only way to do it without lua seems to be to use a unique district as proxy. With GS, you could also use unique dummy buildings, but there's a much easier solution:

The effect EFFECT_ADD_PLAYER_PROJECT_AVAILABILITY

In the Projects_XP2 table, set UnlocksFromEffect to 1, then create a modifier with the effect above to unlock it and assign it to your civ's unique ability trait.
 
Last edited:
Back
Top Bottom