- Joined
- May 9, 2009
- Messages
- 735
Hello. I want to make a trigger that is an end result make income buildings which first have their total income increased based on the amount of buildings and then decreased after a certain amount of buildings is already there. I am sure there is some math term to describe it but I must not know it. Basically here is how it should work.
1 farm (57-0 per farm) = 1x57 = 57
2 farms (57-3 per farm) = 2x54 = 108
3 farms (57-6 per farm) = 3x51 = 153
4 farms (57-9 per farm) = 4x48 = 192
5 farms (57-12 per farm) = 5x45 = 225
6 farms (57-15 per farm) = 6x42 = 252
7 farms (57-18 per farm) = 7x39 = 273
8 farms (57-21 per farm) = 8x36 = 288
9 farms (57-24 per farm) = 9x33 = 297
10 farms (57-27 per farm) = 10x30 = 300
11 farms (57-30 per farm) = 11x27 = 297
As you see each farm subtracts from the base gold produced by each farm by 3. This way the total income gained from all farm rises up until the tenth farm and then it falls. By the time 20 farms are built 0 gold would be produced, but I want to make it so that it doesn't get below 1 gold per farm.
I will need to do some variable work but I don't know where to start. I will also have a floating text that say the amount of gold gained at each farm. I will need to group all the owned farms and based on that number alter some sort of variable or string in the floating text and the gold gained. Is this possible to do using GUI and if yes then how?
1 farm (57-0 per farm) = 1x57 = 57
2 farms (57-3 per farm) = 2x54 = 108
3 farms (57-6 per farm) = 3x51 = 153
4 farms (57-9 per farm) = 4x48 = 192
5 farms (57-12 per farm) = 5x45 = 225
6 farms (57-15 per farm) = 6x42 = 252
7 farms (57-18 per farm) = 7x39 = 273
8 farms (57-21 per farm) = 8x36 = 288
9 farms (57-24 per farm) = 9x33 = 297
10 farms (57-27 per farm) = 10x30 = 300
11 farms (57-30 per farm) = 11x27 = 297
As you see each farm subtracts from the base gold produced by each farm by 3. This way the total income gained from all farm rises up until the tenth farm and then it falls. By the time 20 farms are built 0 gold would be produced, but I want to make it so that it doesn't get below 1 gold per farm.
I will need to do some variable work but I don't know where to start. I will also have a floating text that say the amount of gold gained at each farm. I will need to group all the owned farms and based on that number alter some sort of variable or string in the floating text and the gold gained. Is this possible to do using GUI and if yes then how?