fitchn
Civ Fanatic
Here's the deal: I've created a new wonder for my mod that stores 100% of city growth (using the same mechanisms as the granary) so that a city will grow one pop per turn until it reaches capacity. The problem is, with the extra food spillover, the city continues to grow, even though it is starving, until the food shortage exceeds the food spillover, which results in the city then loosing the extra pop points until it is back to a maintainable level.
What I need to do is write a python script that will cap the food surplus after the city has grown (ie, I still want to keep the overflow, I just don't want the overflow to exceed the growth amount).
Obviously I want to use the onCityGrowth event handler, but I don't even know where to begin as far as finding out what variables are available to me. The psuedo code would look something like this:
Any help would be greatly appreciated!
What I need to do is write a python script that will cap the food surplus after the city has grown (ie, I still want to keep the overflow, I just don't want the overflow to exceed the growth amount).
Obviously I want to use the onCityGrowth event handler, but I don't even know where to begin as far as finding out what variables are available to me. The psuedo code would look something like this:
Code:
When the city grows {
If (Food Storage Amount > Growth Threshold Amount) {
Food Storage Amount = Growth Threshold Amount
}
}
Any help would be greatly appreciated!