Weird mod loading error

xDefension

Chieftain
Joined
Aug 12, 2015
Messages
13
Location
The Netherlands
Hello all,
I'm working, as you may expect, on a mod. It's supposed to add a new leader, on the select screen it shows up totally fine but as soon as I press play and it is supposed to switch over to the loading screen, it crashes. I've found this code in the lua log, which seems to show an error:
Code:
Runtime Error: C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization VI\Base\Assets\UI\FrontEnd\LoadScreen.lua:211: operator .. is not supported for nil .. string
stack traceback:
    C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization VI\Base\Assets\UI\FrontEnd\LoadScreen.lua:211: in function 'OnLoadScreenContentReady'
    [C]: in function 'func'
    [C]: in function '(anonymous)'
I also found this in the database log, which also mentions an error:
Code:
[3267885.842] [Localization]: Validating Foreign Key Constraints...
[3267885.842] [Localization]: Passed Validation.
[3267885.851] [Configuration]: Validating Foreign Key Constraints...
[3267885.852] [Configuration]: Passed Validation.
[3267897.684] [FullTextSearch]: Initializing FullTextSearch
[3267898.883] [Gameplay]: Validating Foreign Key Constraints...
[3267898.897] [Gameplay]: Passed Validation.
[3267899.833] [Configuration] ERROR: no such table: PlayerColors
[3267899.836] [Configuration] ERROR: UNIQUE constraint failed: Players.Domain, Players.CivilizationType, Players.LeaderType
[3267899.836] [Configuration]: While executing - 'insert into Players('Domain', 'CivilizationType', 'LeaderType', 'CivilizationName', 'CivilizationIcon', 'LeaderName', 'LeaderIcon', 'CivilizationAbilityName', 'CivilizationAbilityDescription', 'CivilizationAbilityIcon', 'LeaderAbilityName', 'LeaderAbilityDescription', 'LeaderAbilityIcon', 'Portrait', 'PortraitBackground') values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);'
[3267899.884] [Configuration]: In XMLSerializer while inserting row into table insert into Players('Domain', 'CivilizationType', 'LeaderType', 'CivilizationName', 'CivilizationIcon', 'LeaderName', 'LeaderIcon', 'CivilizationAbilityName', 'CivilizationAbilityDescription', 'CivilizationAbilityIcon', 'LeaderAbilityName', 'LeaderAbilityDescription', 'LeaderAbilityIcon', 'Portrait', 'PortraitBackground') with  values (StandardPlayers, CIVILIZATION_SPAIN, LEADER_FRANCISCO_FRANCO, LOC_CIVILIZATION_SPAIN_NAME, ICON_CIVILIZATION_FRANCISCO_FRANCO, LOC_LEADER_FRANCISCO_FRANCO_NAME, ICON_LEADER_FRANCISCO_FRANCO, LOC_TRAIT_CIVILIZATION_TREASURE_FLEET_NAME, LOC_TRAIT_CIVILIZATION_TREASURE_FLEET_DESCRIPTION, ICON_LEADER_FRANCISCO_FRANCO, LOC_TRAIT_LEADER_BANDO_NACIONAL_NAME, LOC_TRAIT_LEADER_BANDO_NACIONAL_DESCRIPTION, ICON_LEADER_FRANCISCO_FRANCO, LEADER_FRANCISCO_FRANCO_NEUTRAL, LEADER_GORGO_BACKGROUND, ).
[3267899.884] [Configuration]: In XMLSerializer while updating table Players from file FranciscoFranco_Config.xml.
[3267899.884] [Configuration] ERROR: UNIQUE constraint failed: Players.Domain, Players.CivilizationType, Players.LeaderType
[3267899.885] [Configuration] ERROR: UNIQUE constraint failed: PlayerItems.Domain, PlayerItems.CivilizationType, PlayerItems.LeaderType, PlayerItems.Type
[3267899.885] [Configuration] ERROR: UNIQUE constraint failed: PlayerItems.Domain, PlayerItems.CivilizationType, PlayerItems.LeaderType, PlayerItems.Type
[3267899.896] [Configuration]: Validating Foreign Key Constraints...
[3267899.896] [Configuration]: Passed Validation.
[3267918.427] [FullTextSearch]: FTS - Creating Context
[3267944.363] [Configuration] ERROR: no such table: PlayerColors
[3267944.366] [Configuration] ERROR: UNIQUE constraint failed: Players.Domain, Players.CivilizationType, Players.LeaderType
[3267944.366] [Configuration]: While executing - 'insert into Players('Domain', 'CivilizationType', 'LeaderType', 'CivilizationName', 'CivilizationIcon', 'LeaderName', 'LeaderIcon', 'CivilizationAbilityName', 'CivilizationAbilityDescription', 'CivilizationAbilityIcon', 'LeaderAbilityName', 'LeaderAbilityDescription', 'LeaderAbilityIcon', 'Portrait', 'PortraitBackground') values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);'
[3267944.366] [Configuration]: In XMLSerializer while inserting row into table insert into Players('Domain', 'CivilizationType', 'LeaderType', 'CivilizationName', 'CivilizationIcon', 'LeaderName', 'LeaderIcon', 'CivilizationAbilityName', 'CivilizationAbilityDescription', 'CivilizationAbilityIcon', 'LeaderAbilityName', 'LeaderAbilityDescription', 'LeaderAbilityIcon', 'Portrait', 'PortraitBackground') with  values (StandardPlayers, CIVILIZATION_SPAIN, LEADER_FRANCISCO_FRANCO, LOC_CIVILIZATION_SPAIN_NAME, ICON_CIVILIZATION_FRANCISCO_FRANCO, LOC_LEADER_FRANCISCO_FRANCO_NAME, ICON_LEADER_FRANCISCO_FRANCO, LOC_TRAIT_CIVILIZATION_TREASURE_FLEET_NAME, LOC_TRAIT_CIVILIZATION_TREASURE_FLEET_DESCRIPTION, ICON_LEADER_FRANCISCO_FRANCO, LOC_TRAIT_LEADER_BANDO_NACIONAL_NAME, LOC_TRAIT_LEADER_BANDO_NACIONAL_DESCRIPTION, ICON_LEADER_FRANCISCO_FRANCO, LEADER_FRANCISCO_FRANCO_NEUTRAL, LEADER_GORGO_BACKGROUND, ).
[3267944.366] [Configuration]: In XMLSerializer while updating table Players from file FranciscoFranco_Config.xml.
[3267944.366] [Configuration] ERROR: UNIQUE constraint failed: Players.Domain, Players.CivilizationType, Players.LeaderType
[3267944.366] [Configuration] ERROR: UNIQUE constraint failed: PlayerItems.Domain, PlayerItems.CivilizationType, PlayerItems.LeaderType, PlayerItems.Type
[3267944.366] [Configuration] ERROR: UNIQUE constraint failed: PlayerItems.Domain, PlayerItems.CivilizationType, PlayerItems.LeaderType, PlayerItems.Type
[3267944.366] [Configuration]: Validating Foreign Key Constraints...
[3267944.367] [Configuration]: Passed Validation.
[3267945.770] [Gameplay]: Validating Foreign Key Constraints...
[3267945.785] [Gameplay]: Passed Validation.
 
Line 211 in LoadScreen.lua is:
backgroundTexture = leaderType .. "_BACKGROUND";
leaderType must be nil here.
It is set 2 lines above:
local leaderType:string = playerConfig:GetLeaderTypeName();
So it seems that it's not actually set properly. Which corresponds to DB errors that also show some problems with leader definition.
You need to post the xml where you define the leader.
 
I think I messed up somewhere, I was using a mod that only changed a leader as a template because that looked like what I wanted to try and create. There was a lot of other crap in the files that I wasn't using or that may have been incomplete so I guess the leader definition error was in there somewhere, but I thought it had something to do with not importing art properly. With the understanding I've gathered from that "experiment" I'm now on track with jasperkitty, so thanks for your help!
 
Whilst comparing mine to Jasperkitty I found out this bit in .modinfo was missing:
Code:
  <ActionCriteria>
    <Criteria id="LeaderCriteria">
      <LeaderPlayable>StandardPlayers::LEADER_JASPER_KITTY</LeaderPlayable>
    </Criteria>
  </ActionCriteria>
So I pasted it in mine to see if that was the problem, now I no longer crash to desktop but I exit to the main menu and I can't see any indications of errors in any of the logs.. :S

Does this happen when you haven't put in art yet for certain things like leader scenes??

EDIT: I fixed this, but the first leader definition error is STILL a problem, so it would be much appreciated if anyone took a look at it!
 
Last edited:
There are plenty of mods that add a leader to an existing country, why not just clone it & input your changes? It is probably a lot faster than waiting for people to try & fathom what you have chopped out.
 
Back
Top Bottom