isau
Deity
- Joined
- Jan 15, 2007
- Messages
- 3,071
This is pretty useful IMO.
There is a new table in Gathering Storm called Projects_XP2. One of the fields is called UnlocksFromEffect. If set to 1, this field will prevent players from building the project until you manually trigger the effect from a Modifier.
Now, the only existing ModifierType Firaxis thought to include in the DynamicModifiers table is MODIFIER_EMERGENCY_PLAYERS_MAKE_PROJECT_AVAILABLE. This Modifier is intended exclusively for use with Emergencies. However, you can do an Insert into DynamicModifiers to change the CollectionType to something else, and now you have the ability to control access to the Project.
I pasted an example below. This code makes a Project available only to civs that have a certain Trait.
I can think of many, many uses for this feature. It's just too bad Firaxis didn't include a UnlocksFromEffect option for Civics, Technologies, and Buildings too, or we'd really be cooking.
There is a new table in Gathering Storm called Projects_XP2. One of the fields is called UnlocksFromEffect. If set to 1, this field will prevent players from building the project until you manually trigger the effect from a Modifier.
Now, the only existing ModifierType Firaxis thought to include in the DynamicModifiers table is MODIFIER_EMERGENCY_PLAYERS_MAKE_PROJECT_AVAILABLE. This Modifier is intended exclusively for use with Emergencies. However, you can do an Insert into DynamicModifiers to change the CollectionType to something else, and now you have the ability to control access to the Project.
I pasted an example below. This code makes a Project available only to civs that have a certain Trait.
I can think of many, many uses for this feature. It's just too bad Firaxis didn't include a UnlocksFromEffect option for Civics, Technologies, and Buildings too, or we'd really be cooking.
Code:
INSERT INTO Types
(Type, Kind)
VALUES ('QUO_PROJECT_BIOME_ASIAN_EXPANSE_THIS_SPHERE_ONLY', 'KIND_PROJECT') ;
INSERT INTO Projects
(ProjectType, Name, ShortName, Description, Cost, PrereqTech, MaxPlayerInstances, PrereqDistrict)
VALUES ('QUO_PROJECT_BIOME_ASIAN_EXPANSE_THIS_SPHERE_ONLY', 'QUO_PROJECT_BIOME_ASIAN_EXPANSE_THIS_SPHERE_ONLY_NAME', 'QUO_PROJECT_BIOME_ASIAN_EXPANSE_THIS_SPHERE_ONLY_SHORT_NAME', 'QUO_PROJECT_BIOME_ASIAN_EXPANSE_THIS_SPHERE_ONLY_DESCRIPTION', 40, NULL, 1, 'DISTRICT_CITY_CENTER');
-- this new table in expansion 2 lets us limit the project so it is only enabled once we activate an effect
INSERT INTO Projects_XP2 (
ProjectType,
RequiredPowerWhileActive,
ReligiousPressureModifier,
UnlocksFromEffect,
RequiredBuilding,
CreateBuilding,
FullyPoweredWhileActive,
MaxSimultaneousInstances
)
VALUES (
'QUO_PROJECT_BIOME_ASIAN_EXPANSE_THIS_SPHERE_ONLY',
0, --'RequiredPowerWhileActive',
0, -- 'ReligiousPressureModifier',
1, -- 'UnlocksFromEffect',
NULL, --'RequiredBuilding',
NULL, -- 'CreateBuilding',
0, --'FullyPoweredWhileActive',
1 --'MaxSimultaneousInstances'
);
-- code to enable the effect that enables the special rproject for this sphere
INSERT INTO Types
(Type, Kind)
VALUES ('QUO_MODTYPE_BIOME_ASIAN_EXPANSE_MAKE_PROJECT_AVAIL', 'KIND_MODIFIER' ) ;
INSERT INTO DynamicModifiers
(ModifierType, CollectionType, EffectType)
VALUES ('QUO_MODTYPE_BIOME_ASIAN_EXPANSE_MAKE_PROJECT_AVAIL', 'COLLECTION_OWNER','EFFECT_ADD_PLAYER_PROJECT_AVAILABILITY');
INSERT INTO Modifiers
(ModifierId, ModifierType, RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId)
VALUES ('QUO_BIOME_ASIAN_EXPANSE_ENABLE_PROJECT', 'QUO_MODTYPE_BIOME_ASIAN_EXPANSE_MAKE_PROJECT_AVAIL', 0, 0, NULL, NULL) ;
INSERT INTO ModifierArguments
(ModifierId, Name, Type, Value, Extra, SecondExtra)
VALUES ('QUO_BIOME_ASIAN_EXPANSE_ENABLE_PROJECT', 'ProjectType', 'ARGTYPE_IDENTITY', 'QUO_PROJECT_BIOME_ASIAN_EXPANSE_THIS_SPHERE_ONLY', NULL, NULL) ;
INSERT INTO TraitModifiers
(TraitType, ModifierID)
VALUES ('QUO_TRAIT_BIOME_ASIAN_STEPPE', 'QUO_BIOME_ASIAN_EXPANSE_ENABLE_PROJECT') ;