# More than 1M gold--income help

#### Valtarian

##### Member
Hello,
I currently am working on WmW X14. Pretty much it has an income timer that ends every 25 seconds, and starts over again. Once the timer hits 0 seconds, you receive your amount of income for that round.

Recently, I've made it so you can have over 1 million gold... by the following method:

Player reds gold becomes greater than 420,000
Remove 70,000 gold from player red
Add 1 wood to player red

and...

If player reds gold becomes less than 270,000
remove 1 wood from player red
add 70,000 gold to player reds stash

HOWEVER, HERE IS WHERE THE PROBLEM LIES:
If someone has over 1,000,000 income, it will give them the 420,000 gold and the correct wood amount to equal out 1M.

Example:

Red's income is 1,800,000

Income timer hits 0....
He receives 420,000 gold and 8 wood.
420,000 gold plus 8 wood (70k each) should be roughly ONE MILLION, therefore red is not getting the extra 800,000 income that he has been playing for.

I know there is a way to fix this, I was thinking maybe since income is an integer, if player Red's income is greater than 1,000,000, give him 1 wood for every additional 70k income?

I don't know. Can anyone help me with this? Thank you in advance!

Is there no other way for a player to earn gold or wood at all, other than through income? If not, this is probably the issue:

Using your example, the player presumably starts with 0 gold and 0 wood. The player then gains 1,800,000 income each tick. It sounds as though you convert the 1,800,000 income directly to gold, by adding 1,800,000 gold to the player's gold count. Then, since 1,800,000 is greater than 420,000, it should add 20 wood and remove 20*70,000=1,400,000 gold. The problem is, since gold is capped at 1,000,000, it's not actually adding 1,800,000 gold at all, and the calculations are based on an income of 1,000,000-(current gold).

Your "fix" runs into a similar problem if the player has more than 0 gold. The player will get extra lumber to compensate for the (in the example) 800,000 income beyond the first million, but you still can't add 1 million gold to, say, 400,000 gold and expect the game to remember it as 1,400,000. The player will still end up losing approximately 600,000 gold in income.

Instead, what you want to do is first figure out how much wood you want to add (in the example above, 20), then how much gold you want to add (in the example above, 400,000). To start, figure out how much total gold you would have, not counting current wood, if WC3 could store gold above 1 million. That's easily done by adding current gold to the income amount (0 + 1,800,000 = 1,800,000 in the example). Subtract 420,000 from that amount (1,800,000 - 420,000 = 1,380,000 in the example), then divide that result by 70,000 and round up to the nearest whole number (1,380,000/70,000 is approximately 19.71, rounded up to 20, in the example). This gives you the amount of wood that you need to add (in your example, 20).

Now that you know the wood, how much gold do you add? First multiply the amount of wood by 70,000 (20*70,000 = 1,400,000 in the example), then subtract that number from the sum of the player's current gold (0 in the example) and income (1,800,000 in the example) to find the new amount of gold ((0 + 1,800,000) - 1,400,000 = 400,000 in the example). This is the amount of gold to which you have to change the current value (not add to the current value).

For a second example with other numbers, and non-zero amounts of initial gold and wood:

The player starts with 220,000 gold and 6 wood, and has an income of 4,000,000.

Total gold discounting wood is 4,000,000 + 220,000 = 4,220,000
Gold needing conversion to wood is 4,220,000 - 420,000 = 3,800,000
Amount of wood after conversion is 3,800,000/70,000 = 54.29
Converted wood rounded up is 54.29 rounded up = 55
Total wood after income is 6 + 55 = 61 wood

Total gold being converted to wood is 55*70,000 = 3,850,000
Total initial gold discounting wood was 4,000,000 + 220,000 = 4,220,000
Total gold after income is 4,220,000 - 3,850,000 = 370,000 gold

The player ends with 370,000 gold and 61 wood.

By the way, why such arbitrary values as 420,000 gold cap and 70,000:1 gold:wood conversion? A 100,000 or 500,000 gold cap and 100,000:1 gold:wood conversion would be much simpler.

why not just checking before adding the income whether its over 1,000,000 and if it is covert it before adding it?

That's what I'm trying to do. Tharius kind of restated how I said I hope to fix it. I'm just not sure how to do that... I've got an idea but I'm not seeing it in GUI

What exactly are you having a problem finding? If you post specifics, there are several people on this forum who can point out what you need and where to find it.

Well, Tharius... Let me just thank you real quick for taking your time to help. I really appreciate it, and you definitely have the right idea as to what I'm looking for.

If I can elaborate and really try to be as specific as possible...

This is an image of the map that I am currently working on:

Now, when the game begins there is a timer that restarts every 25 seconds.

This timer starts at 25, and goes down to 0. At every 0, players acquire the "income" that they have earned while playing the game.

(Note: you earn income by sending creeps through Shrines. These creeps go to your opponents side. Your goal is to make the other player leak lives--It's a tower defense. The income of each creep is determined by the creeps "point value").

Now as we all know, there is a \$1,000,000 gold limit in Warcraft III. Therefore, any income over \$1,000,000 is being wasted and is not being granted to the player.

So I devised a "max gold" system, where if a player receives lets say 500,000 gold, 80,000 gold is deducted from his stash and he receives one wood. And to transfer the wood to gold, if he goes under a certain amount of gold-he receives 80k and loses one lumber. However, I have noticed that regardless of this system/income... the player still seems to get approximately 1 million gold. However, given the system, the player may receive 500k and 6 wood (80k each) averaging out to be approximately one million gold. So, obviously my system does not work.

I would love to get it to work if anyone has any ideas, but otherwise, I have another idea in mind:

I could possibly make it so where if a player has over 1,000,000 income, he receives 1 wood for every additional 10k income.... and if the player goes under 800k, he loses whatever X amount of wood it takes to fill his stash to 1M gold.

I hope I was specific enough, I'd really like to find a solution to this. Thank you very much for all of your responses

Sorry I didn't respond sooner, my internet died for a good 12 hours.

I was actually talking about your statement that you couldn't find something in the GUI actions, by the way. If you could post the relevant parts of your triggers and highlight what parts you don't think are working, or even a copy of your WIP map, it would help narrow the problem down.

If you don't want to do that, try starting off with 420,000 gold and adding 10,000,000 income, and try starting off with 1,000,000 gold and adding 10,000,000 income, and tell us how much gold and lumber your trigger actually gives you. If you're having the problem I outlined earlier, you won't be getting nearly 1,000,000 income worth of gold and lumber with those starting numbers.

General chit-chat
Help Users
• No one is chatting at the moment.
• The Helper:
its like I dont have arms and I want to be a tennis player
• Varine:
I got these colorblind people sunglasses but they don't help. Just makes it way more obvious that I don't know some colors
+1
• Varine:
Then a while back I REALLY wanted to get into Kerbal, but they don't have a fucking colorblind mode
• Varine:
And I can't find a mod for it, so I guess I'm not going to get this figured out since their icons are all like, slightly different greens\
• Varine:
And a few shooter games. Like idk why red and green became standards for enemy and ally, like blue doesn't exist.
• The Helper:
I used to not really be able to tell between black and white and color tv back in the day but I cannot relate besides that
• The Helper:
Color blind is bad but what if you had this Aphantasia stuff - I might have it because I am not able to picture holographic apples if that is what you are supposed to be able to do https://www.thehelper.net/threads/s...p-closer-to-demystifying-‘aphantasia’.195684/
• The Helper:
So now that my dad has passed away it has like somehow leveled me up I cannot explain it.
• The Helper:
Terrible shit but thanks dad for leveling me up in death that is awesome he was a great man but he was not a nice man we will probably never know what happened in the end except he head on collisioned some random person
• The Helper:
• The Helper:
He did it his way that is for sure
• The Helper:
Thank the good lord he did not kill anyone and the person he head on collided was not hurt that bad. They will get paid my dad had superior insurance! He went out like Mad Max one way down the wrong way on the freeway for miles before he smacked that poor person that thankfully lived!
+1
• The Helper:
AC️DC,
+1
• The Helper:
i like that little Zap! Where did that come from...
+2
• Stephen:
That little zap came from my dad. Fucker checked out and left me almost 7 years ago, but he still torments me in my dreams and everyday difficulties I also "leveled up" when he left. Whatever happened, he always wanted it for me, but I could never do it when he was here. I hope you have an easier time than I have. My dad was my mentor, my best friend. There's never a second that goes by and I don't mourn his passing.
+3
• The Helper:
I cannot really mourn my dad because him passing was the best thing. I mourned my dads death years ago when I realized he was totally gone. This thing that happened was a mercy for him because he was not happy and no way was it getting better
• The Helper:
My dad was totally different to my sister since she was born like 8 years later she has no point of reference with me and my mom. He was supportive and nice to her I guess I dont know LOL!
+1
• The Helper:
So now that I have my teeth fixed I am going to start the youtube. The facebook is also coming soon. The brand is not changing just the stuff underneath it
+2
• Ghan:
Put videos on X
• The Helper:
LOL! Ghan wants me to put videos on the one site the forum cannot embed videos from
• jonas:
A similar thing happened to me with my grandma - she got covid and when I called her, I realized she was just an empty shell now. The way she used to talk was completely gone, all she could still do is say the most minimal things like "hi" "aha" and "bye". Before she used to talk my ears off for hours with no possibility of stopping her. That's when I mourned her and cried. She died a few months later from the after-effects of covid
+2
• jonas:
But I didn't feel sad when I heard she had physically died. It felt like she had really died on that day I called her
+2
• The Helper:
That is the same with my dad. I grieved the most when I realized he had the bad dementia and was not the person that I had known before. His physical passing was just a thing and I have not really been very emotional about it - likely it will just hit me all at once like it did with my divorce but as of now I have not lost it over my dads passing
+1

### Members online

No members online now.