Quick Modding Questions Thread

Download or subscribe to the Better District Icons mod and take a look at the SQL code therein. I remember there are issues with using UPDATE statements on table IconDefinitions because it is not actually a "table" but is rather what is called a "view" as I recall. Sukritact had to add some extra code-gymnastics to replace original icon designations with the new ones they were adding. There is as I recall in his code commands to delete things from a table called "IconAliases", which is used by the game in creating the actual information the game will use for showing Icons.

I also recall he ended up needing to use INSERT OR REPLACE INTO syntax instead of UPDATE syntax.

Thanks for the tip. I took a look, and it seems IconsAliases is used for clones. There are only a few instances in that mod where a line was deleted from that table, on districts that used the same icon as a base district. Unfortunately this doesn't help my situation.
 
My game crashed half way through the medieval era with only my mod enabled, but I can't figure out what's causing it. I'm assuming it's my mod. The error given is EXCEPTION_ACCESS_VIOLATION 0x30.

Gameeffects.txt ends with the code:

Code:
[2891108.244] [Turn: 73] Created Requirement <58219:REQUIRES_ERA_ATLEASTEXPANSION_ATOMIC> with Context <Game> and Subject <PlotYields>.
[2891108.244] [Turn: 73] Created Requirement <58220:REQUIRES_PLOT_HAS_EYE_SAHARA> with Context <Game> and Subject <PlotYields>.
[2891108.244] [Turn: 73] Created Requirement Set <58221:GAME_HAS_ATOMIC_EYE_REQUIREMENTS> with Context <Game> and Subject <PlotYields>.
[2891108.244] [Turn: 73] Created Requirement <58222:REQUIRES_ERA_ATLEASTEXPANSION_ATOMIC> with Context <Game> and Subject <PlotYields>.
[2891108.244] [Turn: 73] Created Requirement <58223:REQUIRES_PLOT_HAS_EYE_SAHARA> with Context <Game> and Subject <PlotYields>.
[2891108.244] [Turn: 73] Created Requirement Set <58224:GAME_HAS_ATOMIC_EYE_REQUIREMENTS> with Context <Game> and Subject <PlotYields>.

I don't see anything here. Is there a way to figure this out?

Getting crashes half way through a game is disheartening after all the work to make it load in the first place.

Edit: There's no Eye of the Sahara in my game. Why is it loading requirements for a wonder that does not exist in the game map?
---

When I scroll further up, I find this:

[2895508.105] [Turn: 73] Warning: Object <Player: 3> does not support interface <{B3DF7354-0054-4FA5-9423-324C7704DA9F}>.
[2895508.105] [Turn: 73] Created Requirement <62791: PLOT_IS_HILLS_REQUIREMENT> with Context <Unit: 262146, Owner: 0, SubType: 0, SubValue: 0, Type: 20 Position: 32x37> and Subject <ProposedCombat>.
[2895508.105] [Turn: 73] Created Requirement Set <62792:ETHIOPIA_PLOT_IS_HILLS_REQUIREMENTS> with Context <Unit: 262146, Owner: 0, SubType: 0, SubValue: 0, Type: 20 Position: 32x37> and Subject <ProposedCombat>.
[2895508.105] [Turn: 73] Applying effect from <1187:MENELIK_HILLS_COMBAT> to <ProposedCombat>.
[2895508.105] [Turn: 73] Warning: Object <Player: 3> does not support interface <{B3DF7354-0054-4FA5-9423-324C7704DA9F}>.

The game crashes during Player 4.

Edit: This warning seems to appear often. Maybe it's normal.
-------

Edit2: I loaded an autosave from one turn earlier, set to autoplay for 1 turn and to come back as player 4.

I proceeded without issues. The game did not crash. So there must have been some specific action that AI Player 4 was taking causing the issue. I'll update once/if it happens again.
-------

Edit3: Managed to make it crash again on turn 85. Again Player 4. Same code:

Code:
[2898980.803] [Turn: 85] Removing effect of <1003:AGENDA_HIGH_HAPPINESS> from <Player: 4>.
[2898980.804] [Turn: 85] Created Requirement <86914:REQUIRES_ERA_ATLEASTEXPANSION_ATOMIC> with Context <Game> and Subject <PlotYields>.
[2898980.804] [Turn: 85] Created Requirement <86915:REQUIRES_PLOT_HAS_EYE_SAHARA> with Context <Game> and Subject <PlotYields>.
[2898980.804] [Turn: 85] Created Requirement Set <86916:GAME_HAS_ATOMIC_EYE_REQUIREMENTS> with Context <Game> and Subject <PlotYields>.
[2898980.804] [Turn: 85] Created Requirement <86917:REQUIRES_ERA_ATLEASTEXPANSION_ATOMIC> with Context <Game> and Subject <PlotYields>.
[2898980.804] [Turn: 85] Created Requirement <86918:REQUIRES_PLOT_HAS_EYE_SAHARA> with Context <Game> and Subject <PlotYields>.
[2898980.804] [Turn: 85] Created Requirement Set <86919:GAME_HAS_ATOMIC_EYE_REQUIREMENTS> with Context <Game> and Subject <PlotYields>.

1. Regarding the first line, my mod changes the base value at which Ecstatic state triggers from 3 to 4, and amount of amenities from luxuries from 4 to 3.

Found this when searching AGENDA_HIGH_HAPPINESS:
7mgfP1X.png


Could there be something incompatible here?

2. I don't understand what's up with the Eye of the Sahara requirements being triggered.
 
Last edited:
It may not be anything at all to do with your mod. Several people I know of have been reporting similar Exception Violation errors causing their game to crash midgame since the July23rd New Frontiers update.
 
After creating a new class (one more XD)
this is what happens.
Code:
[2952735.653] [Localization]: StartupErrorMessages.xml
[2952735.653] [Localization]: Input XML does not contain database entry tags. GameData, GameInfo or Database
[2952755.410] [Localization]: Validating Foreign Key Constraints...
[2952755.411] [Localization]: Passed Validation.
[2952755.453] [Configuration]: Validating Foreign Key Constraints...
[2952755.454] [Configuration]: Passed Validation.
[2952780.216] [FullTextSearch]: Initializing FullTextSearch
[2952784.497] [Gameplay]: Validating Foreign Key Constraints...
[2952784.513] [Gameplay]: Passed Validation.
[2952788.958] [Configuration]: Validating Foreign Key Constraints...
[2952788.959] [Configuration]: Passed Validation.
[2952794.069] [HallofFame]: Database found. Checking versions...
[2952794.102] [HallofFame]: Database is up-to-date!
[2952818.765] [FullTextSearch]: FTS - Creating Context
[2952924.283] [Configuration]: Validating Foreign Key Constraints...
[2952924.284] [Configuration]: Passed Validation.
[2952932.593] [Gameplay] ERROR: UNIQUE constraint failed: BarbarianAttackForces.AttackForceType
[2952932.593] [Gameplay]: While executing - 'insert into BarbarianAttackForces('AttackForceType', 'MaxTargetDifficulty', 'SpawnRate', 'MeleeTag', 'NumMeleeUnits', 'RaidingForce') values (?, ?, ?, ?, ?, ?);'
[2952932.593] [Gameplay]: In XMLSerializer while inserting row into table insert into BarbarianAttackForces('AttackForceType', 'MaxTargetDifficulty', 'SpawnRate', 'MeleeTag', 'NumMeleeUnits', 'RaidingForce') with  values (LowDifficultyStandardRaid, DIFFICULTY_CHIEFTAIN, 2, CLASS_INFANTRY, 1, 1, ).
[2952932.593] [Gameplay]: In XMLSerializer while updating table BarbarianAttackForces from file ZaabSpicey_BarbariansUpdated.xml.
[2952932.593] [Gameplay] ERROR: UNIQUE constraint failed: BarbarianAttackForces.AttackForceType
[2952932.633] [Gameplay] ERROR: Database::XMLSerializer (ZaabSpicey_TechnologyGameplay.xml): Duplicate column names detected in <Row>. Name: Row, Value:
[2952932.633] [Gameplay]: In XMLSerializer while updating table Boosts from file ZaabSpicey_TechnologyGameplay.xml.
[2952933.229] [Gameplay] ERROR: Database::XMLSerializer (ZaabSpicey_UnitGameplay.xml): 'Row' or 'Delete' expected, got 'Upgrade'.
[2952933.229] [Gameplay]: In XMLSerializer while updating table UnitUpgrades from file ZaabSpicey_UnitGameplay.xml.
[2952933.250] [Gameplay] ERROR: UNIQUE constraint failed: UnitPromotions.UnitPromotionType
[2952933.250] [Gameplay]: While executing - 'insert into UnitPromotions('UnitPromotionType', 'Name', 'Description', 'Level', 'Column', 'Specialization', 'PromotionClass') values (?, ?, ?, ?, ?, ?, ?);'
[2952933.250] [Gameplay]: In XMLSerializer while inserting row into table insert into UnitPromotions('UnitPromotionType', 'Name', 'Description', 'Level', 'Column', 'Specialization', 'PromotionClass') with  values (PROMOTION_COMMANDO, LOC_PROMOTION_COMMANDO_NAME, LOC_PROMOTION_COMMANDO_DESCRIPTION, 2, 1, , PROMOTION_CLASS_INFANTRY, ).
[2952933.250] [Gameplay]: In XMLSerializer while updating table UnitPromotions from file ZaabSpicey_UnitPromotions.xml.
[2952933.250] [Gameplay] ERROR: UNIQUE constraint failed: UnitPromotions.UnitPromotionType
[2952933.337] [Localization] ERROR: NOT NULL constraint failed: LocalizedText.Language
[2952933.337] [Localization]: While executing - 'insert into LocalizedText('Tag', 'Text') values (?, ?);'
[2952933.337] [Localization]: In XMLSerializer while inserting row into table insert into LocalizedText('Tag', 'Text') with  values (LOC_UNIT_INFANTRY_DESCRIPTION, Modern era infantry unit., ).
[2952933.337] [Localization]: In XMLSerializer while updating table LocalizedText from file ZaabSpicey_UnitText.xml.
[2952933.337] [Localization] ERROR: NOT NULL constraint failed: LocalizedText.Language
[2952935.324] [Gameplay]: Validating Foreign Key Constraints...
[2952935.344] [Gameplay]: Passed Validation.
[2952958.041] [FullTextSearch]: FTS - Creating Context
[2952958.042] [FullTextSearch]: FTS - Creating Context
[2952959.761] [FullTextSearch]: FTS - Creating Context
[2952960.788] [FullTextSearch]: FTS - Creating Context
[2952964.204] [FullTextSearch]: FTS - Creating Context

Error. so many error even that the game runs as normal. (and not without my attempts to correct)
Ern is it possible to loan existing promotions out of the existing tree?
And is it possible to assign two or three boosts? if so using ROW is correct or not??

https://drive.google.com/file/d/1DKWd1VBdK9q3K3wXBdz6eGO9Q7Zlzk9L/view?usp=sharing

And what else do you find here? This error.. i'm sure involves adding a new class and implementing them to Barbarians as well as civs and city states to use them.
 
You haven't allowed sharing on that link.

That having been said, reading the text of the Database.log reveals what you need to fix.

"LowDifficultyStandardRaid" already exists as an AttackForceType in table BarbarianAttackForces. All additions to the table must have a unique designation for "AttackForceType" to all other rows already added into the "BarbarianAttackForces" table. From file Barbarians.xml
Code:
	<BarbarianAttackForces>
		<Row AttackForceType="LowDifficultyStandardRaid" MaxTargetDifficulty="DIFFICULTY_CHIEFTAIN" SpawnRate="2" MeleeTag="CLASS_MELEE" NumMeleeUnits="1" RaidingForce="true"/>
		........
----------------------------------------------------------

File "ZaabSpicey_TechnologyGameplay.xml" has at least one row within a table where you have stated the same column-name within the same row more than once.

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

File "ZaabSpicey_UnitGameplay.xml" has ""Upgrade" where the game expects to see "Row", "Delete", or "Update". This can be caused by forgetting to give the proper "closing" command to a <Row> opening command, or other similar syntax error.

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

File "ZaabSpicey_UnitPromotions.xml" is attempting to add a Promotion called "PROMOTION_COMMANDO" but that is not allowed because there is already a UnitPromotionType with the same designation. Each new row added to table UnitPromotions must have a unique designation for column "UnitPromotionType". You cannot share the same "UnitPromotionType" between differing designations of "PromotionClass" because you cannot get around the Unique Constraint requirement that every "UnitPromotionType" added to the table must have a designation unique to all others within the table.

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

File ZaabSpicey_UnitText.xml contains at least one row where you have neglected to state anything for the required "Language" column within table "LocalizedText".
 
OK Check the file again. i've permitted sharings now.

https://drive.google.com/file/d/1DKWd1VBdK9q3K3wXBdz6eGO9Q7Zlzk9L/view?usp=sharing


You haven't allowed sharing on that link.

"LowDifficultyStandardRaid" already exists as an AttackForceType in table BarbarianAttackForces. All additions to the table must have a unique designation for "AttackForceType" to all other rows already added into the "BarbarianAttackForces" table. From file Barbarians.xml
Code:
    <BarbarianAttackForces>
         <Row AttackForceType="LowDifficultyStandardRaid" MaxTargetDifficulty="DIFFICULTY_CHIEFTAIN" SpawnRate="2" MeleeTag="CLASS_MELEE" NumMeleeUnits="1" RaidingForce="true"/>
        ........
----------------------------------------------------------

File "ZaabSpicey_TechnologyGameplay.xml" has at least one row within a table where you have stated the same column-name within the same row more than once.
This means this "LowDifficultyStandardRaid" can't be updated to include CLASS_INFANTRY without losing CLASS_MELEE then?

File "ZaabSpicey_UnitPromotions.xml" is attempting to add a Promotion called "PROMOTION_COMMANDO" but that is not allowed because there is already a UnitPromotionType with the same designation. Each new row added to table UnitPromotions must have a unique designation for column "UnitPromotionType". You cannot share the same "UnitPromotionType" between differing designations of "PromotionClass" because you cannot get around the Unique Constraint requirement that every "UnitPromotionType" added to the table must have a designation unique to all others within the table.

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

File ZaabSpicey_UnitText.xml contains at least one row where you have neglected to state anything for the required "Language" column within table "LocalizedText".

So it means entirely new promotion tree must be written for this class?
This class is a combined class made up of CLASS_MELEE and CLASS_ANTI_CAVALRY and intended that previous unit of either class can be upgraded to this. what will happen to previous promotions earned? is it possible to 're-skill' promotions ?
 
Last edited:
I'm trying to create a total conversion mod and as a result, want to delete a lot of buildings, units, etc.
However, some of them I am planning on reusing, such as the library, temple, market etc. (still in the relevant districts).

Now I could just go <Buildings> <Delete/> <Buildings/>, but obviously that would remove those buildings that would still be used. Now of course I could go and manually add them back in, but in the interests of DRY, I was hoping there would be a way to <Delete/> and then name exceptions to the deletion. Is this possible?

I had a look through the only total conversion mod I know, Anno domini, to see if they had done so, but to be frank I was lost as to where it would be.
 
As an addition to this, what is the best method for searching the entire DebugGameplay table for specific text? Generically there seems to be some SQLite method using FTS5 but that requires manual typing of each table to add.
 
I'm trying to create a total conversion mod and as a result, want to delete a lot of buildings, units, etc.
However, some of them I am planning on reusing, such as the library, temple, market etc. (still in the relevant districts).

Now I could just go <Buildings> <Delete/> <Buildings/>, but obviously that would remove those buildings that would still be used. Now of course I could go and manually add them back in, but in the interests of DRY, I was hoping there would be a way to <Delete/> and then name exceptions to the deletion. Is this possible?

I had a look through the only total conversion mod I know, Anno domini, to see if they had done so, but to be frank I was lost as to where it would be.
When using SQL this becomes quite easy
Code:
DELETE FROM Buildings WHERE BuildingType NOT IN ("BUILDING_LIBRARY", "BUILDING_TEMPLE", "BUILDING_BANK");
XML has no real equivalent syntax. However, the problem with this sort of approach is that this will also delete all World Wonders, the Palace, and the InternalOnly buildings Firaxis uses for graphical representation of the Rocket Ship. But since anything entered as a BuildingType in table Buildings has first to exist as a "Type" in table "Types", many TC modders would likely opt for deleting the specific non-wanted items from the Types table, which will automatically remove the given item from any and all other tables.

If it were me I would only delete the specific buildings I do not want.

Not sure what you mean with your second message. There is a DebugGameplay.sqlite database where all InGame database code from mods is added, but it's not a table.
 
Previous mod coding error fixed. What I need to know now is XML files that contains descriptions (text) of Policy Card and Leader Traits

Implementing 'Infantry' class to both production enhancement policy cards (Feudal Contract, Grand Armee and Military First) to take effect on CLASS_INFANTRY Productions (which i've already perfected to the points of being playable). and to Queen Victoria's Pax Britannica trait. Rightnow coding is successfully done with no crashing errors. rightnow i'm about to make erratas on descriptions.
 
When using SQL this becomes quite easy
Code:
DELETE FROM Buildings WHERE BuildingType NOT IN ("BUILDING_LIBRARY", "BUILDING_TEMPLE", "BUILDING_BANK");
XML has no real equivalent syntax. However, the problem with this sort of approach is that this will also delete all World Wonders, the Palace, and the InternalOnly buildings Firaxis uses for graphical representation of the Rocket Ship. But since anything entered as a BuildingType in table Buildings has first to exist as a "Type" in table "Types", many TC modders would likely opt for deleting the specific non-wanted items from the Types table, which will automatically remove the given item from any and all other tables.

If it were me I would only delete the specific buildings I do not want.

Not sure what you mean with your second message. There is a DebugGameplay.sqlite database where all InGame database code from mods is added, but it's not a table.

Hi LeeS, working through your modding guide right now, so thanks for making that! Doing my own projects as well to keep motivation going.

What I meant by table was the whole database of DebugGameplay.sqlite . In short, while I'm learning how Civ works under the hood, it would be good to know all the data related to one specific thing, like the lighthouse. If I wanted to know how the lighthouse adds a trade route only when there is no market present in the city, I would go about it by somehow searching "LIGHTHOUSE" in DebugGameplay.sqlite, and finding all the tables that have that text as part of a row of the table. Then I would manually look for one related to trade routes or markets. Is there a way to do this? I'm not very experienced with SQL, but I would've thought a search function would be very important for a database.
 
Are there any tutorials on procedural map generation or even simple template mods on this matter?
 
How may I add cannon flash and smoke FX for this unit?
Rightnow i've reassign this unit DSG to Standard Naval which enables ATTACK_P and ATTACK_S but no cannon flash and smoke SFX yet

https://drive.google.com/file/d/12WZDSS475DgIWNOg-z9aDriXOvMoM9vp/view?usp=sharing

Code:
<?xml version="1.0" encoding="UTF-8" ?>
<AssetObjects..AssetInstance>
   <m_BehaviorData>
       <m_behaviorDataSets>
           <m_animationBindings>
               <m_Bindings>
                   <Element>
                       <m_SlotName text="ATTACK_P"/>
                       <m_AnimationName text="u_portugal_carrack_attackb"/>
                   </Element>
                   <Element>
                       <m_SlotName text="ATTACK_S"/>
                       <m_AnimationName text="u_portugal_carrack_attacka"/>
                   </Element>
                   <Element>
                       <m_SlotName text="DEATH_1"/>
                       <m_AnimationName text="u_portugal_carrack_deatha"/>
                   </Element>
                   <Element>
                       <m_SlotName text="DEATH_2"/>
                       <m_AnimationName text="u_portugal_carrack_deatha_idle"/>
                   </Element>
                   <Element>
                       <m_SlotName text="HERO_LEFT"/>
                       <m_AnimationName text="u_portugal_carrack_attackb"/>
                   </Element>
                   <Element>
                       <m_SlotName text="HERO_RIGHT"/>
                       <m_AnimationName text="u_portugal_carrack_attacka"/>
                   </Element>
                   <Element>
                       <m_SlotName text="IDLE_A"/>
                       <m_AnimationName text="u_portugal_carrack_idlea"/>
                   </Element>
                   <Element>
                       <m_SlotName text="IDLE_COMBAT_A"/>
                       <m_AnimationName text="u_portugal_carrack_idlea"/>
                   </Element>
                   <Element>
                       <m_SlotName text="REACT_RANGED"/>
                       <m_AnimationName text="u_portugal_carrack_bombard_defense"/>
                   </Element>
                   <Element>
                       <m_SlotName text="RUN_STOP"/>
                       <m_AnimationName text="u_portugal_carrack_stop_run"/>
                   </Element>
                   <Element>
                       <m_SlotName text="RUN_COMBAT"/>
                       <m_AnimationName text="u_portugal_carrack_run"/>
                   </Element>
                   <Element>
                       <m_SlotName text="RUN_COMBAT_STOP"/>
                       <m_AnimationName text="u_portugal_carrack_stop_run"/>
                   </Element>
                   <Element>
                       <m_SlotName text="RUN_A"/>
                       <m_AnimationName text="u_portugal_carrack_run"/>
                   </Element>
                   <Element>
                       <m_SlotName text="VICTORY"/>
                       <m_AnimationName text="u_portugal_carrack_victory"/>
                   </Element>
                   <Element>
                       <m_SlotName text="SPAWN"/>
                       <m_AnimationName text="u_portugal_carrack_combat_ready_idle"/>
                   </Element>
                   <Element>
                       <m_SlotName text="REACT_A"/>
                       <m_AnimationName text="u_portugal_carrack_bombard_defense_idle"/>
                   </Element>
                   <Element>
                       <m_SlotName text="DEFEND_P"/>
                       <m_AnimationName text="u_portugal_carrack_attackb"/>
                   </Element>
                   <Element>
                       <m_SlotName text="DEFEND_S"/>
                       <m_AnimationName text="u_portugal_carrack_attacka"/>
                   </Element>
               </m_Bindings>
           </m_animationBindings>
           <m_timelineBindings>

[ATTACH=full]566003[/ATTACH]
               <m_Bindings/>
           </m_timelineBindings>
           <m_timelines>
               <Element>
                       <m_Name text="ATTACK_P"/>
                       <m_Description text=""/>
                       <m_AnimationName text="u_portugal_carrack_attackb"/>
                       <m_fDuration>0.000000</m_fDuration>
                       <m_Triggers>
                           <Element>
                               <m_eType>SOUND</m_eType>
                               <m_Name text="1"/>
                               <m_Description text=""/>
                               <m_FXName text="Frigate_Cannon_Volley"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text=""/>
                               <m_fStartTime>0.415182</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>0</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>SOUND</m_eType>
                               <m_Name text="2"/>
                               <m_Description text=""/>
                               <m_FXName text="Frigate_Cannon_Volley"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text=""/>
                               <m_fStartTime>0.455419</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>0</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>SOUND</m_eType>
                               <m_Name text="3"/>
                               <m_Description text=""/>
                               <m_FXName text="Frigate_Cannon_Volley_Final_Shot"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text=""/>
                               <m_fStartTime>0.527729</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>0</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>SOUND</m_eType>
                               <m_Name text="7"/>
                               <m_Description text=""/>
                               <m_FXName text="ShipWoodCreak"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text=""/>
                               <m_fStartTime>1.086957</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>0</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>SOUND</m_eType>
                               <m_Name text="10"/>
                               <m_Description text=""/>
                               <m_FXName text="ShipRunSplash"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text=""/>
                               <m_fStartTime>0.595391</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>0</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>ASSET_FX</m_eType>
                               <m_Name text="47"/>
                               <m_Description text=""/>
                               <m_FXName text="FX_CannonBronze"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text="AP_PCannon_B"/>
                               <m_fStartTime>0.415179</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>0</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>ASSET_FX</m_eType>
                               <m_Name text="46"/>
                               <m_Description text=""/>
                               <m_FXName text="FX_CannonBronze"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text="AP_PCannon_A"/>
                               <m_fStartTime>0.472525</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>1</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>ASSET_FX</m_eType>
                               <m_Name text="84"/>
                               <m_Description text=""/>
                               <m_FXName text="FX_Cannonball_Trail"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text="AP_PCannon_B"/>
                               <m_fStartTime>0.415179</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>2</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>TRANSFER</m_eType>
                               <m_Name text="85"/>
                               <m_Description text=""/>
                               <m_FXName text="84"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text=""/>
                               <m_fStartTime>0.420768</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>0</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>ASSET_FX</m_eType>
                               <m_Name text="89"/>
                               <m_Description text=""/>
                               <m_FXName text="FX_Cannonball_Trail"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text="AP_PCannon_A"/>
                               <m_fStartTime>0.472525</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>2</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>TRANSFER</m_eType>
                               <m_Name text="92"/>
                               <m_Description text=""/>
                               <m_FXName text="89"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text=""/>
                               <m_fStartTime>0.477493</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>0</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>TRANSFER</m_eType>
                               <m_Name text="101"/>
                               <m_Description text=""/>
                               <m_FXName text="100"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text=""/>
                               <m_fStartTime>0.461543</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>0</m_nTrackIndex>
                           </Element>
                       </m_Triggers>
                   </Element>
                   <Element>
                       <m_Name text="ATTACK_S"/>
                       <m_Description text=""/>
                       <m_AnimationName text="u_portugal_carrack_attacka"/>
                       <m_fDuration>0.000000</m_fDuration>
                       <m_Triggers>
                           <Element>
                               <m_eType>SOUND</m_eType>
                               <m_Name text="4"/>
                               <m_Description text=""/>
                               <m_FXName text="Frigate_Cannon_Volley"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text=""/>
                               <m_fStartTime>0.416484</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>0</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>SOUND</m_eType>
                               <m_Name text="5"/>
                               <m_Description text=""/>
                               <m_FXName text="Frigate_Cannon_Volley"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text=""/>
                               <m_fStartTime>0.464592</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>0</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>SOUND</m_eType>
                               <m_Name text="6"/>
                               <m_Description text=""/>
                               <m_FXName text="Frigate_Cannon_Volley_Final_Shot"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text=""/>
                               <m_fStartTime>0.527337</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>0</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>SOUND</m_eType>
                               <m_Name text="8"/>
                               <m_Description text=""/>
                               <m_FXName text="ShipWoodCreak"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text=""/>
                               <m_fStartTime>1.086957</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>0</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>SOUND</m_eType>
                               <m_Name text="9"/>
                               <m_Description text=""/>
                               <m_FXName text="ShipRunSplash"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text=""/>
                               <m_fStartTime>0.595334</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>0</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>ASSET_FX</m_eType>
                               <m_Name text="53"/>
                               <m_Description text=""/>
                               <m_FXName text="FX_CannonBronze"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text="AP_SCannon_B"/>
                               <m_fStartTime>0.416481</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>0</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>ASSET_FX</m_eType>
                               <m_Name text="55"/>
                               <m_Description text=""/>
                               <m_FXName text="FX_CannonBronze"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text="AP_SCannon_A"/>
                               <m_fStartTime>0.473363</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>1</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>ASSET_FX</m_eType>
                               <m_Name text="86"/>
                               <m_Description text=""/>
                               <m_FXName text="FX_Cannonball_Trail"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text="AP_SCannon_B"/>
                               <m_fStartTime>0.416481</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>2</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>TRANSFER</m_eType>
                               <m_Name text="87"/>
                               <m_Description text=""/>
                               <m_FXName text="86"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text=""/>
                               <m_fStartTime>0.419634</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>0</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>TRANSFER</m_eType>
                               <m_Name text="96"/>
                               <m_Description text=""/>
                               <m_FXName text="97"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text=""/>
                               <m_fStartTime>0.483426</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>0</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>ASSET_FX</m_eType>
                               <m_Name text="97"/>
                               <m_Description text=""/>
                               <m_FXName text="FX_Cannonball_Trail"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text="AP_SCannon_A"/>
                               <m_fStartTime>0.473363</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>2</m_nTrackIndex>
                           </Element>
                           <Element>
                               <m_eType>TRANSFER</m_eType>
                               <m_Name text="109"/>
                               <m_Description text=""/>
                               <m_FXName text="108"/>
                               <m_CollectionName text=""/>
                               <m_AttachmentPointName text=""/>
                               <m_fStartTime>0.462129</m_fStartTime>
                               <m_fDuration>0.000000</m_fDuration>
                               <m_nTrackIndex>0</m_nTrackIndex>
                           </Element>
                       </m_Triggers>
                   </Element>
           </m_timelines>
           <m_attachmentPoints>
               <m_Points>
                   <Element>
                       <m_CookParams>
                           <m_Values/>
                       </m_CookParams>
                       <m_position>
                           <x>0.000000</x>
                           <y>0.000000</y>
                           <z>0.000000</z>
                       </m_position>
                       <m_orientation>
                           <x>-1.570796</x>
                           <y>3.141593</y>
                           <z>3.141593</z>
                       </m_orientation>
                       <m_Name text="AP_SCannon_A"/>
                       <m_BoneName text="point_PROJECTILE_03"/>
                       <m_ModelInstanceName text="World_Center"/>
                       <m_scale>1.000000</m_scale>
                   </Element>
                   <Element>
                       <m_CookParams>
                           <m_Values/>
                       </m_CookParams>
                       <m_position>
                           <x>0.000000</x>
                           <y>0.000000</y>
                           <z>0.000000</z>
                       </m_position>
                       <m_orientation>
                           <x>-1.570796</x>
                           <y>3.141593</y>
                           <z>3.141593</z>
                       </m_orientation>
                       <m_Name text="AP_SCannon_B"/>
                       <m_BoneName text="point_PROJECTILE_04"/>
                       <m_ModelInstanceName text="World_Center"/>
                       <m_scale>1.000000</m_scale>
                   </Element>
                   <Element>
                       <m_CookParams>
                           <m_Values/>
                       </m_CookParams>
                       <m_position>
                           <x>0.000000</x>
                           <y>-5.000000</y>
                           <z>4.500000</z>
                       </m_position>
                       <m_orientation>
                           <x>0.000000</x>
                           <y>0.000000</y>
                           <z>0.000000</z>
                       </m_orientation>
                       <m_Name text="FX_Hitloc_01"/>
                       <m_BoneName text="Bone_Root"/>
                       <m_ModelInstanceName text="World_Center"/>
                       <m_scale>1.000000</m_scale>
                   </Element>
                   <Element>
                       <m_CookParams>
                           <m_Values/>
                       </m_CookParams>
                       <m_position>
                           <x>0.000000</x>
                           <y>0.000000</y>
                           <z>4.500000</z>
                       </m_position>
                       <m_orientation>
                           <x>0.000000</x>
                           <y>0.000000</y>
                           <z>0.000000</z>
                       </m_orientation>
                       <m_Name text="FX_Hitloc_02"/>
                       <m_BoneName text="Bone_Root"/>
                       <m_ModelInstanceName text="World_Center"/>
                       <m_scale>1.000000</m_scale>
                   </Element>
                   <Element>
                       <m_CookParams>
                           <m_Values/>
                       </m_CookParams>
                       <m_position>
                           <x>0.000000</x>
                           <y>5.000000</y>
                           <z>5.500000</z>
                       </m_position>
                       <m_orientation>
                           <x>0.000000</x>
                           <y>0.000000</y>
                           <z>0.000000</z>
                       </m_orientation>
                       <m_Name text="FX_Hitloc_03"/>
                       <m_BoneName text="Bone_Root"/>
                       <m_ModelInstanceName text="World_Center"/>
                       <m_scale>1.000000</m_scale>
                   </Element>
                   <Element>
                       <m_CookParams>
                           <m_Values/>
                       </m_CookParams>
                       <m_position>
                           <x>0.000000</x>
                           <y>0.000000</y>
                           <z>0.000000</z>
                       </m_position>
                       <m_orientation>
                           <x>-1.570796</x>
                           <y>3.141593</y>
                           <z>0.000000</z>
                       </m_orientation>
                       <m_Name text="AP_PCannon_A"/>
                       <m_BoneName text="point_PROJECTILE_07"/>
                       <m_ModelInstanceName text="World_Center"/>
                       <m_scale>1.000000</m_scale>
                   </Element>
                   <Element>
                       <m_CookParams>
                           <m_Values/>
                       </m_CookParams>
                       <m_position>
                           <x>0.000000</x>
                           <y>0.000000</y>
                           <z>0.000000</z>
                       </m_position>
                       <m_orientation>
                           <x>-1.570796</x>
                           <y>3.141593</y>
                           <z>0.000000</z>
                       </m_orientation>
                       <m_Name text="AP_PCannon_B"/>
                       <m_BoneName text="point_PROJECTILE_08"/>
                       <m_ModelInstanceName text="World_Center"/>
                       <m_scale>1.000000</m_scale>
                   </Element>
               </m_Points>
           </m_attachmentPoints>
           <m_stateSet/>
       </m_behaviorDataSets>
       <m_behaviorInstances/>
       <m_dsgName text="Standard_Naval"/>
       <m_referenceGeometryNames/>
   </m_BehaviorData>
   <m_GeometrySet>
       <m_ModelInstances>
           <Element>
               <m_Name text="World_Center"/>
               <m_GeoName text="u_portugal_carrack"/>
               <m_GroupStates>
                   <Element>
                       <m_Values>
                           <m_Values>
                               <Element class="AssetObjects..ObjectValue">
                                   <m_ObjectName text="U_Portugal_Carrack_DIFF"/>
                                   <m_eObjectType>MATERIAL</m_eObjectType>
                                   <m_ParamName text="Material"/>
                               </Element>
                           </m_Values>
                       </m_Values>
                       <m_GroupName text="U_Portugal_Carrack_DIFF.dds"/>
                       <m_MeshName text="Portuguese_Carrack"/>
                       <m_StateName text="Default"/>
                   </Element>
                   <Element>
                       <m_Values>
                           <m_Values>
                               <Element class="AssetObjects..ObjectValue">
                                   <m_ObjectName text="U_Portugal_Carrack_DAMG_DIFF"/>
                                   <m_eObjectType>MATERIAL</m_eObjectType>
                                   <m_ParamName text="Material"/>
                               </Element>
                           </m_Values>
                       </m_Values>
                       <m_GroupName text="U_Portugal_Carrack_DAMG_DIFF.dds"/>
                       <m_MeshName text="Portuguese_Carrack_DAM"/>
                       <m_StateName text="Default"/>
                   </Element>
               </m_GroupStates>
           </Element>
       </m_ModelInstances>
   </m_GeometrySet>
   <m_SplineSet>
       <m_Splines/>
   </m_SplineSet>
   <m_CookParams>
       <m_Values/>
   </m_CookParams>
   <m_Version>
       <major>1</major>
       <minor>0</minor>
       <build>0</build>
       <revision>0</revision>
   </m_Version>
   <m_ParticleEffects/>
   <m_Geometries/>
   <m_Animations/>
   <m_Materials/>
   <m_ClassName text="Unit"/>
   <m_DataFiles/>
   <m_Name text="Carrack"/>
   <m_Description text=""/>
   <m_Tags/>
</AssetObjects..AssetInstance>

upload_2020-8-13_14-46-25.png
 
Last edited:
Hi LeeS, working through your modding guide right now, so thanks for making that! Doing my own projects as well to keep motivation going.

What I meant by table was the whole database of DebugGameplay.sqlite . In short, while I'm learning how Civ works under the hood, it would be good to know all the data related to one specific thing, like the lighthouse. If I wanted to know how the lighthouse adds a trade route only when there is no market present in the city, I would go about it by somehow searching "LIGHTHOUSE" in DebugGameplay.sqlite, and finding all the tables that have that text as part of a row of the table. Then I would manually look for one related to trade routes or markets. Is there a way to do this? I'm not very experienced with SQL, but I would've thought a search function would be very important for a database.
See this thread https://forums.civfanatics.com/threads/tutorial-modding-with-sqllite-studio-pc.608352/
He is specifically talking to using sqlite studio as his preferred database viewer program, but the concepts are the same regardless of whether you use a different database viewer program -- exact keystrokes will likely vary a bit as well as exactly how a different viewer program has everything laid out in its interface.
 
Where do you start for giving AI any personality for a civ? I have a religious civ mod where the AI refuses to build holy sites
 
In Moments table:
1. What is the difference between MaximumGameEra and ObsoleteEra columns?
2. Why all entries in MinimumGameEra column are Ancient Era? It makes no sense.
 
My mod is only partially working. It appears to be modifying Projects correctly, but not modifying WMDs or Expansion2_Projects at all. What have I done wrong? Is there a tutorial for modifying gameplay, rather than tutorials for adding new features?

Code:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="d9d0aaf9-5d01-4873-94a3-1253f34b61fb" version="1">
  <Properties>
    <Name>More Nukes</Name>
    <Description>Decreases the production, uranium, and gold maintenance costs of nuclear weapons by 50%. Increases range of thermonuclear ICBMs to unlimited.</Description>
    <Created>1597725307</Created>
    <Teaser>Half cost for nuclear weapons.</Teaser>
    <Authors>Alex Lamoureux</Authors>
    <CompatibleVersions>1.2,2.0</CompatibleVersions>
  </Properties>
  <Dependencies>
    <Mod id="4873eb62-8ccc-4574-b784-dda455e74e68" title="Expansion: Gathering Storm" />
  </Dependencies>
  <InGameActions>
    <UpdateDatabase id="WMDs">
   <Properties>
       <LoadOrder>300</LoadOrder>
   </Properties>
         <File>ModifyWMDs.sql</File>
    </UpdateDatabase>
    <UpdateDatabase id="Projects">
   <Properties>
       <LoadOrder>300</LoadOrder>
   </Properties>
      <File>ModifyProjects.sql</File>
    </UpdateDatabase>
    <UpdateDatabase id="Expansion2_Projects">
   <Properties>
       <LoadOrder>300</LoadOrder>
   </Properties>
      <File>ModifyExpansion2_Projects.sql</File>
    </UpdateDatabase>
  </InGameActions>
  <Files>
    <File>ModifyExpansion2_Projects.sql</File>
    <File>ModifyProjects.sql</File>
    <File>ModifyWMDs.sql</File>
    <File>MoreNukes.xml</File>
  </Files>
</Mod>

Code:
UPDATE WMDs SET Maintenance=7 WHERE WeaponType='WMD_NUCLEAR_DEVICE';
UPDATE WMDs SET Maintenance=8, ICBMStrikeRange=100 WHERE WeaponType='WMD_THERMONUCLEAR_DEVICE'

Code:
UPDATE Projects SET Cost=400 WHERE ProjectType='PROJECT_BUILD_NUCLEAR_DEVICE';
UPDATE Projects SET Cost=500 WHERE ProjectType='PROJECT_BUILD_THERMONUCLEAR_DEVICE'

Code:
UPDATE Expansion2_Projects SET StartProductionCost=5 WHERE ProjectType='PROJECT_BUILD_NUCLEAR_DEVICE';
UPDATE Expansion2_Projects SET StartProductionCost=10 WHERE ProjectType='PROJECT_BUILD_THERMONUCLEAR_DEVICE'
 
Databse.log:
Code:
[67653.464] [Gameplay] ERROR: no such table: Expansion2_Projects
The correct table-name is "Projects_XP2". The table has no column called "StartProductionCost". The definition of the table is:
Code:
CREATE TABLE "Projects_XP2" (
		"ProjectType" TEXT NOT NULL,
		"RequiredPowerWhileActive" INTEGER NOT NULL DEFAULT 0,
		"ReligiousPressureModifier" INTEGER NOT NULL DEFAULT 0,
		"UnlocksFromEffect" BOOLEAN NOT NULL CHECK (UnlocksFromEffect IN (0,1)) DEFAULT 0,
		"RequiredBuilding" TEXT,
		"CreateBuilding" TEXT,
		"FullyPoweredWhileActive" BOOLEAN CHECK (FullyPoweredWhileActive IN (0,1)),
		"MaxSimultaneousInstances" INTEGER,
		PRIMARY KEY(ProjectType),
		FOREIGN KEY (ProjectType) REFERENCES Projects(ProjectType) ON DELETE CASCADE ON UPDATE CASCADE,
		FOREIGN KEY (RequiredBuilding) REFERENCES Buildings(BuildingType) ON DELETE CASCADE ON UPDATE CASCADE,
		FOREIGN KEY (CreateBuilding) REFERENCES Buildings(BuildingType) ON DELETE CASCADE ON UPDATE CASCADE);
Tables "Projects" and "Projects_XP1" do not have columns called "StartProductionCost" either.

Column "StartProductionCost" is from table "Project_ResourceCosts".

Otherwise, your code for this works just fine for me:
Code:
UPDATE WMDs SET Maintenance=7 WHERE WeaponType='WMD_NUCLEAR_DEVICE';
UPDATE WMDs SET Maintenance=8, ICBMStrikeRange=100 WHERE WeaponType='WMD_THERMONUCLEAR_DEVICE';


UPDATE Projects SET Cost=400 WHERE ProjectType='PROJECT_BUILD_NUCLEAR_DEVICE';
UPDATE Projects SET Cost=500 WHERE ProjectType='PROJECT_BUILD_THERMONUCLEAR_DEVICE';
So you want to alter the incorrect code to
Code:
UPDATE Project_ResourceCosts SET StartProductionCost=5 WHERE ProjectType='PROJECT_BUILD_NUCLEAR_DEVICE';
UPDATE Project_ResourceCosts SET StartProductionCost=10 WHERE ProjectType='PROJECT_BUILD_THERMONUCLEAR_DEVICE';
You need to refer to Database.log to be sure you don't have syntax or other errors being reported if there is anything else in any of your files besides the code you posted, because code errors will make the game cease reading anything from within an SQL or XML file.
 
I've created a map on world builder and would like to assign a fixed city name to each tile. How can I do that?
 
The correct table-name is "Projects_XP2". The table has no column called "StartProductionCost".

Thanks, I appreciate this. I was only looking in modding.log. Where can I find the correct tables? I'd been checking C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization VI\Base\Assets\Gameplay\Data and using the names of those tables, but evidently that's not correct.
 
Back
Top Bottom