Adding new modifiers to existing belief

DrNooooo

Warlord
Joined
May 12, 2015
Messages
129
OK, so I want to add a new modifier to an existing belief - specifically, I want to make it so that Pilgrimage doubles the tourism of religious art and relics. However, whenever I load the sql and check the game database in sqlitespy, the new modifiers are not added into either the Modifiers or BeliefModifiers tables. I've added new modifiers to Zen Meditation and those show up in the database and work properly - what am I doing wrong here?

Code:
INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId)
VALUES  ('PILGRIMAGE_TOURISM_BONUS', 'MODIFIER_ALL_CITIES_ATTACH_MODIFIER', 0, 0, NULL, 'CITY_FOLLOWS_RELIGION_REQUIREMENTS'),
        ('PILGRIMAGE_TOURISM_RELICS', 'MODIFIER_ALL_CITIES_ATTACH_MODIFIER', 0, 0, NULL, 'CITY_FOLLOWS_RELIGION_REQUIREMENTS'),
        ('PILGRIMAGE_TOURISM_BONUS_MODIFIER', 'MODIFIER_SINGLE_CITY_ADJUST_TOURISM', 0, 0, NULL, NULL),
        ('PILGRIMAGE_TOURISM_RELICS_MODIFIER', 'MODIFIER_SINGLE_CITY_ADJUST_TOURISM', 0, 0, NULL, NULL) ;

INSERT INTO BeliefModifiers
    (BeliefType,             ModifierID)
VALUES    ('BELIEF_PILGRIMAGE',    'PILGRIMAGE_TOURISM_BONUS'),
        ('BELIEF_PILGRIMAGE',    'PILGRIMAGE_TOURISM_RELICS') ;

INSERT INTO ModifierArguments
    (ModifierId,             Name,             Type,             Value,         Extra,     SecondExtra)
VALUES    ('PILGRIMAGE_TOURISM_BONUS', 'ModifierID', 'ARGTYPE_IDENTITY', 'PILGRIMAGE_TOURISM_BONUS_MODIFIER', NULL, NULL),
        ('PILGRIMAGE_TOURISM_RELICS', 'ModifierID', 'ARGTYPE_IDENTITY', 'PILGRIMAGE_TOURISM_RELICS_MODIFIER', NULL, NULL),
        ('PILGRIMAGE_TOURISM_BONUS_MODIFIER', 'GreatWorkObjectType', 'ARGTYPE_IDENTITY', 'GREATWORKOBJECT_RELIGIOUS', NULL, NULL),
        ('PILGRIMAGE_TOURISM_BONUS_MODIFIER', 'ScalingFactor', 'ARGTYPE_IDENTITY', 200, NULL, NULL),
        ('PILGRIMAGE_TOURISM_BONUS_RELICS_MODIFIER', 'GreatWorkObjectType', 'ARGTYPE_IDENTITY', 'GREATWORKOBJECT_RELIC', NULL, NULL),
        ('PILGRIMAGE_TOURISM_BONUS_RELICS_MODIFER', 'ScalingFactor', 'ARGTYPE_IDENTITY', 200, NULL, NULL) ;

ETA: added a zip of the mod folder
 

Attachments

  • Better Beliefs.zip
    3 KB · Views: 25
Last edited:
Compare what you have defined within table Modifiers to what you are referencing within table ModifierArguments. They aren't the same. Database.log thus spits the following error messages
Code:
[4206117.029] [Gameplay] ERROR: FOREIGN KEY constraint failed
[4206117.029] [Gameplay] ERROR: FOREIGN KEY constraint failed
[4206117.029] [Gameplay]: Validating Foreign Key Constraints...
[4206117.042] [Gameplay] ERROR: Invalid Reference on ModifierArguments.ModifierId - "PILGRIMAGE_TOURISM_BONUS_RELICS_MODIFER" does not exist in Modifiers
[4206117.042] [Gameplay] ERROR: Invalid Reference on ModifierArguments.ModifierId - "PILGRIMAGE_TOURISM_BONUS_RELICS_MODIFIER" does not exist in Modifiers
[4206117.052] [Gameplay]: Failed Validation.

for windows machines
Code:
C:\Users\YourUserName\Documents\My Games\Sid Meier's Civilization VI\Logs/Database.log
 
Haha oh hell, of course it was a few typos i kept missing over and over and over. All those attempts and that's all it took - it works now! Thanks so much!

And thank you so much for pointing out the errors in the database.log, it helped me a ton with diagnosing the other problems in this mod!

I wanted to ask another question: is it possible to have a city-state bonus applied to a belief? So if i wanted to take Jerusalem's "becoming a suzerain converts the city-state to your religion" bonus and make that part of Papal Primacy, could I do that? Here's what I've attempted, but I can't get it to actually convert the cities:

Code:
INSERT INTO RequirementSetRequirements
        (RequirementSetId,                                RequirementId)
VALUES    ('PLAYER_IS_SUZERAIN_AND_PAPAL_PRIMACY',                        'REQUIRES_PLAYER_IS_SUZERAIN'),
        ('PLAYER_IS_SUZERAIN_AND_PAPAL_PRIMACY',                        'REQUIRES_PLAYER_HAS_PAPAL_PRIMACY'),
        ('PLAYER_IS_SUZERAIN_AND_PAPAL_PRIMACY',                        'REQUIRES_PLAYER_AT_PEACE');

INSERT INTO RequirementSets
        (RequirementSetId,                                RequirementSetType)
VALUES    ('PLAYER_IS_SUZERAIN_AND_PAPAL_PRIMACY',                        'REQUIREMENTSET_TEST_ALL');

INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId)
VALUES    ('PAPAL_PRIMACY_SUZERAIN_BONUS', 'MODIFIER_ALL_PLAYERS_ATTACH_MODIFIER', 0, 0, NULL, 'PLAYER_IS_SUZERAIN_AND_PAPAL_PRIMACY'),
        ('PAPAL_PRIMACY_SUZERAIN_MODIFIER', 'MODIFIER_PLAYER_ADOPT_ALLY_FOUNDED_RELIGIONS', 0, 0 , NULL, NULL) ;

INSERT INTO BeliefModifiers
    (BeliefType,             ModifierID)
VALUES    ('BELIEF_PAPAL_PRIMACY',    'PAPAL_PRIMACY_SUZERAIN_BONUS') ;

INSERT INTO ModifierArguments
    (ModifierId,             Name,             Type,             Value,         Extra,     SecondExtra)
VALUES    ('PAPAL_PRIMACY_SUZERAIN_BONUS', 'ModifierId', 'ARGTYPE_IDENTITY', 'PAPAL_PRIMACY_SUZERAIN_MODIFIER', NULL, NULL),
        ('PAPAL_PRIMACY_SUZERAIN_MODIFIER', 'Adopt', 'ARGTYPE_IDENTITY', 'True', NULL, NULL) ;

Here's the current version of the mod. Thanks again for your help!
 

Attachments

  • Better Beliefs.zip
    4.1 KB · Views: 53
Last edited:
Code:
<GameInfo>
	<Types>
		<Row Type="MODIFIER_PLAYER_ADOPT_ALLY_FOUNDED_RELIGIONS" Kind="KIND_MODIFIER"/>
	</Types>
	<DynamicModifiers>
		<Row>
			<ModifierType>MODIFIER_PLAYER_ADOPT_ALLY_FOUNDED_RELIGIONS</ModifierType>
			<CollectionType>COLLECTION_OWNER</CollectionType>
			<EffectType>EFFECT_ADOPT_ALLY_FOUNDED_RELIGIONS</EffectType>
		</Row>
	</DynamicModifiers>
	<TraitModifiers>
		<!--Unlike other Suzerain bonuses, Jerusalem's bonus emerges from modifiers applied to itself rather than modifiers applied to another player-->
		<Row TraitType="MINOR_CIV_JERUSALEM_TRAIT" ModifierId="MINOR_CIV_JERUSALEM_RELIGION_BONUS"/>
	</TraitModifiers>
	<Modifiers>
		<Row>
			<ModifierId>MINOR_CIV_JERUSALEM_RELIGION_BONUS</ModifierId>
			<ModifierType>MODIFIER_PLAYER_ADOPT_ALLY_FOUNDED_RELIGIONS</ModifierType>
		</Row>
	</Modifiers>
	<ModifierArguments>
		<Row>
			<ModifierId>MINOR_CIV_JERUSALEM_RELIGION_BONUS</ModifierId>
			<Name>Adopt</Name>
			<Value>true</Value>
		</Row>
	</ModifierArguments>
</GameInfo>
Based on the effect-type used and the notation in the base-game file, it would seem doubtful you can get that particular effect/modifier to apply to anything but a city-state because it is looking for who is the suzerain/ally of the city-state.
 
Darn it. Could I get it to work in reverse order, by attaching a modifier to every single city-state's trait and then having the new modifier requirements be that the player is the suzerain and has Papal Primacy? Or could I attach a modifier with the suzerain requirement to the traits of every city-state and then have a second modifier (attached to the first one) where the requirement is that the player has Papal Primacy, so that both requirements are looking for the right things?
 
Is Papal Primacy impossible to modify? It seems like regardless of what modifiers or requirements I use, nothing changes - even if I copy and paste the exact same code from another belief that does work and change it to apply to Papal Primacy. I've even tried using the same parameters in beliefs.xml as the requires_player_has_papal_primacy requirements instead of player_founded_religion_requirements, so that it apples to all players (but, in effect, only to one who has that belief).

Here's my test code where I tried to give Papal Primacy extra faith for trade routes, which isn't what I want but works for my Tithe modifications. However, neither this or using player_founded_religion does anything. Is this because Papal Primacy doesn't have a BeliefModifier in vanilla?

Code:
INSERT INTO Requirements
    (RequirementId,         RequirementType,     Likeliness,        Inverse,     Triggered)
VALUES    ('PLAYER_HAS_PAPAL_PRIMACY',     'REQUIRES_PLAYER_HAS_PAPAL_PRIMACY',    0,0,0) ;

INSERT INTO RequirementSets
    (RequirementSetId,     RequirementSetType)
VALUES     ('PLAYER_HAS_PAPAL_PRIMACY_SET', 'REQUIREMENTSET_TEST_ALL') ;

INSERT INTO RequirementSetRequirements
    (RequirementSetId,                 RequirementId)
VALUES    ('PLAYER_HAS_PAPAL_PRIMACY_SET',     'PLAYER_HAS_PAPAL_PRIMACY') ;

INSERT INTO BeliefModifiers
VALUES    ('BELIEF_PAPAL_PRIMACY',    'PAPAL_PRIMACY_BONUS');

INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId)
VALUES    ('PAPAL_PRIMACY_BONUS', 'MODIFIER_ALL_PLAYERS_ATTACH_MODIFIER', 0, 0, NULL, 'PLAYER_HAS_PAPAL_PRIMACY_SET'),        
        ('PAPAL_PRIMACY_BONUS_MODIFIER', 'MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD', 0, 0, NULL, NULL);

INSERT INTO ModifierArguments
    (ModifierId,             Name,             Type,             Value,         Extra,     SecondExtra)
VALUES    ('PAPAL_PRIMACY_BONUS', 'ModifierID', 'ARGTYPE_IDENTITY', 'PAPAL_PRIMACY_BONUS_MODIFIER', NULL, NULL),
        ('PAPAL_PRIMACY_BONUS_MODIFIER',     'YieldType',     'ARGTYPE_IDENTITY',     'YIELD_FAITH',    NULL,     NULL)  ,
        ('PAPAL_PRIMACY_BONUS_MODIFIER',     'Amount',     'ARGTYPE_IDENTITY',     99,    NULL,     NULL)  ;
 
Top Bottom