Karatekid5
Warlord
For my newest custom Civilization I've decided to try writing it in SQL instead of XML since most modders make their database files with SQL these days. I've had some experience with SQL with past mods so now I have no trouble converting from XML to SQL. Most of my files have been working, with the exception of a unit file I created. This unit is a Great General replacement that has combat abilities and can upgrade into stronger versions of itself later on. However, the game refuses to add the unit to the database. Reload Unit System is checked, the file is set to OnModActivated > UpdateDatabase, I checked the entire file with a fine toothed comb and everything is set up correctly, yet the game seems to just flat out refuse it. I checked the Database Log for any errors pertaining to it and absolutely nothing comes up. The only related error is the main Civ SQL file for this custom civ reporting that the unit doesn't exist. Here's the code for the SQL file:
SQL doesn't report as many errors as XML does so it's been harder to see just what might be wrong with it. Thanks in advance to anyone who's able to help!
Code:
INSERT INTO Units
(Class, Type, Cost, Moves, Special, Combat, CombatClass, Domain, DefaultAI, Description, Civilopedia, Strategy, Help, AdvancedStartCost, GoldenAgeTurns, UnitArtInfo, IconAtlas, UnitFlagAtlas, PortraitIndex, MoveRate)
VALUES ('UNITCLASS_GREAT_GENERAL', 'UNIT_GREAT_HERO', -1, 3, 'SPECIALUNIT_PEOPLE', 14, 'UNITCOMBAT_GUN', 'DOMAIN_LAND', 'UNITAI_ATTACK', 'TXT_KEY_UNIT_GREAT_HERO', 'TXT_KEY_UNIT_GREAT_HERO_TEXT', 'TXT_KEY_UNIT_GREAT_HERO_STRATEGY', 'TXT_KEY_UNIT_HELP_GREAT_HERO', -1, 8, 'ART_DEF_UNIT_GREAT_HERO', 'UA_HIGH_ATLAS', 'UNITS_GREAT_HERO_FLAG_ATLAS', 2, 'GREAT_PERSON');
INSERT INTO Unit_AITypes
(UnitType, UnitAIType)
VALUES ('UNIT_GREAT_HERO', 'UNITAI_ATTACK'),
('UNIT_GREAT_HERO', 'UNITAI_DEFENSE');
INSERT INTO Unit_Flavors
(UnitType, FlavorType, Flavor)
SELECT ('UNIT_GREAT_HERO'), FlavorType, Flavor
FROM Unit_Flavors WHERE (UnitType = 'UNIT_GREAT_GENERAL');
INSERT INTO Unit_ClassUpgrades
(UnitType, UnitClassType)
VALUES ('UNIT_GREAT_HERO', 'UNITCLASS_HERO_LEVEL2');
INSERT INTO Unit_FreePromotions
(UnitType, PromotionType)
VALUES ('UNIT_GREAT_HERO', 'PROMOTION_MEDIC_GENERAL'),
('UNIT_GREAT_HERO', 'PROMOTION_GREAT_GENERAL'),
('UNIT_GREAT_HERO', 'PROMOTION_HEROISM');
INSERT INTO UnitGameplay2DScripts
(UnitType, SelectionSound, FirstSelectionSound)
VALUES ('UNIT_GREAT_HERO', 'AS2D_GREATHERO_SELECT', 'AS2D_BIRTH_GREATHERO');
SQL doesn't report as many errors as XML does so it's been harder to see just what might be wrong with it. Thanks in advance to anyone who's able to help!