More than 1M gold--income help

Valtarian

Member
Reaction score
3
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!
 

Tharius

Occasionally Around
Reaction score
39
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.
 

Happy

Well-Known Member
Reaction score
71
why not just checking before adding the income whether its over 1,000,000 and if it is covert it before adding it?
 

Valtarian

Member
Reaction score
3
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
 

Tharius

Occasionally Around
Reaction score
39
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.
 

Valtarian

Member
Reaction score
3
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:
m-1_188857600-16669.mapspic


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
 

Tharius

Occasionally Around
Reaction score
39
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 The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/
  • The Helper The Helper:
    I think we need to add something to the bottom of the front page that shows the Headline News forum that has a link to go to the News Forum Index so people can see there is more news. Do you guys see what I am saying, lets say you read all the articles on the front page and you get to the end and it just ends, no kind of link for MOAR!

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top