Modifying strategic resource costs to units

Tovarish

Chieftain
Joined
Feb 24, 2019
Messages
84
So I had this mod "Logical resource requirements" by Takfloyd
https://forums.civfanatics.com/threads/logical-resource-requirements.642600/

It was quite nice to play and the mod stayed with me for a long time.

Now I edited the code to better change the strategic resource costs based on gameplay logic and experience.
I changed the code properly, using EXACTLY the same logic as the code was written.

And the result was/is a complete mess. Only the latest changes are taking effect for couple of units. The rest of units are no longer affected by any changes whatsoever, for some units it's very old changes, for some units no changes. Although the code is everywhere the same.

So what am I missing here? The code has the same logic for each modified unit. But only couple units at the end are affected properly.

Is it that game version has changed? Is it that some new files are required as modibility for Civ6 has improved? I have no clue. PLEASE, if you have any knowledge, tell me. There are no conflicts with other mods because I disabled the rest of the mods.
 
Last edited:
What if anything is being reported in the game's error logs ?
The usual location for the error logs on Windows machines is:
Code:
C:\Users\{YourUserNameHre]\Documents\My Games\Sid Meier's Civilization VI\Logs
You want to be looking in Database.log and Modding.log for reports of errors.
 
I changed Mod ID number to start with 00 in modinfo file and that improved things - more units have desired costs, but that is far from satisfying - some units simply are not affected by the same code, no matter my repeated efforts.

I looked at Database.log and it looks like chinese to me.
Here is what it said:

"
[1520952.545] [Localization]: StartupErrorMessages.xml
[1520952.545] [Localization]: Input XML does not contain database entry tags. GameData, GameInfo or Database
[1520963.531] [Localization]: Validating Foreign Key Constraints...
[1520963.532] [Localization]: Passed Validation.
[1520963.564] [Configuration]: Validating Foreign Key Constraints...
[1520963.565] [Configuration]: Passed Validation.
[1520965.308] [FullTextSearch]: Initializing FullTextSearch
[1520965.970] [Gameplay]: Validating Foreign Key Constraints...
[1520965.990] [Gameplay]: Passed Validation.
[1520969.143] [Configuration]: Validating Foreign Key Constraints...
[1520969.144] [Configuration]: Passed Validation.
[1520971.463] [HallofFame]: Database found. Checking versions...
[1520971.467] [HallofFame]: Database is up-to-date!
[1520992.008] [FullTextSearch]: FTS - Creating Context
[1521007.025] [Configuration]: Validating Foreign Key Constraints...
[1521007.026] [Configuration]: Passed Validation.
[1521017.592] [Gameplay] ERROR: UNIQUE constraint failed: GlobalParameters.Name
[1521017.592] [Gameplay] ERROR: UNIQUE constraint failed: GlobalParameters.Name
[1521018.284] [Gameplay] ERROR: UNIQUE constraint failed: Units_XP2.UnitType
[1521018.284] [Gameplay]: While executing - 'insert into Units_XP2('UnitType', 'ResourceMaintenanceType', 'ResourceMaintenanceAmount') values (?, ?, ?);'
[1521018.284] [Gameplay]: In XMLSerializer while inserting row into table insert into Units_XP2('UnitType', 'ResourceMaintenanceType', 'ResourceMaintenanceAmount') with values (UNIT_COURSER, RESOURCE_HORSES, 1, ).
[1521018.284] [Gameplay]: In XMLSerializer while updating table Units_XP2 from file Expansion2_Units_Update.xml.
[1521018.284] [Gameplay] ERROR: UNIQUE constraint failed: Units_XP2.UnitType
[1521018.720] [Gameplay]: Validating Foreign Key Constraints...
[1521018.758] [Gameplay]: Passed Validation.
[1521034.813] [FullTextSearch]: FTS - Creating Context
[1521034.814] [FullTextSearch]: FTS - Creating Context
[1521035.963] [FullTextSearch]: FTS - Creating Context
[1521037.490] [FullTextSearch]: FTS - Creating Context
[1521040.708] [FullTextSearch]: FTS - Creating Context
"

Could you comment a little on this text: does it mean something for you? Yes, I see the ERROR but I am not smart enough to read what that means.
 
Seems like UNIT_COURSER update occured twice or mod trying to insert new row with UNIT_COURSER when one alredy exist
 
Back
Top Bottom