[Vanilla] Settler exponential production increase

FallenPeigon

Chieftain
Joined
Dec 25, 2018
Messages
3
So I'm trying to make a mod where the settler's production increases non-linearly. By default, from what I can see, for every settler built +30 is added to the next one. My idea is to have, for example, a 25% production increase on your second settler after building your first. Then that 25% increase is then also increased by the next 25% increase when building your third settler after your second. Something like this.

80(base cost) > first settler built > 100 > second settler built > 125 > third settler built > 156 > fourth settler built 195

I think this could work I could work the increase into the base settler cost. But I don't how do that or if it's possible. An alternative I think could work is a formula like this.

(80 + (PreviousSettlersBuilt * 20)) * .25

This would go in the Units table in the column CostProgressionParam1 for the Settler. But I don't know which tag to use for previous settlers built.

Hopefully the way I explained this isn't too confusing. Thanks for any help.
 
It's not possible to create a dynamic effect like that in XML or SQL. The game will not implement an effect like
Code:
CostProgressionParam1="(80 + (PreviousSettlersBuilt * 20)) * .25"
nor
Code:
CostProgressionModel="COST_PROGRESSION_MY_NEW_FORMULA"
The available cost progression models are defined at game-level (ie, at the C++ DLL level), as is the way the column CostProgressionParam1 works. "CostProgressionParam1" must be a direct integer value and is not dynamic in the sense that it would be increased within the game's database at each copy of the unit created by an individual player. The DLL reads the values that are entered into the game's database at start-up, and internally handles adding the additional hammers-cost based on the "CostProgressionModel" and "CostProgressionParam1" values specified, but the values entered into the database itself do not change as the game is played.
 
A workaround way to do this might be to use Lua to add and then delete several Settler units. I don't know if Settlers generated through Lua increase the production cost, but ones produced via the database Modifier do. You could trigger the Modifier several times in a row and then delete those Settlers. It might be more trouble than it is worth, though.
 
Top Bottom