The calculation for city unhealthiness/unhappiness in the source code

kairob

Biohazard
Joined
May 26, 2005
Messages
3,085
Location
The North
Basically I want extra unhappiness and unhealthiness from cities larger than 10 and was wondering if anybody could help me to implement this as SDK type stuff is so far beyond my abilities I just don't have a clue.

Thanks
 
you would have to add two int variables to CvCity to store it. then a function run in Cvcity::doturn to calculate it. also the variable would need to be applied, probably look at the code for happinessfromfeatures (not sure the exact name).

and last thing you could add some code for display, again happinessfromfeatures could serve as an example.
 
Isn't there any formula for calculating the number unhappy citizens depending on city size - with respect to difficultly level - in the source-code? Because I was thinking you'd just edit this calculation to yield an extra unhappy citizen for every city size above 10.
 
you could do that, but it would display weird.

Of course if you just make a small mod for your own you could do that. In that case you could as well just create a bunch of buildings that give unhappiness or unhealthiness, set their cost to -1 and write some python that adds/removes them from cities. For that you would not have to touch the dll at all.
 
Top Bottom