[Vanilla] Custom Civ Conflict, help!

Jeremiah

Chieftain
Joined
May 29, 2020
Messages
6
Location
The Netherlands
Hey!
I'm new to the civilization series, I played my first few games through the epic games giveaway and am really enjoying it so far! I started modding because I thought it would be fun to add some of my family members as leaders with their own civs.

I followed this tutorial: https://forums.civfanatics.com/threads/how-to-create-your-own-civilization.621377/
and used it to create 2 mods, each with a new civ & leader, that work on their own; but when I have both mods enabled I can't load into a game.

The second civ is an exact copy of the first civ i made with all the names changed. I was going to make it unique later, but tried to test it out first. I'm guessing they have some overlap and that's the reason it won't run?

Here's the Database.log:
Code:
[1559600.083] [Localization]: StartupErrorMessages.xml
[1559600.083] [Localization]: Input XML does not contain database entry tags. GameData, GameInfo or Database
[1559602.534] [Localization]: Validating Foreign Key Constraints...
[1559602.534] [Localization]: Passed Validation.
[1559602.547] [Configuration]: Validating Foreign Key Constraints...
[1559602.547] [Configuration]: Passed Validation.
[1559603.734] [FullTextSearch]: Initializing FullTextSearch
[1559604.418] [Gameplay]: Validating Foreign Key Constraints...
[1559604.430] [Gameplay]: Passed Validation.
[1559604.629] [Configuration]: Validating Foreign Key Constraints...
[1559604.630] [Configuration]: Passed Validation.
[1559605.279] [HallofFame]: Database found. Checking versions...
[1559605.281] [HallofFame]: Database is up-to-date!
[1559618.370] [FullTextSearch]: FTS - Creating Context
[1559622.500] [FullTextSearch]: FTS - Creating Context
[1559628.551] [Configuration]: Validating Foreign Key Constraints...
[1559628.552] [Configuration]: Passed Validation.
[1559634.272] [Configuration]: Validating Foreign Key Constraints...
[1559634.272] [Configuration]: Passed Validation.
[1559635.202] [Gameplay] ERROR: UNIQUE constraint failed: Types.Type
[1559635.202] [Gameplay] ERROR: UNIQUE constraint failed: Types.Type
[1559635.228] [Gameplay] ERROR: FOREIGN KEY constraint failed
[1559635.228] [Gameplay] ERROR: FOREIGN KEY constraint failed
[1559635.228] [Gameplay]: Validating Foreign Key Constraints...
[1559635.229] [Gameplay] ERROR: Invalid Reference on Buildings.TraitType - "TRAIT_CIVILIZATION_BUILDING_JSN_CHURCH" does not exist in Traits
[1559635.240] [Gameplay]: Failed Validation.
[1559636.724] [Configuration]: Validating Foreign Key Constraints...
[1559636.724] [Configuration]: Passed Validation.
[1559637.220] [FullTextSearch]: FTS - Creating Context
[1559644.543] [FullTextSearch]: FullTextSearch - Shutting down

This leads me to believe is has to do with the building. So here's the code for both mods:
Code:
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
    <Types>
        <Row Type="BUILDING_JSN_CHURCH" Kind="KIND_BUILDING"/>
    </Types>
    
    <Buildings>
        <Row BuildingType="BUILDING_JSN_CHURCH" Name="LOC_BUILDING_JSN_CHURCH_NAME" Description="LOC_BUILDING_JSN_CHURCH_DESCRIPTION" PrereqDistrict="DISTRICT_CITY_CENTER" PrereqCivic="CIVIC_CODE_OF_LAWS" PurchaseYield="YIELD_GOLD" Cost="75" AdvisorType="ADVISOR_RELIGIOUS" Maintenance="0" TraitType="TRAIT_CIVILIZATION_BUILDING_JSN_CHURCH"/>
    </Buildings>
    
    <Building_YieldChanges>
        <Row BuildingType="BUILDING_JSN_CHURCH" YieldType="YIELD_FAITH" YieldChange="2"/>
    </Building_YieldChanges>
    
</GameInfo>
Code:
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
    <Types>
        <Row Type="BUILDING_JSN_STUDIO" Kind="KIND_BUILDING"/>
    </Types>
    
    <Buildings>
        <Row BuildingType="BUILDING_JSN_STUDIO" Name="LOC_BUILDING_JSN_STUDIO_NAME" Description="LOC_BUILDING_JSN_STUDIO_DESCRIPTION" PrereqDistrict="DISTRICT_CITY_CENTER" PrereqCivic="CIVIC_CODE_OF_LAWS" PurchaseYield="YIELD_GOLD" Cost="75" AdvisorType="ADVISOR_CULTURE" Maintenance="0" TraitType="TRAIT_CIVILIZATION_BUILDING_JSN_STUDIO"/>
    </Buildings>
    
    <Building_YieldChanges>
        <Row BuildingType="BUILDING_JSN_STUDIO" YieldType="YIELD_CULTURE" YieldChange="2"/>
    </Building_YieldChanges>
    
</GameInfo>

All help is greatly appreciated!
I'm new to all of this, so I'm not surprised if I did something stupid.
Thanks!
 
Welcome to Civ6 Modding!

i believe it has something to do with your trait type:
TraitType="TRAIT_CIVILIZATION_BUILDING_JSN_CHURCH"

seems to not correctly referenced in the other xml files.
But we would need a look in your main xml file, to tell exactly whats wrong, but yeah, this is the problem according to the database.log
 
Thank you for the reply!
I did a CTRL+F search for 'TRAIT_CIVILIZATION_BUILDING_JSN_CHURCH' and here are the other mentions of it:
Code:
--==========================================================================================================================
-- CIVILIZATIONS: TRAITS
--==========================================================================================================================
-- Types
--------------------------------------------------------------------------------------------------------------------------  
INSERT INTO Types  
        (Type,                                                    Kind)
VALUES    ('TRAIT_CIVILIZATION_JSN_GRIND',                        'KIND_TRAIT'),
        ('TRAIT_CIVILIZATION_BUILDING_JSN_CHURCH',            'KIND_TRAIT');  
--------------------------------------------------------------------------------------------------------------------------          
-- Traits          
--------------------------------------------------------------------------------------------------------------------------              
INSERT INTO Traits              
        (TraitType,                                                    Name,                                                    Description)
VALUES    ('TRAIT_CIVILIZATION_JSN_GRIND',                        'LOC_TRAIT_CIVILIZATION_JSN_GELOOF_NAME',                    'LOC_TRAIT_CIVILIZATION_JSN_GELOOF_DESCRIPTION'),
        ('TRAIT_CIVILIZATION_BUILDING_JSN_CHURCH',            'LOC_TRAIT_CIVILIZATION_BUILDING_JSN_CHURCH_NAME',        'LOC_TRAIT_CIVILIZATION_BUILDING_JSN_CHURCH_DESCRIPTION');  
--------------------------------------------------------------------------------------------------------------------------      
-- TraitModifiers      
--------------------------------------------------------------------------------------------------------------------------          
INSERT INTO TraitModifiers          
        (TraitType,                                            ModifierId)
VALUES    ('TRAIT_CIVILIZATION_JSN_GRIND',                    'JSN_TRAIT_FOOD');                                                                                  
--------------------------------------------------------------------------------------------------------------------------
-- Modifiers
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO Modifiers  
        (ModifierId,                                                ModifierType)
VALUES    ('JSN_TRAIT_FOOD',                                        'MODIFIER_PLAYER_CAPITAL_CITY_ADJUST_CITY_YIELD_CHANGE');          
--------------------------------------------------------------------------------------------------------------------------
-- ModifierArguments
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO ModifierArguments
        (ModifierId,                Name, Value)
VALUES    ('JSN_TRAIT_FOOD',            'Amount', '1'),
        ('JSN_TRAIT_FOOD',            'YieldType', 'YIELD_FOOD');

It appears in the 'Joshs_Template_GameDefines.sql' file.
 
I am not the best at sql, but it seems that you nowhere assigned the new trait to your new civilization, and therefore there is a new trait that is not assigned to a civilization, and thats why it is not working. look in the game‘s civilizations.xml or the other game‘s xml files to see how a trait have to be assigned to a civ.
 
If it is added in a different file you probably have to make sure that file is loading before the other one that references the TraitType
Thank you for replying!
Ah okay, that seems like it makes sense. How would I go about doing this?

I am not the best at sql, but it seems that you nowhere assigned the new trait to your new civilization, and therefore there is a new trait that is not assigned to a civilization, and thats why it is not working. look in the game‘s civilizations.xml or the other game‘s xml files to see how a trait have to be assigned to a civ.
Okay, thanks! I'll definitely look into that!

What's strange is that the mods do work as intended if I only have 1 of them enabled, with the correct building.
 
your database.log says: „...does not exist in Traits“

so i believe its actually not possible that your civ is working, even if its running without the second one. but maybe i am wrong, its been a while with xml modding for me
 
Code:
<InGameActions>
        <UpdateDatabase id="id_update">
            <Properties>
                <LoadOrder>2</LoadOrder>
            </Properties>
            <File>Data.xml</File>
        </UpdateDatabase>
</InGameActions>

You can specify a loadorder on the files in modinfo, you want the second-loading file to have a higher loadorder number than the first file (default loadorder is 0).

Alternatively put the code from the two files into one single file
 
I want to thank you both again for trying to help me out!
Unfortunatly I still have not gotten it to work, which is undoubtably because I'm just being an idiot.
I have now also tried specifying a load order on the files.
 
If you made two copies probably you have duplicated types of trait, or if only one has the trait and the other needs it, you have to depend one mod from another ( in modbuddy you can define that).

But as @criZp pointed out if noything works, make one only mod/file.
 
You are repeating the same Type Tag-Name with table "Types" when both mods are enabled, which is what this error-message group is referring to
Code:
[1559635.202] [Gameplay] ERROR: UNIQUE constraint failed: Types.Type
[1559635.202] [Gameplay] ERROR: UNIQUE constraint failed: Types.Type
Since there is no further information related to these error-messages within Database.log, the repeats are being done in an SQL file rather than an XML file.

You can never repeat a value for a "Type" in table "Types", doing so causes a fatal error when the second exactly-matching value is encountered, and the game ceases to use anything further from within the same file.

This is the root cause of error messages within Database.log related to Invalid References
Code:
[1559635.229] [Gameplay] ERROR: Invalid Reference on Buildings.TraitType - "TRAIT_CIVILIZATION_BUILDING_JSN_CHURCH" does not exist in Traits
It is the Invalid Reference error which causes the game to return you to the Main Menu after you get the pop-up error message when you attempt to run the game with both mods enabled.

When you run only one mod at a time there is no error because there is no attempt to add the same exact value for a "Type" more than once.

Adjusting LoadOrder, etc., will have no effect whatever until the offending repeat-usage is eliminated so that all the Tag-Names used in both mods are completely Unique to everything else being used in the other mod.

This is what I mean by a "Tag-Name":
Code:
Type="BUILDING_JSN_CHURCH"
Type="BUILDING_JSN_STUDIO"

………………………………………...

INSERT INTO Types  
        (Type,                                                    Kind)
VALUES    ('TRAIT_CIVILIZATION_JSN_GRIND',                        'KIND_TRAIT'),
        ('TRAIT_CIVILIZATION_BUILDING_JSN_CHURCH',            'KIND_TRAIT');
"BUILDING_JSN_CHURCH", "BUILDING_JSN_STUDIO", 'TRAIT_CIVILIZATION_JSN_GRIND', TRAIT_CIVILIZATION_BUILDING_JSN_CHURCH' are all "Tag-Names".

Without seeing the mods themselves there is really nothing else we can do constructive in attempting to diagnose and help you fix your problem.

  1. Zip the version of the mod the game is actually trying to use, which will be found as a sub-folder in ~\Documents\My Games\Sid Meier's Civilization VI\Mods. Zip the whole sub-folder for your mod. In your case you will need to zip both mods. You can copy both mod folders into one larger folder and zip that.
  2. To attach the zip to a forum post, look for a button called Upload A File when composing your thread reply: this button opens a browse menu where you can select the zipped folder to attach directly to a forum post.
 
Thank you so much for your detailed response!
I feel like I completely understand now!

I searched both mods for the same tag names, and lo and behold 'TRAIT_CIVILIZATION_JSN_GRIND' was being added to the 'Types' table as a 'Type' in both mods.
I changed the tag name in one of the mods, and now it loads into the game fine!

Thank you for taking the time to help me, and explaining it so thoroughly so I could understand!
I also just stumbled upon your Civilization 6 Modding Guide which I'm going to dive into!
 
Back
Top Bottom