Sid Meier's Civilization VI

Sid Meier's Civilization VI

Warfare Expanded Complete Edition
Flactine 5 Feb, 2020 @ 8:59pm
UnitUpgrades Broken
All WE units can't be upgrades to Vanilla units.
I tried put "INSERT INTO UnitUpgrades" table into a independence .sql file, then the Upgrades is worked.
Last edited by Flactine; 21 Feb, 2020 @ 1:47am
< >
Showing 1-15 of 20 comments
@Flactine
How did you get it to work? I created a new .sql file, then called it WarfareExpanded_Unit_Upgrades.sql and put it right next to the other files in the data folder for the mod. Into the file I just copied the INSERT INTO UnitUpgrades (Unit, UpgradeUnit) table. I did not delete the old table in the WarfareExpanded_Units.sql file. What am I doing wrong?
Flactine 11 Feb, 2020 @ 8:22pm 
@tenthousandimmortals
You should also edit .modinfo file:
Add your SQL into <Files> and <UpdateDatabase id="Gameplay">
Hizkiyahu  [developer] 12 Feb, 2020 @ 11:55pm 
This needs to be done in the WarfareExpanded_Text_zh_Hans_CN.xml file not WarfareExpanded_Units.sql
Hizkiyahu  [developer] 13 Feb, 2020 @ 4:30am 
I noticed he bug is also in the HK file as well. Should be fixed now with the latest update.
Kajaker 14 Feb, 2020 @ 11:14pm 
After the latest update unit upgrade is broken. I can not upgrade many units any longer.
LionQ 16 Feb, 2020 @ 7:11am 
Originally posted by Kajaker:
After the latest update unit upgrade is broken. I can not upgrade many units any longer.
I'm running into the same problem. None of my Units can upgrade. :steamsad:
Hizkiyahu  [developer] 17 Feb, 2020 @ 12:13am 
OK I think I have a fix here. Edit ACT.sql in the ACT mod and change
INSERT INTO Units_XP2
(UnitType, CanEarnExperience, CanFormMilitaryFormation)
VALUES ('UNIT_AIRCRAFT_CARRIER', 0, 0);

to

INSERT OR REPLACE INTO Units_XP2
(UnitType, CanEarnExperience, CanFormMilitaryFormation)
VALUES ('UNIT_AIRCRAFT_CARRIER', 0, 0);

then edit ACTweak.modinfo and add

<Properties>
<LoadOrder>99900</LoadOrder>
</Properties>

to

<UpdateDatabase id="NewAction">
***** INSERT HERE *****
<File>ACT.sql</File>
</UpdateDatabase>

Then remove reference to ACT_MOD.sql as it is not needed.

Upgrades will work again and logs will be clean.
Last edited by Hizkiyahu; 17 Feb, 2020 @ 12:21am
Cobber 17 Feb, 2020 @ 5:08am 
Following Hizkiyahu's instructions above I can confirm that it has definitely cleaned my database log of a couple of Unique Constraint Failure references, so I believe that aspect of this fix has worked as desired and intended. I cannot comment on the upgrades working themselves per se, as I have only just started a new game and haven't reached that point in it yet. I will advise once I have reached that point on whether that aspect of the fix worked as desired or not.
Cobber 17 Feb, 2020 @ 5:13am 
This fix has also cleaned the modding and lua logs as far as I can see.
ThreeFourOneDP 18 Feb, 2020 @ 12:50am 
Since I don't know where else to bring this up, I attempted to make a mod (first time for civ 6) which would go along with this on (for myself) in an attempt to prevent being able to learn techs that unlock units 2 up in the promotion line, making it a requirement to learn the 1st upgrade before being able to research tech required for the 3rd upgrade. I adjusted the 'prerequisite tech' stuff, but it didn't seem to make a difference in my game. I have completed the mod and the files are good, but it doesn't seem to work upon applying it. Any chance you could help me figure out what i did wrong?
(Edit) The issue may be that i adjusted the base game (vanilla) files as opposed to the Gathering Storm files. Problem is, when i go to the tech files for the expansions there is limited info and little to nothing on prerequisite techs which led me to believe the base game files would do the trick...idk though.
Last edited by ThreeFourOneDP; 18 Feb, 2020 @ 1:39am
Hizkiyahu  [developer] 18 Feb, 2020 @ 2:24am 
It is a bit risky directly editing base game files. I would recommend making a mod and use it to update the database. Sometimes if you are making a mod like this you may need to start a new game for the mod to apply.
ThreeFourOneDP 18 Feb, 2020 @ 8:05am 
Originally posted by Hizkiyahu:
It is a bit risky directly editing base game files. I would recommend making a mod and use it to update the database. Sometimes if you are making a mod like this you may need to start a new game for the mod to apply.
ya sorry if i wasnt clearer but i was making a mod, just based on the vanilla files as opposed to the DLC files
GLB_TH 19 Feb, 2020 @ 1:49am 
I use R&F 1.0.0.341 (443561), unit upgrades where broken since a few days. I finally found the bug (after learning a bit of sql and civ 6 modding). The table Units_XP2 did not exist and caused the bug. I added the line

CREATE TABLE IF NOT EXISTS Units_XP2 (UnitType VARCHAR, ResourceMaintenanceAmount INTEGER, ResourceCost INTEGER, ResourceMaintenanceType VARCHAR, TourismBomb INTEGER, CanEarnExperience BOOLEAN, TourismBombPossible BOOLEAN, CanFormMilitaryFormation BOOLEAN, MajorCivOnly BOOLEAN);

(that I found WE_Armored_Assault_Units.sql) in the file WarfareExpanded_Units.sql
Hizkiyahu  [developer] 20 Feb, 2020 @ 11:18pm 
Not sure why this was an issue as Units_XP2 in not used or needed by R&F so it should not need this table.
GLB_TH 21 Feb, 2020 @ 1:27am 
The line that caused the bug (in WarfareExpanded_Units.sql) is

DELETE FROM Units_XP2 WHERE UnitType = 'UNIT_INFANTRY' AND EXISTS (SELECT name FROM sqlite_master WHERE type='table' AND name='Units_XP2');

It can not execute with R&F because Units_XP2 does not exist. And them all subsequent lines are not executed. (It seems that you can not write DELETE FROM table ... if the table does not exist even with a WHERE statement that test the table existence).

There is the same problem in the file WarfareExpanded_Units_Changes.sql with an UPDATE statement:

UPDATE Units_XP2 SET ResourceMaintenanceType = 'RESOURCE_OIL'
WHERE UnitType ='UNIT_BATTLESHIP' AND EXISTS (SELECT name FROM sqlite_master WHERE type='table' AND name='Units_XP2');

and none of the subsequent lines are executed since this line caused a bug. But the UnitsUpgrade table is normaly modified after this line...

Another way to deal with the problem is likely to change the order of the statements in the files : puting references to Units_XP2 at the end. But I prefer the solution I wrote in the previous message : creating the table because it prevent the bug.
< >
Showing 1-15 of 20 comments
Per page: 1530 50