Cannot find the Syntax Error

Andrew Godfrey

Chieftain
Joined
Apr 10, 2018
Messages
5
Okay so I'm receiving a 'ERROR: near "and": syntax error' and 'ERROR: near "(": syntax error'. The second one I've tracked down to my GameDefines.sql, but can't seem to find the line of code with the issue. As for the first issue, I think it might be in either my Unit.xml or Buildings.xml (or both?), but again have no idea what the issue is. I'll also link my ArtDef files for both Units and Buildings since the first error popped up after creating those. I know this is a lot of info to sort through, but I have been up and down this code and can't seem to figure it out. I might just be missing something obvious, but if so I haven't figured it out over the last two days. Also the ArtDef, SQL, and Log files are saved as Txt files so that I can upload them here.
 

Attachments

You can't have spaces in the ID names of your actions. This issue is reported as a syntax error in database.log.

If you look at modding.log the timestamp [2924529.568] from the database.log error tracks to these two lines
Code:
[2924529.567] Applying Component - Units and Buildings (UpdateDatabase)
[2924529.568] ERROR: Failed to create database save point.

As far as your SQL file goes:
Code:
INSERT INTO Types	
	(Type,					Kind)
VALUES	('TRAIT_LEADER_ARG_ANDIR_HUNT',		'KIND_TRAIT');	
	('TRAIT_HOLY_SITE_FOREST_FOOD',		'KIND_MODIFIER');
	('TRAIT_HOLY_SITE_FOREST_HOUSING',	'KIND_MODIFIER');
Yo have two ";" where you need "," : look through the rest of the file very carefully for similar errors.
 
Thank you! I have obviously been worn out by all this because I had already made the SQL fix and forgotten haha. Anyway now I keep getting this issue.
Code:
[3010942.383] [Localization]: StartupErrorMessages.xml
[3010942.383] [Localization]: Input XML does not contain database entry tags. GameData, GameInfo or Database
[3010959.370] [Localization]: Validating Foreign Key Constraints...
[3010959.371] [Localization]: Passed Validation.
[3010959.391] [Configuration]: Validating Foreign Key Constraints...
[3010959.391] [Configuration]: Passed Validation.
[3010977.403] [FullTextSearch]: Initializing FullTextSearch
[3010980.634] [Gameplay]: Validating Foreign Key Constraints...
[3010980.656] [Gameplay]: Passed Validation.
[3010984.202] [Configuration]: Validating Foreign Key Constraints...
[3010984.203] [Configuration]: Passed Validation.
[3011013.620] [FullTextSearch]: FTS - Creating Context
[3011026.288] [Configuration]: Validating Foreign Key Constraints...
[3011026.289] [Configuration]: Passed Validation.
[3011161.661] [Gameplay] ERROR: UNIQUE constraint failed: Modifiers.ModifierId
[3011161.661] [Gameplay] ERROR: UNIQUE constraint failed: Modifiers.ModifierId
[3011162.952] [Gameplay] ERROR: FOREIGN KEY constraint failed
[3011162.952] [Gameplay] ERROR: FOREIGN KEY constraint failed
[3011162.952] [Gameplay]: Validating Foreign Key Constraints...
[3011162.975] [Gameplay] ERROR: Invalid Reference on Traits.TraitType - "TRAIT_CIVILIZATION_BUILDING_ARG_IQ_TEMPLE" does not exist in Types
[3011162.975] [Gameplay] ERROR: Invalid Reference on Traits.TraitType - "TRAIT_CIVILIZATION_UNIT_DHER_BIG_GAME_HUNTER" does not exist in Types
[3011162.975] [Gameplay] ERROR: Invalid Reference on Traits.TraitType - "TRAIT_CIVILIZATION_UNIT_DHER_HUNTER" does not exist in Types
[3011162.976] [Gameplay] ERROR: Invalid Reference on TraitModifiers.ModifierId - "TRAIT_HOLY_SITE_FOREST_FOOD" does not exist in Modifiers
[3011162.976] [Gameplay] ERROR: Invalid Reference on TraitModifiers.ModifierId - "TRAIT_HOLY_SITE_FOREST_HOUSING" does not exist in Modifiers
[3011162.983] [Gameplay]: Failed Validation.
[3011175.873] [Configuration]: Validating Foreign Key Constraints...
[3011175.873] [Configuration]: Passed Validation.
[3011177.296] [FullTextSearch]: FTS - Creating Context
[3011180.114] [FullTextSearch]: FTS - Creating Context
As per the SQL I posted all of those things should be there, yet I still get these issues.
 
Code:
ERROR: UNIQUE constraint failed: Modifiers.ModifierId
tells you that you are trying to repeat-define a ModifierId that already exists in the base-game (or DLC) or that you have already defined elsewhere in your mod, or that some other mod-maker has already defined in some other mod that you currently have enabled.

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

Code:
ERROR: UNIQUE constraint failed: TableName.ColumnName
will always mean you are trying to add something that already exists within a given table. "TableName" will at least tell you which game-table you are attempting to add info to, and "ColumnName" will tell you which column is getting repeat info within that table.

The game will cease reading anything more into the database from the file where the error occurs, and this is often the root cause of getting ERROR: Invalid Reference on SecondTableName.SecondColumnName errors reported in the database. Invalid Reference errors always shove you back to the main menu but are almost never themselves the root cause of the issue.

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

Invalid Reference errors are only concerned with whether or not an item has been successfully loaded into the game's database by your mod, not whether the text of the mod's XML/SQL code contains the item that is reported as "not existing".
 
Last edited:
Back
Top Bottom