Broke load and gameplay fails with strange message

planetfall

Emperor
Joined
Jan 18, 2002
Messages
1,406
Location
California
I was editing a building xml file but must have put in something wrong. I can't load/start any games with error message
error starting game
one or more mods failed to load content

It was just one xml file that has the datestamp from the start of the error.

[1062115.090] [Localization] ERROR: UNIQUE constraint failed: LocalizedText.Language, LocalizedText.Tag
[1062115.090] [Localization]: While executing - 'insert into BaseGameText('Tag', 'Text') values (?, ?);'
[1062115.090] [Localization]: In XMLSerializer while inserting row into table insert into BaseGameText('Tag', 'Text') with values (LOC_CHALLENGE_11_NAME, Know Your Enemy, ).
[1062115.090] [Localization]: In XMLSerializer while updating table BaseGameText from file CurrentChallenges/04ff51bd-7859-47cf-ba04-a5093a5c8cf0/Text/ChallengeText_en_US.xml.
[1062115.090] [Localization] ERROR: UNIQUE constraint failed: LocalizedText.Language, LocalizedText.Tag
[1062120.440] [Gameplay] ERROR: FOREIGN KEY constraint failed
[1062120.440] [Gameplay] ERROR: FOREIGN KEY constraint failed
[1062120.440] [Gameplay]: Validating Foreign Key Constraints...
[1062120.458] [Gameplay] ERROR: Invalid Reference on Units.UnitType - "UNIT_
_JANISSARY" does not exist in Types
[1062120.459] [Gameplay] ERROR: Invalid Reference on UnitAiInfos.UnitType - "UNIT_SULEIMAN_JANISSARY" does not exist in Units
[1062120.459] [Gameplay] ERROR: Invalid Reference on UnitAiInfos.UnitType - "UNIT_SULEIMAN_JANISSARY" does not exist in Units
[1062120.459] [Gameplay] ERROR: Invalid Reference on UnitAiInfos.UnitType - "UNIT_SULEIMAN_JANISSARY" does not exist in Units
[1062120.459] [Gameplay] ERROR: Invalid Reference on UnitAiInfos.UnitType - "UNIT_SULEIMAN_JANISSARY" does not exist in Units
[1062120.460] [Gameplay] ERROR: Invalid Reference on UnitReplaces.CivUniqueUnitType - "UNIT_SULEIMAN_JANISSARY" does not exist in Units
[1062120.460] [Gameplay] ERROR: Invalid Reference on UnitUpgrades.Unit - "UNIT_SULEIMAN_JANISSARY" does not exist in Units
[1062120.463] [Gameplay] ERROR: Invalid Reference on Units_XP2.UnitType - "UNIT_SULEIMAN_JANISSARY" does not exist in Units
[1062120.463] [Gameplay]: Failed Validation.

I've run searches in programfiles x86 folder for
unit.type
_janissary
Unit_
class_janissary

And cant find any typos. A diff compare of buildings.xml did not show any apparent errors.
Janissary is only in 4 files
Expansion2_UnitAbilities_major.xml 2/26/23
Expansion2_Units_Major.xml 9/28/24
PolandScenario_Barbarians.xml 2/26/23
PolandScenario_Units.xml 2/26/23

Been spinning wheels too long on this one
 
Finally found it by having to try to explain what went wrong. I was looking just at syntax and once looked at date stamp, I found the file that was the issue. The file Expansion2_Units_Major.xml. I had been working on the buildings file but must have accicently saved another file which was open that I had accidently edited. Errors were 1) extra white space spliting name into two units, and 2) a removal of part of named declaration so there was zero match.

I kept this post available just in case I get stumped for a day again, or someone else is struggling to find an error.

Key: look for syntax, yes, but also datestamps to be sure you check syntax in all modified files both in base and DLC folders.

ENJOY
 
Top Bottom