Trying to Get a Building to Create Relic on Completion

CyberCommander

Chieftain
Joined
Jan 11, 2019
Messages
3
Hello Civ Fanatics forum. I am working on a mod to emulate some D&D characters and their organizations. For the first one I am doing I am making their Unique Building be a magic item forge. The Forge replaces the Workshop and on completion, it is supposed to grant the player a relic while also having the slot in the workshop to store it. Currently, the building is working with the exception of actually granting the relic. I copied the GoodyHut version of how that works for this and don't see many differences in the code. I am about 90% sure this is probably being caused by a syntax error that I am missing but after a long while of staring at my code, I can't find anything mismatching. If anyone can see an issue with the code or knows that maybe this way of doing it just won't work please give me the heads up.

Spoiler :

<?xml version="1.0" encoding="utf-8"?>
<GameInfo>

<Types>
<Row Type="ARTIFACT_FORGE" Kind="KIND_BUILDING"/>
</Types>

<BuildingReplaces>
<Row CivUniqueBuildingType="ARTIFACT_FORGE" ReplacesBuildingType="BUILDING_WORKSHOP"/>
</BuildingReplaces>

<Buildings>
<Row BuildingType="ARTIFACT_FORGE" Name="LOC_ARTIFACT_FORGE_NAME" Description="LOC_ARTIFACT_FORGE_DESCRIPTION" PrereqTech="TECH_APPRENTICESHIP" PrereqDistrict="DISTRICT_INDUSTRIAL_ZONE" PurchaseYield="YIELD_GOLD" Cost="175" AdvisorType="ADVISOR_GENERIC" CitizenSlots="1" Maintenance="1" TraitType="TRAIT_CIVILIZATION_ARTIFACT_FORGE"/>
</Buildings>

<Building_GreatWorks>
<Row BuildingType="ARTIFACT_FORGE" GreatWorkSlotType="GREATWORKSLOT_RELIC" NumSlots="1"/>
</Building_GreatWorks>

<Building_YieldChanges>
<Row BuildingType="ARTIFACT_FORGE" YieldType="YIELD_PRODUCTION" YieldChange="2"/>
</Building_YieldChanges>

<Building_GreatPersonPoints>
<Row BuildingType="ARTIFACT_FORGE" GreatPersonClassType="GREAT_PERSON_CLASS_ENGINEER" YieldChange="1"/>
</Building_GreatPersonPoints>

<BuildingModifiers>
<Row>
<BuildingType>ARTIFACT_FORGE</BuildingType>
<ModifierId>ARTIFACT_FORGE_GRANT_RELIC</ModifierId>
</Row>
</BuildingModifiers>

<Modifiers>
<Row>
<ModifierId>ARTIFACT_FORGE_GRANT_RELIC</ModifierId>
<ModifierType>MODIFIER_PLAYER_GRANT_RELIC</ModifierType>
<RunOnce>true</RunOnce>
<Permanent>true</Permanent>
</Row>
</Modifiers>

<ModifierArguments>
<Row>
<ModifierId>ARTIFACT_FORGE_GRANT_RELIC</ModifierId>
<Name>Amount</Name>
<Value>1</Value>
</Row>
</ModifierArguments>


</GameInfo>
 
If you believe there is a syntax error the first place to look is Database.log for a report of an error. (C:\Users\[YourUserName]\Documents\My Games\Sid Meier's Civilization VI\Logs/Database.log)

I don't see an obvious syntax error in the code you've posted, though.

Bear in mind that there are a limited number of relics available to any one playthrough of the game. Once you exhaust these there are no more Relics created regardless of the source.
 
Yeah, I did know about the Relic limit which is why I may be trying to find a way to change it to artifacts after I iron this out, though I was starting up a Renaissance Era game so that I could instantly build the Forge to avoid that. As for the logs, this turned up:

Spoiler :


[1376018.435] [Localization]: StartupErrorMessages.xml
[1376018.435] [Localization]: Input XML does not contain database entry tags. GameData, GameInfo or Database
[1376020.503] [Localization]: Validating Foreign Key Constraints...
[1376020.503] [Localization]: Passed Validation.
[1376020.510] [Configuration]: Validating Foreign Key Constraints...
[1376020.510] [Configuration]: Passed Validation.
[1376031.425] [FullTextSearch]: Initializing FullTextSearch
[1376031.687] [Gameplay]: Validating Foreign Key Constraints...
[1376031.698] [Gameplay]: Passed Validation.
[1376032.299] [Configuration] ERROR: no such table: Types
[1376032.299] [Configuration]: In Query - insert into Types('Type', 'Kind') values (?, ?);
[1376032.299] [Configuration]: In XMLSerializer while updating table Types from file Template_Buildings.xml.
[1376032.299] [Configuration] ERROR: no such table: Types
[1376032.299] [Configuration]: In Query - insert into Types('Type', 'Kind') values (?, ?);
[1376032.299] [Configuration]: In XMLSerializer while updating table Types from file Template_Units.xml.
[1376032.671] [Configuration]: Validating Foreign Key Constraints...
[1376032.671] [Configuration]: Passed Validation.
[1376050.154] [FullTextSearch]: FTS - Creating Context
[1376060.688] [Configuration] ERROR: no such table: Types
[1376060.688] [Configuration]: In Query - insert into Types('Type', 'Kind') values (?, ?);
[1376060.688] [Configuration]: In XMLSerializer while updating table Types from file Template_Buildings.xml.
[1376060.689] [Configuration] ERROR: no such table: Types
[1376060.689] [Configuration]: In Query - insert into Types('Type', 'Kind') values (?, ?);
[1376060.689] [Configuration]: In XMLSerializer while updating table Types from file Template_Units.xml.
[1376060.691] [Configuration]: Validating Foreign Key Constraints...
[1376060.691] [Configuration]: Passed Validation.
[1376062.779] [Gameplay] ERROR: table Building_GreatPersonPoints has no column named YieldChange
[1376062.779] [Gameplay]: In Query - insert into Building_GreatPersonPoints('BuildingType', 'GreatPersonClassType', 'YieldChange') values (?, ?, ?);
[1376062.779] [Gameplay]: In XMLSerializer while updating table Building_GreatPersonPoints from file Template_Buildings.xml.
[1376062.814] [Gameplay]: Validating Foreign Key Constraints...
[1376062.827] [Gameplay]: Passed Validation.
[1376068.496] [FullTextSearch]: FTS - Creating Context
[1376068.677] [FullTextSearch]: FTS - Creating Context
[1376069.182] [FullTextSearch]: FTS - Creating Context
[1376122.094] [Configuration] ERROR: no such table: Types
[1376122.094] [Configuration]: In Query - insert into Types('Type', 'Kind') values (?, ?);
[1376122.094] [Configuration]: In XMLSerializer while updating table Types from file Template_Buildings.xml.
[1376122.094] [Configuration] ERROR: no such table: Types
[1376122.094] [Configuration]: In Query - insert into Types('Type', 'Kind') values (?, ?);
[1376122.094] [Configuration]: In XMLSerializer while updating table Types from file Template_Units.xml.
[1376122.507] [Configuration]: Validating Foreign Key Constraints...
[1376122.507] [Configuration]: Passed Validation.
[1376124.613] [FullTextSearch]: FTS - Creating Context




From what it looks like it is thinking that I am missing GameData/GameInfo declarations even though I have them. Should put up a note that I started this mod out using the template from https://forums.civfanatics.com/threads/how-to-create-your-own-civilization.621377/ And I did update it for Rise and Fall with the Domain changes in the Config.
 
Code:
[1376062.779] [Gameplay] ERROR: table Building_GreatPersonPoints has no column named YieldChange
 [1376062.779] [Gameplay]: In Query - insert into Building_GreatPersonPoints('BuildingType', 'GreatPersonClassType', 'YieldChange') values (?, ?, ?);
 [1376062.779] [Gameplay]: In XMLSerializer while updating table Building_GreatPersonPoints from file Template_Buildings.xml.
It's the sort of thing that is easy to overlook when just reading someone's code.

Firaxis has defined that table and it's columns as
Code:
CREATE TABLE "Building_GreatPersonPoints" (
		"BuildingType" TEXT NOT NULL,
		"GreatPersonClassType" TEXT NOT NULL,
		"PointsPerTurn" INTEGER NOT NULL DEFAULT 0,
       ..................
No other column-names can be used with the table, so this chunk of code causes a fatal syntax error and the game does not read anything further from within the file:
Code:
<Building_GreatPersonPoints>
 <Row BuildingType="ARTIFACT_FORGE" GreatPersonClassType="GREAT_PERSON_CLASS_ENGINEER" YieldChange="1"/>
 </Building_GreatPersonPoints>
Your modifier therefore never works because the game can never load to the point in your file where you have created and assigned the modifier.
 
This error message comes from Firaxis and will be generated even when no mods are active
Code:
[1376018.435] [Localization]: Input XML does not contain database entry tags. GameData, GameInfo or Database
You can ignore this message in Database.log since everyone gets it. Firaxis gets to do different stuff than modders, and somewhere along about 1 patch or two before the release of R&F this error message starting popping up in everyone's log, even though it has no apparent detrimental effects on any base-game language files being loaded properly.

The errors you are getting that start out with "[Configuration]" are because you or someone else is attempting to use "UpdateDatabase" in the FrontEnd actions for files whose code does not belong in the FrontEnd (ie, "Configuration") database. The rule is if an XML or SQL file's code belongs to the FrontEnd (ie, Settings) "UpdateDatbase" then by definition it cannot also belong to the InGame (ie, Components) "UpdateDatabase" and vice versa.
 
Top Bottom