- Joined
- Jan 12, 2025
- Messages
- 5
I'm adding a Holy Roman Empire civilization. My idea for a civ ability is to add a bonus +2 Faith, +2 Culture, and +2 Gold to all relics for each relic that you own. So total yields would look like this:
Things I have already tried
This second attempt just didn't do anything. The idea was for the relic modifier to attach a modifier to the player, but only if it's my civilization.
Is this even possible? So far I haven't even gotten to the stacking modifier part. If I need to create new modifiers for each stack of the bonus, then that's fine. But I can't even get to the part where I count the number of relics.
Relic Count | Faith | Culture | Gold |
1 | 6 | 2 | 2 |
2 | 16 | 8 | 8 |
3 | 30 | 18 | 18 |
5 | 48 | 32 | 32 |
5 | 70 | 50 | 50 |
Things I have already tried
- Trying to keep track of how many relics I've got using Events.GreatWorkCreated and Events.GreatWorkMoved in lua. Both of these triggers pass an argument to your function that I'll roughly call greatWorkInstanceID which outputs an automatically incremented value starting at 0. This number obviously corresponds to some sort of internal tracking of relics that are instantiated and in other mods I see people using Game.GetGreatWorkType() or cycling through all available great relic slots to get data about these Great Works using this ID. However, these methods are only available for User Interface mods, not gameplay mods.
- Adding a modifier to Relics
SQL:
INSERT INTO WI_HRE_Requirements
(RequirementId, RequirementType)
VALUES
('REQ_WI_HRE_DEFENSOR_ECCLESIAE', 'REQUIREMENT_PLAYER_HAS_CIVILIZATION_OR_LEADER_TRAIT')
;
INSERT INTO WI_HRE_RequirementArguments
(RequirementId, Name, Value)
VALUES
('REQ_WI_HRE_DEFENSOR_ECCLESIAE', 'TraitType', 'TRAIT_CIVILIZATION_WI_HRE_DEFENSOR_ECCLESIAE')
;
INSERT INTO WI_HRE_RequirementSets
(RequirementSetId, RequirementSetType)
VALUES
('REQSET_WI_HRE_DEFENSOR_ECCLESIAE', 'REQUIREMENTSET_TEST_ALL')
;
INSERT INTO WI_HRE_RequirementSetRequirements
(RequirementSetId, RequirementId)
VALUES
('REQSET_WI_HRE_DEFENSOR_ECCLESIAE', 'REQ_WI_HRE_DEFENSOR_ECCLESIAE')
;
INSERT INTO WI_HRE_Modifiers
(ModifierId, ModifierType, SubjectRequirementSetId)
VALUES
('MODIFIER_WI_HRE_RELIC_ATTACH_FAITH', 'MODIFIER_PLAYER_CITIES_ATTACH_MODIFIER', 'REQSET_WI_HRE_DEFENSOR_ECCLESIAE')
;
INSERT INTO WI_HRE_Modifiers
(ModifierId, ModifierType)
VALUES
('MODIFIER_WI_HRE_RELIC_EXTRA_FAITH', 'MODIFIER_PLAYER_CITIES_ADJUST_GREATWORK_YIELD')
;
INSERT INTO WI_HRE_GreatWorkModifiers (GreatWorkType, ModifierID)
SELECT GreatWorkType
, 'MODIFIER_WI_HRE_RELIC_ATTACH_FAITH' as ModifierID
FROM GreatWorks
WHERE GreatWorkObjectType = 'GREATWORKOBJECT_RELIC'
;
INSERT INTO WI_HRE_ModifierArguments
(ModifierId, Name, Value)
VALUES
('MODIFIER_WI_HRE_RELIC_ATTACH_FAITH', 'ModifierId', 'GREATWORKOBJECT_RELIC')
, ('MODIFIER_WI_HRE_RELIC_EXTRA_FAITH', 'GreatWorkObjectType', 'GREATWORKOBJECT_RELIC')
, ('MODIFIER_WI_HRE_RELIC_EXTRA_FAITH', 'YieldChange', '2')
, ('MODIFIER_WI_HRE_RELIC_EXTRA_FAITH', 'YieldType', 'YIELD_FAITH')
;
This second attempt just didn't do anything. The idea was for the relic modifier to attach a modifier to the player, but only if it's my civilization.
Is this even possible? So far I haven't even gotten to the stacking modifier part. If I need to create new modifiers for each stack of the bonus, then that's fine. But I can't even get to the part where I count the number of relics.