[GS] Mod Issues: Unique District not appearing in game{RESOLVED}

tkbean

Chieftain
Joined
Jan 28, 2020
Messages
9
I have create a mod for a new civilizations with a unique district replacing the neighbourhood. I need some advise on creating unique districts as my unique district is not appearing in game.

By not appearing in game, I mean that it is not replacing the neighbourhood at all.

The zip file with game logs and the mod based on Keniisu's and Civitas SQL template is attached. Thank you.
 

Attachments

  1. Syntax errors
    Code:
    INSERT INTO Districts	
    		(DistrictType,	Name,	PrereqTech, PrereqCivic,	Coast, Description, Cost,	RequiresPlacement,	RequiresPopulation,		NoAdjacentCity,	CityCenter, Aqueduct,InternalOnly,ZOC,FreeEmbark,HitPoints,CaptureRemovesBuildings,CaptureRemovesCityDefenses,PlunderType,PlunderAmount,TradeEmbark,MilitaryDomain,CostProgressionModel,CostProgressionParam1,TraitType,Appeal,Housing,Entertainment,OnePerCity,AllowsHolyCity,Maintenance,AirSlots,CitizenSlots,TravelTime,CityStrengthModifier,AdjacentToLand,CanAttack,AdvisorType,CaptureRemovesDistrict,MaxPerPlayer)
    SELECT 'DISTRICT_TKB_HDB_ESTATE', 'LOC_DISTRICT_TKB_HDB_ESTATE_NAME', PrereqTech, PrereqCivic, Coast, 'LOC_DISTRICT_TKB_HDB_ESTATE_DESCRIPTION', Cost/2, RequiresPlacement, RequiresPopulation, NoAdjacentCity, CityCenter, Aqueduct,InternalOnly,ZOC,FreeEmbark,HitPoints,CaptureRemovesBuildings,CaptureRemovesCityDefenses,PlunderType,PlunderAmount,TradeEmbark,MilitaryDomain,CostProgressionModel,CostProgressionParam1,'TRAIT_CIVILIZATION_TKB_HDB_ESTATE',Appeal,Housing=10,Entertainment=3,OnePerCity,AllowsHolyCity,Maintenance,AirSlots,CitizenSlots,TravelTime,CityStrengthModifier,AdjacentToLand,CanAttack,AdvisorType,CaptureRemovesDistrict,MaxPerPlayer
    • Every chunk of SQL code requires a terminating semi-colon character
    • SELECT syntax requires a FROM designation. You've commented the only FROM command near the incorrect chunk so the game's database has no way to achieve the SELECT command.
    The error(s) are reported here in Database.log
    Code:
    [4224419.770] [Gameplay] ERROR: near "INSERT": syntax error
    And we can track back to the file where the error is located by comparing the leading timestamps to those in Modding.log:
    Code:
    [4224419.770] UpdateDatabase - Loading Core/Civilization_UI.sql
    [4224419.770] Warning: UpdateDatabase - Error Loading SQL.
  2. Syntax error in the Leader file
    Code:
    INSERT INTO	CityNames
    		(CivilizationType,				LeaderType,				SortIndex,	CityName						)
    VALUES	('CIVILIZATION_TKB_SINGAPORE',	'LEADER_TKB_LKY',	-1,			'LOC_CITY_NAME_TKB_SINGAPORE_1'		),
    You still have a comma instead of a semi-colon. Which results in this error in database.log
    Code:
    [4224419.773] [Gameplay] ERROR: near "
    
    ": syntax error
    Which tracks to this file as shown in Modding.log
    Code:
    [4224419.772] UpdateDatabase - Loading Leader/Leader_Core.sql
    [4224419.773] Warning: UpdateDatabase - Error Loading SQL.
  3. Missing commas here
    Code:
    INSERT INTO	TraitModifiers	
    		(TraitType,								ModifierId										)
    VALUES	('TRAIT_LEADER_FROM_THIRD_WORLD_TO_FIRST', 'TRAIT_SG_CITY_PROJECTS_PRODUCTION_BOOST'),
    		('TRAIT_LEADER_FROM_THIRD_WORLD_TO_FIRST', 'TRAIT_SG_CULTURE_BONUS_FROM_TRADE_ROUTE_TO_ALLY')
    		('TRAIT_LEADER_FROM_THIRD_WORLD_TO_FIRST', 'TRAIT_SG_SCIENCE_BONUS_FROM_TRADE_ROUTE_TO_ALLY')
    		('TRAIT_LEADER_FROM_THIRD_WORLD_TO_FIRST', 'TRAIT_SG_FAVOR_BONUS_FROM_TRADE_ROUTE_TO_ALLY')
    		('TRAIT_LEADER_FROM_THIRD_WORLD_TO_FIRST','TRAIT_SG_ONE_ENVOY_POINT_PER_TURN');
    Reported by this error message in Database.log
    Code:
    [4224419.774] [Gameplay] ERROR: near "(": syntax error
    Which tracks to this line in Modding.log
    Code:
    [4224419.773] UpdateDatabase - Loading Leader/Leader_UA.sql
    [4224419.774] Warning: UpdateDatabase - Error Loading SQL.
  4. In Database language "near" means just prior to the specified character(s)
You have to compare the error messages in Database log to those in Modding log and then you have to chase down the errors within the files that are relevant to the error-message as being reported in Modding log. There are numerous SQL language references/tutorials available on the internet. You need to study them so you understand what it is that your code is telling the game's SQL database to do.
 
Thank you so much. I have made the amendments and the district is appearing in the game now. I really appreciate that you take the time to not only spot the issues but also explain how to read the logs. I think I will be able to spot some of my own errors by reading the logs now. I will definitely follow up on the suggestion to learn more about SQL databases.
 
Back
Top Bottom