Need help understanding adding/removing units to Barbarian & City State build list

Glassmage

The Desert Flame
Joined
Apr 23, 2011
Messages
1,745
Location
USA
I see these 2 code blocks that deal with whether a unit can be built by city state or spawned by barbarian camps or not. But I don't understand if they mean the same thing or opposite. For example:


XML:
#1
DELETE FROM Civilization_UnitClassOverrides
WHERE CivilizationType = 'CIVILIZATION_MINOR' AND
UnitClassType IN (
    'UNITCLASS_VP_SLINGER';



#2
INSERT INTO Civilization_UnitClassOverrides
    (CivilizationType, UnitClassType, UnitType)
VALUES
('CIVILIZATION_MINOR', 'UNITCLASS_VP_SLINGER', NULL);


So is #1 removing the unit from City-State build list and #2 that also does it (same results), or is #1 removing and #2 adding Slinger to the build list (different results)?

#2 is confusing to me because there is also a line you could write ('CIVILIZATION_MINOR', 'UNITCLASS_VP_SLINGER', UNIT_VP_SLINGER); which makes sense as adding the unit to the build list.
 
Last edited:
The data in this table represents unit replacements. So in the first case, the DELETE statement is simply removing any override for 'UNITCLASS_VP_SLINGER', meaning City-States will default to training the default unit for that class. It doesn't block them from training anything — it just means no replacement is specified.

On the other hand, the second case is the one that actually prevents City-States from training a unit of that class. When you insert an override with NULL for the UnitType, you're explicitly telling the game that City-States should not be able to train any unit for 'UNITCLASS_VP_SLINGER'.

Similarly, if you wrote ('CIVILIZATION_MINOR', 'UNITCLASS_VP_SLINGER', 'UNIT_VP_SLINGER'), that would mean City-States can specifically train 'UNIT_VP_SLINGER' instead of the default unit for that class.

So in summary:
  • #1 means no override → default unit allowed.
  • #2 means override to NULL → no unit allowed.
  • Using a specific unit → allows training that specific unit.
 
Back
Top Bottom