[GS] Problem with increase technology mod

Bucho

Chieftain
Joined
May 18, 2020
Messages
3
Hi everyone,

Just a very casual modder with an issue I cannot find a solution.

I reused some work from Alpaca around increasing cost for technologies/civics as eras passed by. After some try and test I managed to make it work as I wanted and increased all costs. However, for some reason, I cannot manage to increase the cost for Future Era technologies/civics. I've been trying many options, doing multiple online searches, played around with LoadOrder, but I cannot figure out why it doesn't work for Future Era.

Any insight would be more than appreciated.

Sample below of the part of the mod that has the entries to increase costs for technologies:

UPDATE Technologies SET Cost = Cost*1 WHERE EraType ='ERA_ANCIENT';
UPDATE Technologies SET Cost = Cost*1.1 WHERE EraType ='ERA_CLASSICAL';
UPDATE Technologies SET Cost = Cost*1.2 WHERE EraType ='ERA_MEDIEVAL';
UPDATE Technologies SET Cost = Cost*1.4 WHERE EraType ='ERA_RENAISSANCE';
UPDATE Technologies SET Cost = Cost*1.7 WHERE EraType ='ERA_INDUSTRIAL';
UPDATE Technologies SET Cost = Cost*2.1 WHERE EraType ='ERA_MODERN';
UPDATE Technologies SET Cost = Cost*2.6 WHERE EraType ='ERA_ATOMIC';
UPDATE Technologies SET Cost = Cost*3.1 WHERE EraType ='ERA_INFORMATION';
UPDATE Technologies SET Cost = Cost*3.6 WHERE EraType ='ERA_FUTURE';


The .modinfo is:

<?xml version="1.0" encoding="utf-8"?>
<Mod id="cc58cb64-7dde-4c26-90c1-6af61baadbd6" version="1">
<Properties>
<Name>SlowerByEra</Name>
<Description>This is a brief description of the mod.</Description>
<Created>1589299419</Created>
<Teaser>This is a brief description of the mod.</Teaser>
<Authors>Bucho</Authors>
<CompatibleVersions>1.2,2.0</CompatibleVersions>
</Properties>
<Dependencies>
<Mod id="4873eb62-8ccc-4574-b784-dda455e74e68" title="Expansion: Gathering Storm" />
</Dependencies>
<InGameActions>
<UpdateDatabase id="SLOWER_BY_ERA">
<Properties>
<LoadOrder>-1</LoadOrder>
</Properties>
<File>SlowerByEra.sql</File>
</UpdateDatabase>
</InGameActions>
<Files>
<File>SlowerByEra.sql</File>
</Files>
</Mod>


Help is much appreciated.

Thanks
 
This reminded me that I needed to tackle this issue for my own mod. The costs for those techs and civics are in new tables, TechnologyRandomCosts and CivicRandomCosts. Here is what I ended up with.

Code:
--  Create dummy table for non-GS games
CREATE TABLE IF NOT EXISTS TechnologyRandomCosts (TechnologyType VARCHAR, Cost INTEGER);
--  Update random Tech costs
UPDATE TechnologyRandomCosts SET Cost=Cost*2.8;

--  Create dummy table for non-GS games
CREATE TABLE IF NOT EXISTS CivicRandomCosts (TechnologyType VARCHAR, Cost INTEGER);
--  Update random Civic costs
UPDATE CivicRandomCosts SET Cost=Cost*2.8;
 
Thanks both. Will give it a try, though I'm struggling to get a quick start that already shows technologies/civics from Future Era to see if it works fine now...
 
I had still problems with era changed tech/civic costs beginning with the banking tech. Does it still work for you from ERA_RENAISSANCE and beyond?
 
Mine works perfectly for all Techs and Civics in all versions. You must have an error or conflict somewhere. I see that you have LoadOrder is set to -1, I believe your edits are being overwritten by GS content.
 
Yes, a negative LoadOrder value will result in the code being over-written by the expansions. Negative LoadOrder numbers should only be used (like Firaxis does) for files that are defining new game-tables or are otherwise executing similar special processing command-chunks.

Code that adds, alters, or deletes individual rows within game tables should always have a LoadOrder no lower than '0', and need a LoadOrder value greater than 0 in order to not be overwritten by or kill off the code loaded by the expansions.

Firaxis is using LoadOrder values of "-100" in both expansions now to create the new tables those expansions add to the game, as well as to delete stuff not needed or wanted from the base game or the other expansion. But other than deleting conflicting contents from within some of the game tables, the code executed at these negative Load Order values does not fill in any information in the newly created tables.

The data for new tables (and existing tables that were "cleaned" earlier) is done with the default LoadOrder value of '0'.
 
I guess, I think, I know, where the error was for me. Somehow, somewhere it caches the mods. ... had some days prior also a similar problem with a world builder map, I guess also caused through the caching. To reset it, change in the .modinfo the mod id, then switch it on (in game ) again in the mods.
 
Top Bottom