Civilization Trait Modifier: Tourism Boost

KoubaK

Warlord
Joined
May 8, 2017
Messages
106
Location
DMV
I'm building my own custom civ and I am having problems getting the civilization trait to work.
My goal is to automatically boost Tourism as part of the civilization trait. Below is what I got so far:

Code:
-- Types
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO Types
        (Type,                                        Kind)
VALUES    ('TRAIT_CIVILIZATION_GA_BELLAS_ARTES',        'KIND_TRAIT');
--------------------------------------------------------------------------------------------------------------------------
-- Traits
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO Traits
        (TraitType,                                    Name,                                                Description)
VALUES    ('TRAIT_CIVILIZATION_GA_BELLAS_ARTES',        'LOC_TRAIT_CIVILIZATION_GA_BELLAS_ARTES_NAME',        'LOC_TRAIT_CIVILIZATION_GA_BELLAS_ARTES_DESCRIPTION');
--------------------------------------------------------------------------------------------------------------------------
-- TraitModifiers
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO TraitModifiers
        (TraitType,                                    ModifierId)
VALUES    ('TRAIT_CIVILIZATION_GA_BELLAS_ARTES',        'GA_TRAIT_AdjustTourism');
--------------------------------------------------------------------------------------------------------------------------
-- Modifiers
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO Modifiers
        (ModifierId,                        ModifierType)
VALUES    ('GA_TRAIT_AdjustTourism',            'MODIFIER_PLAYER_ADJUST_TOURISM');
--------------------------------------------------------------------------------------------------------------------------
-- ModifierArguments
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO ModifierArguments
        (ModifierId,                    Name,                            Value)
VALUES    ('GA_TRAIT_AdjustTourism',        'Amount',                        '100');
 
Well for starters I'm pretty sure your modifier id needs to be in ALL CAPS or sql won't read it properly
 
It really helps if you write what kind of problems you have...
Edit. And attach log files.

Well, the problem is that the modifier doesn't work. The game loads fine and I am able to launch a new game and play it through.
How do I get the logs? I'm fairly new to this modding stuff :D

Well for starters I'm pretty sure your modifier id needs to be in ALL CAPS or sql won't read it properly
Yeah, perhaps. I have over ModifierIds in the lowercase and they work just fine (Leader Traits). I will try switching the case to UPPERCASE and see if that helps. :)
 
  1. Upper or Lower Case should not make any difference in a newly-defined tag-name so long as your usage is consistent.
  2. Start by changing '100' to 100. The text ' encapsulation around numerical data is not required in SQL and in some circumstances will be be interpretted as text rather than numerical values.
  3. logs are located at folder C:\Users\Yourname\Documents\My Games\Sid Meier's Civilization VI\Logs (Assuming a Windows computer). Within this folder are various log files, the most important of which are:
    • Database.log
      1. This file records errors found within xml and sql files as the game attempts to load the contents of these files
      2. Within a given file, once the game encounters a fatal error, it ceases to read any farther into the file and discards the remainder of the file's contents. When this sort of fatal error occurs you can therefore get partial implementation of a file's code, with good or bad results depending on which exact portions of the file were read into the game's database before the fatal error was encountered
      3. All error messages withing this file begin with a time-stamp in the form of for example
        Code:
        [123456.657]
      4. Unlike Civ5 wherein a fatal error within an xml file caused the game to discard the entire contents of the file, in Civ6 only the contents at and after (lower-down) are discarded by the game.
      5. When a fatal error is encountered within an xml file, numerous messages with identical time-stamps are generated, and the last of these related to the same error will generally state the name of the xml-file the game was attempting to load.
      6. SQL file are not nearly as friendly in the Database.log and merely state essentially error was encountered.
        • For SQL files you must compare the timestamp of the Database.log error message to all time-stamps within file Modding.log to determine which file or files was being loaded into the game at the same time.
    • Modding.log
      1. This file records time-stamps for every file the game attempts to load into the game, and the name of the file which was being loaded.
      2. The messages do not however give the full mod-name, folder-name, file-name path for the file but generally you should not be running so many mods when you are in the debug process that you cannot figure out which mod contains the file that has the bug.
    • Lua.log
      1. The file records various activities that occur related to lua-files
      2. mod-makers that are adding or altering lua files can cause debug and verification statements to be printed into this log simply by adding a command within an lua file such as
        Code:
        print("My Cheeseburger has no lettuce!!")
        This would cause a message of
        Code:
        Civ6LUA_Testing_File2: My Cheeseburger has no lettuce!!
        In this example "Civ6LUA_Testing_File2" would be the name of the lua-file that contained the command to create the print-statement.
 
Last edited:
So after fixing some stuff in the GameText.xml (well, I tried lol) Here are the errors that I am getting.
I am aware of the Units.xml error... I screw that up partially on purpose.

Modding.log
Code:
[4102924.312] Status: UpdateDatabase - Loading Core/GA_Dominican_Districts.xml
[4102924.312] Warning: UpdateDatabase - Error Loading XML.
[4102924.312] Status: UpdateDatabase - Loading Core/GA_Dominican_GameDefines.sql
[4102924.314] Status: UpdateDatabase - Loading Core/GA_Dominican_Units.xml
[4102924.314] Warning: UpdateDatabase - Error Loading XML.
[4102924.314] Status: Successfully released save point.
[4102924.314] Status: Applied component to game.
[4102924.314] Status: Applying Component - NewAction
[4102924.314] Status: Creating database save point.
[4102924.314] Status: LocalizedText - Loading Core/GA_Dominican_GameText.xml
[4102924.315] Warning: LocalizedText - Error Loading XML.
[4102924.315] Status: Successfully released save point.

Database.log
Code:
[4102857.298] [Localization]: Validating Foreign Key Constraints...
[4102857.299] [Localization]: Passed Validation.
[4102857.307] [Configuration]: Validating Foreign Key Constraints...
[4102857.307] [Configuration]: Passed Validation.
[4102870.510] [FullTextSearch]: Initializing FullTextSearch
[4102870.927] [Gameplay]: Validating Foreign Key Constraints...
[4102870.936] [Gameplay]: Passed Validation.
[4102871.327] [Localization] ERROR: NOT NULL constraint failed: LocalizedText.Language
[4102871.327] [Localization]: While executing - 'insert into LocalizedText('Tag', 'Text') values (?, ?);'
[4102871.327] [Localization]: In XMLSerializer while inserting row into table insert into LocalizedText('Tag', 'Text') with  values (LOC_DISTRICT_GA_CHAVON_DESCRIPTION_ADJACENCY, Adjacency: Standard [ICON_Culture] Culture bonus for adjacent City Center. Standard [ICON_Culture] Culture bonus for each adjacent wonder and district. Can only be built on Hills., ).
[4102871.327] [Localization]: In XMLSerializer while updating table LocalizedText from file GA_Dominican_GameText.xml.
[4102871.327] [Localization] ERROR: NOT NULL constraint failed: LocalizedText.Language
[4102871.357] [Configuration]: Validating Foreign Key Constraints...
[4102871.357] [Configuration]: Passed Validation.
[4102891.403] [FullTextSearch]: FTS - Creating Context
[4102894.314] [FullTextSearch]: FTS - Creating Context
[4102923.256] [Localization] ERROR: NOT NULL constraint failed: LocalizedText.Language
[4102923.256] [Localization]: While executing - 'insert into LocalizedText('Tag', 'Text') values (?, ?);'
[4102923.256] [Localization]: In XMLSerializer while inserting row into table insert into LocalizedText('Tag', 'Text') with  values (LOC_DISTRICT_GA_CHAVON_DESCRIPTION_ADJACENCY, Adjacency: Standard [ICON_Culture] Culture bonus for adjacent City Center. Standard [ICON_Culture] Culture bonus for each adjacent wonder and district. Can only be built on Hills., ).
[4102923.256] [Localization]: In XMLSerializer while updating table LocalizedText from file GA_Dominican_GameText.xml.
[4102923.256] [Localization] ERROR: NOT NULL constraint failed: LocalizedText.Language
[4102923.256] [Configuration]: Validating Foreign Key Constraints...
[4102923.256] [Configuration]: Passed Validation.
[4102924.312] [Gameplay] ERROR: UNIQUE constraint failed: Adjacency_YieldChanges.ID
[4102924.312] [Gameplay]: While executing - 'insert into Adjacency_YieldChanges('ID', 'Description', 'YieldType', 'YieldChange', 'TilesRequired', 'AdjacentWonder') values (?, ?, ?, ?, ?, ?);'
[4102924.312] [Gameplay]: In XMLSerializer while inserting row into table insert into Adjacency_YieldChanges('ID', 'Description', 'YieldType', 'YieldChange', 'TilesRequired', 'AdjacentWonder') with  values (Wonder_Culture, LOC_DISTRICT_WONDER_CULTURE, YIELD_CULTURE, 1, 1, 1, ).
[4102924.312] [Gameplay]: In XMLSerializer while updating table Adjacency_YieldChanges from file GA_Dominican_Districts.xml.
[4102924.312] [Gameplay] ERROR: UNIQUE constraint failed: Adjacency_YieldChanges.ID
[4102924.314] [Gameplay] ERROR: Database::XMLSerializer (GA_Dominican_Units.xml): 'Row' or 'Delete' expected, got 'UnitReplaces'.
[4102924.314] [Gameplay]: In XMLSerializer while updating table Types from file GA_Dominican_Units.xml.
[4102924.315] [Localization] ERROR: NOT NULL constraint failed: LocalizedText.Language
[4102924.315] [Localization]: While executing - 'insert into LocalizedText('Tag', 'Text') values (?, ?);'
[4102924.315] [Localization]: In XMLSerializer while inserting row into table insert into LocalizedText('Tag', 'Text') with  values (LOC_DISTRICT_GA_CHAVON_DESCRIPTION_ADJACENCY, Adjacency: Standard [ICON_Culture] Culture bonus for adjacent City Center. Standard [ICON_Culture] Culture bonus for each adjacent wonder and district. Can only be built on Hills., ).
[4102924.315] [Localization]: In XMLSerializer while updating table LocalizedText from file GA_Dominican_GameText.xml.
[4102924.315] [Localization] ERROR: NOT NULL constraint failed: LocalizedText.Language
[4102924.389] [Gameplay]: Validating Foreign Key Constraints...
[4102924.400] [Gameplay]: Passed Validation.
[4102934.411] [FullTextSearch]: FTS - Creating Context
[4102935.132] [FullTextSearch]: FTS - Creating Context
[4102937.733] [FullTextSearch]: FTS - Creating Context
[4103994.724] [FullTextSearch]: FullTextSearch - Shutting down
 
Wonder_Culture already exists as an "ID" in table Adjacency_YieldChanges. See file Disricts.xml
Code:
[4102924.312] [Gameplay] ERROR: UNIQUE constraint failed: Adjacency_YieldChanges.ID
[4102924.312] [Gameplay]: While executing - 'insert into Adjacency_YieldChanges('ID', 'Description', 'YieldType', 'YieldChange', 'TilesRequired', 'AdjacentWonder') values (?, ?, ?, ?, ?, ?);'
[4102924.312] [Gameplay]: In XMLSerializer while inserting row into table insert into Adjacency_YieldChanges('ID', 'Description', 'YieldType', 'YieldChange', 'TilesRequired', 'AdjacentWonder') with  values (Wonder_Culture, LOC_DISTRICT_WONDER_CULTURE, YIELD_CULTURE, 1, 1, 1, ).
[4102924.312] [Gameplay]: In XMLSerializer while updating table Adjacency_YieldChanges from file GA_Dominican_Districts.xml.
[4102924.312] [Gameplay] ERROR: UNIQUE constraint failed: Adjacency_YieldChanges.ID

------------------------------------------------------------------------------------------------------------------------

Language is missing from the rows you are trying to add in table LocalizedText. Column Language must have a valid value for every row added to table LocalizedText. You need as like this
Code:
<Row Tag="LOC_BUILDING_NATIONAL_MUSEUM_LRS_NAME" Language="en_US">
	<Text>National Museum</Text>
</Row>
not like this
Code:
<Row Tag="LOC_BUILDING_NATIONAL_MUSEUM_LRS_NAME">
	<Text>National Museum</Text>
</Row>

Code:
[4102924.315] [Localization] ERROR: NOT NULL constraint failed: LocalizedText.Language
[4102924.315] [Localization]: While executing - 'insert into LocalizedText('Tag', 'Text') values (?, ?);'
[4102924.315] [Localization]: In XMLSerializer while inserting row into table insert into LocalizedText('Tag', 'Text') with  values (LOC_DISTRICT_GA_CHAVON_DESCRIPTION_ADJACENCY, Adjacency: Standard [ICON_Culture] Culture bonus for adjacent City Center. Standard [ICON_Culture] Culture bonus for each adjacent wonder and district. Can only be built on Hills., ).
[4102924.315] [Localization]: In XMLSerializer while updating table LocalizedText from file GA_Dominican_GameText.xml.
[4102924.315] [Localization] ERROR: NOT NULL constraint failed: LocalizedText.Language
etc for the [Localization] errors.
 
@LeeS Thank you! I removed the Adjacency_YieldChanges table from my Districts.xml since I'm referencing the original Wonder_Culture from the game and I don't need to modify it.
Could you look at my original post and tell me if there is anything wrong with the code? I'm not able to tell whether the Tourism boost actually works or not.
 
Back
Top Bottom