Resource change not working

QuasarNebula

Chieftain
Joined
Jul 4, 2020
Messages
10
Location
France
Hello my good friends ! It's been a while.
I've come with a new problem. I'm creating a series of mods to incorporate some RWBY leaders and civilizations. Right now I'm working on one that has a unique unit, replacing infantry, that does not cost oil, but iron.
The problem is that no matter how I turn the code it doesn't seem to work.
My theory is that by trying to "Insert into" the "units" table, I can't insert "ResourceCost" because it's not in the base game, it's in gathering storm that this exists. I was trying to update the gathering storm file then, "Expansion2_Units" but can't manage to do that. Any idea how I could do it ?

Here is some of the code if you don't want to look in the document :
INSERT INTO Units ( UnitType, Name, Description, TraitType, BaseMoves, Cost, PurchaseYield, AdvisorType, Combat, RangedCombat, Range, BaseSightRange, ZoneOfControl, Domain, FormationClass, PromotionClass, Maintenance, MandatoryObsoleteTech, PrereqTech, PrereqCivic ) SELECT 'UNIT_QUA_ATLESIAN_KNIGHT', -- UnitType 'LOC_UNIT_QUA_ATLESIAN_KNIGHT_NAME', -- Name 'LOC_UNIT_QUA_ATLESIAN_KNIGHT_DESCRIPTION', -- Description 'TRAIT_CIVILIZATION_QUA_ATLESIAN_KNIGHT', -- TraitType BaseMoves, Cost - 130, PurchaseYield, AdvisorType, Combat, RangedCombat, Range, BaseSightRange, ZoneOfControl, Domain, FormationClass, PromotionClass, Maintenance - 5, MandatoryObsoleteTech, PrereqTech, PrereqCivic FROM Units WHERE UnitType = 'UNIT_INFANTRY'; INSERT INTO UnitReplaces INSERT INTO Units_XP2 ( StrategicResource, ResourceCost ) SELECT 'RESOURCE_IRON', '20' FROM Units_XP2 WHERE UnitType = 'UNIT_QUA_ATLESIAN_KNIGHT';


And thanks for any help provided !
 
Last edited:

maconnolly

Warlord
Joined
Jun 3, 2019
Messages
199
I think you've got your columns a bit mixed up, in terms of what-goes-where.

From what you've shared in the post itself, the following bit is not correct:

Code:
INSERT INTO Units_XP2    
(        StrategicResource,        ResourceCost        ) 
SELECT    'RESOURCE_IRON',        '20' 
FROM    Units_XP2 
WHERE    UnitType = 'UNIT_QUA_ATLESIAN_KNIGHT';

The 'StrategicResource' column is a column from the main Units table. So you need to specify it in there. Simply add it to your existing INSERT INTO Units entry and specify 'RESOURCE_IRON' as the value.

Then, you need to insert two columns into the Units_XP2 table, which are UnitType and ResourceCost. In your code above, you're instructing it to look for an existing entry WHERE UnitType = 'UNIT_QUA_ATLESIAN_KNIGHT', but no such entry will exist (unless you've added it elsewhere).

The easiest way will be to do:

Code:
INSERT INTO Units_XP2
(UnitType, ResourceCost)
VALUES ('UNIT_QUA_ATLESIAN_KNIGHT', 20);

Hope that helps.
 
Top Bottom