[Mod Request] Streamlined unit upgrade paths

Goody Hut upgrades are handled through the <GoodyHutUpgradeUnitClass> column in the <Units>-table.
Furthermore, unique units are "the same" as "normal units" as far as most of the game considers, with the exception being that they share the unitclass of another unit and are added as a Civilization_UnitClassOverrides. Long story short: they're also present in the <Units> table just like any non-unique unit

We can thus update the goody hut upgrade via the following SQL:
Code:
UPDATE Units
SET GoodyHutUpgradeUnitClass = 'UNITCLASS_SWORDSMAN'
WHERE Type = 'UNIT_SHOSHONE_PATHFINDER';

Note that the above SQL does not alter the normal gold-upgrade path of the pathfinder, as this his handled through the <Unit_ClassUpgrades>-table which we have not modified.

---
The game itself also features such alternative-path upgrades itself: The Warrior upgrades to the Spearman if upgrading via a Goody Hut, or to a Swordsman if upgrading via gold!

EDIT: Changed the invalid column name mentioned in the next two posts
 
Last edited:
Hey there @Troller0001
Thanks for your help, I just hope that you're not actually trolling me :p
I tinkered for a bit with getting this SQL to work, but to no avail. Fortunately Nutty's "My Changes" example mod instructs us to use Logs and read them (as well as pretty much every SQL tutorial I found :D) and I got this:

Spoiler Database.log :

Prepared Statements:
Current: 6
------------------------------
[864618.062] no such table: Language_zh_CN
[864618.062] In Query - insert into Language_zh_CN('Tag', 'Text') values (?, ?);
[864618.062] In XMLSerializer while updating table Language_zh_CN from file Localization/IGE_ZH_CN.xml.
[864618.125] no such column: GoodyHutUnitUpgradeClass
[864618.828] Validating Foreign Key Constraints...
[864618.828] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[864618.828] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[864618.828] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[864618.828] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[864618.828] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[864618.828] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[864618.828] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[864618.828] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[864618.828] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[864620.812] Failed Validation.
[864621.171]
-- SQLite Memory Statistics --
Memory Usage:
[Cur] [Max]
Malloc: 6358312 75950096
PageCache: 7 13
LookAside: 0 0
Scratch: 0 1

Static Buffer Overflows:
[TooLarge] [NoSpace]
PageCache: 5938800 62985384
Scratch: 0 0

Largest Allocations:
Malloc: 262144
PageCache: 1172
Scratch: 6640

Prepared Statements:
Current: 8
------------------------------
[864629.812] no such column: Type
[864629.812] In Query - select * from Natural_Wonder_Placement where Type = ? LIMIT 1


Reading this, I'm confused whether it doesn't like "GoodyHutUnitUpgradeClass" or "Type", seems conflicted to me :D
 
GoodyHutUpgradeUnitClass is the correct name of the column within table Units. This is why we don't do code from memory. The definitions of all tables are available by looking at the game's XML files. Or we can use an SQLite browser program and look at the actual game database file "Civ5DebugDatabase.db" at
C:\Users\UserName\Documents\My Games\Sid Meier's Civilization 5\cache
The definitions of the game-tables and their correct column names can generally be viewed with any SQL database viewer program, usually under a tab called "Schema" or "Pragma" or similar.
 
I figured something "minor" like that would be the case and I wanted to double check the names myself, unfortunately the game's XML files are not exactly ordered in any (at least visible to me) coherent fashion and I have no experience with modding this game so I wasn't sure where to look. When I wanted to change Brazil's border colors to match America, I found Brazils variables but for the life of me I couldn't fine USA so... yeah.

In any case you are correct and I succeeded. Thank you both for your time!
 
GoodyHutUpgradeUnitClass is the correct name of the column within table Units. This is why we don't do code from memory.
Copying over the correct name without spelling errors, even when the table is right in front of you, is another issue unfortunately :sad: :hammer2:
 
Top Bottom