maconnolly
Warlord
- Joined
- Jun 3, 2019
- Messages
- 210
I feel a little disappointed to be returning and asking for help again - as I thought I had 'cracked it' through previous trial and error.
I'm creating a Civilization and have a Civilization and Leader trait (or unique ability), which I cannot get to take effect in-game.
I believe the code to be valid - it does not present any errors in either the Database.log nor the Modding.log. I can only assume there is a failure of logic on my side, somewhere.
Firstly, the Civilization UA. I would like that all of this civilization's 'foot troops' be granted +10 Combat Strength when they are within two tiles of a Holy Site. Here is my code to achieve it, as it stands:
For the avoidance of doubt, I am accepting the four unit classes (CLASS_RANGED, CLASS_MELEE, CLASS_RECON and CLASS_ANTI_CAVALRY) to collectively equal the units I want to receive this bonus.
I have also attempted to deploy the same code as above, though with the UnitAbilities 'Inactive' boolean set the other way.
--
The second non-functional element is the Leader UA. I am attempting to grant this Leader a 50% boost to Holy Site production, alongside a 20% boost to the building of either Shrines or Temples. Here's my code:
You'll note the DynamicModifiers entry is commented-out. I have tried with this included - to no avail (same result, no errors, but no effect either). I have tried various combinations of the RunOnce and Permanent booleans for the entry into Modifiers, too. Same deal.
Am I making a rookie error here? For the Leader UA, I looked-up and followed the logic for the French 'Grand Tour' ability (TRAIT_WONDER_MEDIAVALINDUSTRIAL_PRODUCTION).
For the Civilization UA, my reference was the 'God of War' faith kills modifier (GOD_OF_WAR_FAITH_KILLS_MODIFIER), although of course there was a sensible divergence at the point of defining the ModifierType.
Any help forthcoming would be much appreciated. I promise to get better at this with time!
I'm creating a Civilization and have a Civilization and Leader trait (or unique ability), which I cannot get to take effect in-game.
I believe the code to be valid - it does not present any errors in either the Database.log nor the Modding.log. I can only assume there is a failure of logic on my side, somewhere.
Firstly, the Civilization UA. I would like that all of this civilization's 'foot troops' be granted +10 Combat Strength when they are within two tiles of a Holy Site. Here is my code to achieve it, as it stands:
Spoiler :
Code:
-----------------------------------------------
-- Types
-----------------------------------------------
INSERT INTO Types
(Type, Kind )
VALUES ('TRAIT_CIVILIZATION_SANCTUARY_OF_THE_KONTIKI', 'KIND_TRAIT' ),
('ABILITY_NORTECHICO_CS_BONUS_NEAR_HOLY_SITES', 'KIND_ABILITY' );
-----------------------------------------------
-- TypeTags
-----------------------------------------------
INSERT INTO TypeTags
(Type, Tag )
VALUES ('ABILITY_NORTECHICO_CS_BONUS_NEAR_HOLY_SITES', 'CLASS_RANGED' ),
('ABILITY_NORTECHICO_CS_BONUS_NEAR_HOLY_SITES', 'CLASS_MELEE' ),
('ABILITY_NORTECHICO_CS_BONUS_NEAR_HOLY_SITES', 'CLASS_RECON' ),
('ABILITY_NORTECHICO_CS_BONUS_NEAR_HOLY_SITES', 'CLASS_ANTI_CAVALRY' );
-----------------------------------------------
-- UnitAbilities
-----------------------------------------------
INSERT INTO UnitAbilities
(UnitAbilityType, Name, Description, Inactive )
VALUES ('ABILITY_NORTECHICO_CS_BONUS_NEAR_HOLY_SITES', 'LOC_TRAIT_CIVILIZATION_SANCTUARY_OF_THE_KONTIKI_NAME', 'LOC_TRAIT_CIVILIZATION_SANCTUARY_OF_THE_KONTIKI_DESCRIPTION', 1 );
-----------------------------------------------
-- UnitAbilities
-----------------------------------------------
INSERT INTO UnitAbilityModifiers
(UnitAbilityType, ModifierId )
VALUES ('ABILITY_NORTECHICO_CS_BONUS_NEAR_HOLY_SITES', 'MODIFIER_SANCTUARY_OF_THE_KONTIKI_CS_BONUS' );
-----------------------------------------------
-- Traits
-----------------------------------------------
INSERT INTO Traits
(TraitType, Name, Description )
VALUES ('TRAIT_CIVILIZATION_SANCTUARY_OF_THE_KONTIKI', 'LOC_TRAIT_CIVILIZATION_SANCTUARY_OF_THE_KONTIKI_NAME', 'LOC_TRAIT_CIVILIZATION_SANCTUARY_OF_THE_KONTIKI_DESCRIPTION' );
-----------------------------------------------
-- CivilizationTraits
-----------------------------------------------
INSERT INTO CivilizationTraits
(CivilizationType, TraitType )
VALUES ('CIVILIZATION_MC_NORTECHICO', 'TRAIT_CIVILIZATION_SANCTUARY_OF_THE_KONTIKI' );
-----------------------------------------------
-- TraitModifiers
-----------------------------------------------
INSERT INTO TraitModifiers
(TraitType, ModifierId )
VALUES ('TRAIT_CIVILIZATION_SANCTUARY_OF_THE_KONTIKI', 'MODIFIER_SANCTUARY_OF_THE_KONTIKI_CS_BONUS' );
-----------------------------------------------
-- EmergencyBuffs
-----------------------------------------------
-----------------------------------------------
-- EmergencyRewards
-----------------------------------------------
-----------------------------------------------
-- Modifiers
-----------------------------------------------
INSERT INTO Modifiers
(ModifierId, ModifierType, SubjectRequirementSetId )
VALUES ('MODIFIER_SANCTUARY_OF_THE_KONTIKI_CS_BONUS', 'MODIFIER_PLAYER_UNITS_ADJUST_COMBAT_STRENGTH', 'PLOT_TWO_INCLUDE_HOLY_SITE' );
-----------------------------------------------
-- ModifierArguments
-----------------------------------------------
INSERT INTO ModifierArguments
(ModifierId, Name, Value )
VALUES ('MODIFIER_SANCTUARY_OF_THE_KONTIKI_CS_BONUS', 'Amount', 10 );
-----------------------------------------------
-- RequirementSets
-----------------------------------------------
INSERT INTO RequirementSets
(RequirementSetId, RequirementSetType )
VALUES ('PLOT_TWO_INCLUDE_HOLY_SITE', 'REQUIREMENT_TEST_ALL' );
-----------------------------------------------
-- RequirementSetRequirements
-----------------------------------------------
INSERT INTO RequirementSetRequirements
(RequirementSetId, RequirementId )
VALUES ('PLOT_TWO_INCLUDE_HOLY_SITE', 'REQUIRES_PLOT_WITHIN_TWO_HOLY_SITE' );
-----------------------------------------------
-- Requirements
-----------------------------------------------
INSERT INTO Requirements
(RequirementId, RequirementType )
VALUES ('REQUIRES_PLOT_WITHIN_TWO_HOLY_SITE', 'REQUIREMENT_PLOT_ADJACENT_DISTRICT_TYPE_MATCHES' );
-----------------------------------------------
-- RequirementArguments
-----------------------------------------------
INSERT INTO RequirementArguments
(RequirementId, Name, Value )
VALUES ('REQUIRES_PLOT_WITHIN_TWO_HOLY_SITE', 'DistrictType', 'DISTRICT_HOLY_SITE' ),
('REQUIRES_PLOT_WITHIN_TWO_HOLY_SITE', 'MinRange', 0 ),
('REQUIRES_PLOT_WITHIN_TWO_HOLY_SITE', 'MaxRange', 2 );
For the avoidance of doubt, I am accepting the four unit classes (CLASS_RANGED, CLASS_MELEE, CLASS_RECON and CLASS_ANTI_CAVALRY) to collectively equal the units I want to receive this bonus.
I have also attempted to deploy the same code as above, though with the UnitAbilities 'Inactive' boolean set the other way.
--
The second non-functional element is the Leader UA. I am attempting to grant this Leader a 50% boost to Holy Site production, alongside a 20% boost to the building of either Shrines or Temples. Here's my code:
Spoiler :
Code:
/*
UA
Authors: MC
*/
-----------------------------------------------
-- Types
-----------------------------------------------
INSERT INTO Types
(Type, Kind )
VALUES ('TRAIT_LEADER_TAPAC_YAURI', 'KIND_TRAIT' ),
-- ('MODIFIER_PLAYER_CITIES_ADJUST_RELIGIOUS_ERA_PRODUCTION', 'KIND_MODIFIER' ),
('EFFECT_ADJUST_RELIGIOUS_ERA_PRODUCTION', 'KIND_EFFECT' );
-----------------------------------------------
-- Traits
-----------------------------------------------
INSERT INTO Traits
(TraitType, Name, Description )
VALUES ('TRAIT_LEADER_TAPAC_YAURI', 'LOC_TRAIT_LEADER_TAPAC_YAURI_NAME', 'LOC_TRAIT_LEADER_TAPAC_YAURI_DESCRIPTION' );
-----------------------------------------------
-- LeaderTraits
-----------------------------------------------
INSERT INTO LeaderTraits
(LeaderType, TraitType )
VALUES ('LEADER_MC_MANQU_QHAPAQ', 'TRAIT_LEADER_TAPAC_YAURI' );
-----------------------------------------------
-- DyanmicModifiers
-----------------------------------------------
-- INSERT INTO DynamicModifiers
-- (ModifierType, CollectionType, EffectType )
-- VALUES ('MODIFIER_PLAYER_CITIES_ADJUST_RELIGIOUS_ERA_PRODUCTION', 'COLLECTION_PLAYER_CITIES', 'EFFECT_ADJUST_RELIGIOUS_ERA_PRODUCTION' );
-----------------------------------------------
-- Modifiers
-----------------------------------------------
INSERT INTO Modifiers
(ModifierId, ModifierType, RunOnce, Permanent )
VALUES ('TRAIT_HOLYSITE_ANCIENTCLASSICAL_PRODUCTION', 'MODIFIER_PLAYER_CITIES_ADJUST_DISTRICT_PRODUCTION', 0, 0 ),
('TRAIT_SHRINETEMPLE_ANCIENTCLASSICAL_PRODUCTION', 'MODIFIER_PLAYER_CITIES_ADJUST_BUILDING_PRODUCTION', 0, 0 );
-----------------------------------------------
-- TraitModifiers
-----------------------------------------------
INSERT INTO TraitModifiers
(TraitType, ModifierId )
VALUES ('TRAIT_LEADER_TAPAC_YAURI', 'TRAIT_HOLYSITE_ANCIENTCLASSICAL_PRODUCTION' ),
('TRAIT_LEADER_TAPAC_YAURI', 'TRAIT_SHRINETEMPLE_ANCIENTCLASSICAL_PRODUCTION' );
-----------------------------------------------
-- ModifierArguments
-----------------------------------------------
INSERT INTO ModifierArguments
(ModifierId, Name, Value )
VALUES ('TRAIT_HOLYSITE_ANCIENTCLASSICAL_PRODUCTION', 'Amount', 50 ),
('TRAIT_HOLYSITE_ANCIENTCLASSICAL_PRODUCTION', 'DistrictType', 'DISTRICT_HOLY_SITE' ),
('TRAIT_SHRINETEMPLE_ANCIENTCLASSICAL_PRODUCTION', 'Amount', 20 ),
('TRAIT_SHRINETEMPLE_ANCIENTCLASSICAL_PRODUCTION', 'BuildingType', 'BUILDING_SHRINE,BUILDING_TEMPLE' );
You'll note the DynamicModifiers entry is commented-out. I have tried with this included - to no avail (same result, no errors, but no effect either). I have tried various combinations of the RunOnce and Permanent booleans for the entry into Modifiers, too. Same deal.
Am I making a rookie error here? For the Leader UA, I looked-up and followed the logic for the French 'Grand Tour' ability (TRAIT_WONDER_MEDIAVALINDUSTRIAL_PRODUCTION).
For the Civilization UA, my reference was the 'God of War' faith kills modifier (GOD_OF_WAR_FAITH_KILLS_MODIFIER), although of course there was a sensible divergence at the point of defining the ModifierType.
Any help forthcoming would be much appreciated. I promise to get better at this with time!