Quote:
Originally Posted by Marsal
Why don't you just make a variable of the starter number of villages and increase it by one when a village is settled? It's much more efficient.
You could do this much easier with Hashtables(don't ask me how, I only know 2D variables from Pascal and C ~.~).
|
Not sure I understand what youre saying? Just count the number of villages and then multiply by a constant number to get civilization happiness?
Unfortunately I cannot do that, because that would be assuming each village had the same Happiness, which they dont. Each one is unique. However, what I did do below may be what you are saying, but I'm not sure.
In my trigger I counted the old happiness of each village, then the new happiness, to calculate the difference. Then I add that difference to another integer called the total difference. Then it loops to count all other villages' differences, and adds them to this. Then afterwards, it adds this total difference to civilization happiness, plus the number of cities owned. So i counted civilization happiness by multiplying the number of cities by its initial happiness(either 15 or 35, depending on game mode), then added the difference(which may or may not be positive).
To me, that method seems to make sense, but maybe I'm missing a piece of logic in there that makes the trigger count wrong. That, or, I had set up the arithmetic wrong, since it involves both addition and multiplication. But I haven't found where it might be miscalculated.