[R&F] Updating GameParameters.xml via SQL

Question

King
Joined
Mar 12, 2008
Messages
950
Im trying to change this :

<Replace Name="RELIGION_SPREAD_ADJACENT_CITY_DISTANCE" Value="10"/>

So I tried

INSERT OR REPLACE INTO GlobalParameters (Name, Value)
VALUES ( 'RELIGION_SPREAD_ADJACENT_CITY_DISTANCE', '15');

But it doesnt appear to work ingame....any idea why?

Database.log shows this :

[751445.353] [Localization]: Input XML does not contain database entry tags. GameData, GameInfo or Database

[751557.192] [Gameplay] ERROR: UNIQUE constraint failed: RequirementSetRequirements.RequirementSetId, RequirementSetRequirements.RequirementId

But i dont think the second one is related, any idea on how to track down what is causing that? Im not sure where requirement set is...
 
Thanks, will give that a try.

Edit : I put it in an existing mod, loaded a save game, but saw no changes...
 
Last edited:
Your INSERT OR REPLACE INTO code should work fine. Did you have a SQL error somewhere else in the file? Civ 6 will execute every line of code in linear order, top of the file to the bottom. If a prior line fails it will just never execute stuff at the bottom of the file.

For what its worth UPDATE, INSERT OR REPLACE INTO, or just REPLACE INTO are all very similar commands that do virtually the same thing in a situation where a record already exists. If you know for sure that a record exists you can use UPDATE. But if you are ever on the fence in most situations UPDATE OR REPLACE INTO or just REPLACE INTO will do the same thing.

Usually I stick to UPDATE for stuff I know exists, INSERT when specifically inserting something I created myself that for sure doesn't exist elsewhere in the database (e.g. a custom Modifier) and UPDATE OR REPLACE if there are questions about whether another mod might have added the same record.
 
I dont see any SQL errors related to that. I think its just that certain game parameters cannot be updated in game and you need to start a new one for it to work.
 
Top Bottom