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:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/
  • The Helper The Helper:
    Here is another comfort food favorite - Million Dollar Casserole - https://www.thehelper.net/threads/recipe-million-dollar-casserole.193614/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top