How would you set unit costs for each Era?

danielcofour

Chieftain
Joined
Jan 25, 2014
Messages
7
Basically what I want to do is something like this:

UPDATE Units SET Cost = Cost*0.7 WHERE EraType ='ERA_ANCIENT';
UPDATE Units SET Cost = Cost*0.6 WHERE EraType ='ERA_CLASSICAL';
UPDATE Units SET Cost = Cost*0.5 WHERE EraType ='ERA_MEDIEVAL';
etc...

Problem is: that won't work, since EraType is not a valid column for either Units or Buildings. I don't want to go through the entire list of units and adjust each of their costs manually, so my question would be can you achieve this somehow with SQL statements?
 
Units table itself doesn't have EraType attribute. instead PrereqTech or PrereqCivic atrributes. that values are reference of Technologies and Civics table
And Technologies and Civics tables have EraType attribute.

so, you should do JOIN tables. like this

UPDATE Units Set Cost = Units.Cost*0.7 FROM Units JOIN Technologies ON Units.PrereqTech = Technologies.TechnologyType WHERE Technologies.EraType='ERA_ANCIENT'

may not exact statement..cuz i don't know what sql syantax Civ VI adopted. ( SQLite? anyone can tell me? )
 
Last edited:
Yeah, that should work. I'll check and let you know. Thanks.

And as far as I am aware it is SQLite.
 
Back
Top Bottom