# 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:
Added new Crab Bisque Soup recipe - which is badass by the way - Crab Bisque - https://www.thehelper.net/threads/soup-crab-bisque.196085/
• The Helper:
I feel like we need to all meet up somewhere sometime. Maybe like in Vegas
+2
• The Helper:
Would love to go to Vegas I have never been and it would be an adventure! Who is in?
• The Helper:
at least the full on bot attack has stopped it was getting ridiculous there for a while and we use cloudflare and everything
• jonas:
I'm sure my wife would not be happy if I went to Vegas, but don't let that stop you guys - would be hard for me to attend anyways
+1
• jonas:
Do you know why the bot attack stopped?
• The Helper:
maybe they finally got everything lol
• Ghan:
There's lots of good food in Vegas.
• Ghan:
Everything tends to be pretty expensive though so bring your wallet.
+1
• The Helper:
I have to wait longer if I am going for food because my teeth are still messed up from the work and I still cannot eat right. Going to be a couple more months before that gets better
+1
• The Helper:
I would immediately hitting the dispensary though
+1
• Varine:
My Xbox account got hijacked, and apparently I have a different one from like 10 years ago that Microsoft keeps telling me is the right one
• Varine:
Like NO, I mean for some reason that one is attached to my email, but it's not the right one
• Varine:
I have a different one, and that one has my credit card attached to it and I would like that credit card to not be attached to it if I can't get it back
• Varine:
Anyway Microsoft is not very helpful with this, they just keep telling me to fill out the Account Recovery form, but that just redirects me to the other account
• The Helper:
They should not allow you to put a credit card on a account that does not have human customer service you can call
• Varine:
That's the only thing that got hijacked at least. I don't totally know how these integrate together, but it seems like I should be able to do this via the gamertag. Like my email is still mine, but they changed the email to that account I'm guessing.
+1
• Blackveiled:
I went to Vegas a few weeks ago to visit my mom. I had never been either, lol! But I'm working in Salt Lake City at the moment so it's not a far trip.
+2
• The Helper:
I have never been to Vegas and it is on the bucket list so...
+1
• tom_mai78101:
+1
• Ghan:
I've heard Shapez 2 is good.
+1
• Ghan:
Also Satisfactory 1.0 released on the 10th and that has been excellent as well.
+1
• The Helper:
Happy Saturday! Hope everyone has a fantastic day!
+1
• tom_mai78101:
My mistake is moving from Shapez (beaten the game) to Shapez 2.
+1