How do you convert 100000 golds to 1 lumber? [ROC only]

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,706
Like the title, I tried doing this for every golds added. They said they want the incomes to be in effect all the time (or the same moment a player's gold has been added) without showing the values which are greater than or equals to 100000.

Here's the trigger (Note that it's 100000 golds (5 zeros) for 1 lumber:

Code:
Incomes
    Events
        Time - Every 15.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Game - Display to (Player group(Player[(Integer A)])) for 5.00 seconds the text: (|c00ffcc00Income: |cffffcc00 + (String(kills[(Integer A)]))))
        For each (Integer A) from 1 to 12, do (Player - Add kills[(Integer A)] to Player[(Integer A)] Current gold)
        For each (Integer A) from 1 to 12, do (If ((Player[(Integer A)] Current gold) Greater than or equal to 100000) then do (Player - Add 1 to Player[(Integer A)] Current lumber) else do (Do nothing))
        For each (Integer A) from 1 to 12, do (If ((Player[(Integer A)] Current gold) Greater than or equal to 100000) then do (Player - Add -100000 to Player[(Integer A)] Current gold) else do (Do nothing))

What else I'm missing? Thanks in advance. :D
 

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
Maybe lower down the Timer?
15.00 second is a bit too long for 'in effect all the time'
Perhaps 0.5 or lower is enough.

Isn't there a 'Player - Gold become more than XXX' or similar events in RoC?
 

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,706
No, I still don't get it.

Code:
Incomes checking
    Events
        Player - Player 1 (Red)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 2 (Blue)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 3 (Teal)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 4 (Purple)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 5 (Yellow)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 6 (Orange)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 7 (Green)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 8 (Pink)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 9 (Gray)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 10 (Light Blue)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 11 (Dark Green)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 12 (Brown)'s Current gold becomes Greater than or equal to 100000.00
    Conditions
        (((Player((Player number of (Triggering player)))) slot status) Equal to Is playing) and (finishbuilding[(Player number of (Triggering player))] Equal to True)
    Actions
        Player Group - Pick every player in (All players) and do (Player - Set (Picked player) Current gold to (((Picked player) Current gold) mod 100000))
        -------- From this point on, I don't know how to add (the number of how many 100000 golds a player has) lumber(s). --------
        -------- It's like a variable "x" and "R". A player's current gold equals "y". y / 100000 = x with remainder R. I'm adding "x" to the lumber. --------
        Player Group - Pick every player in (All players) and do (Player - Add ((((Picked player) Current gold) + (((Picked player) Current gold) mod 100000)) / 100000) to (Picked player) Current lumber)

It's explainable right there, since there's comments. And the lumber adding never works at all.
 

Cidzero

Imma firin mah lazer!!!1!1
Reaction score
39
Code:
Wood Back
    Events
        Player - Player 1 (Red)'s Current gold becomes Less than 100000.00
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering player) Current lumber) Greater than or equal to 1
            Then - Actions
                Player - Add 100000 to (Triggering player) Current gold
                Player - Set (Triggering player) Current lumber to (((Triggering player) Current lumber) - 1)
            Else - Actions

Code:
Gold to wood
    Events
        Player - Player 1 (Red)'s Current gold becomes Greater than or equal to 200000.00
    Conditions
    Actions
        Player - Add 1 to (Triggering player) Current lumber
        Player - Set (Triggering player) Current gold to (((Triggering player) Current gold) - 100000)

These should do you wonder.
 

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,706
Okay, I tried these. Can anyone help me out here? Whenever I want to test this, WC3 just shut itself down.

Code:
Incomes
    Events
        Time - Every 15.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Game - Display to (Player group(Player[(Integer A)])) for 5.00 seconds the text: (|c00ffcc00Income: |cffffcc00 + (String(kills[(Integer A)]))))
        For each (Integer A) from 1 to 12, do (Player - Add kills[(Integer A)] to Player[(Integer A)] Current gold)
Code:
Add lumber
    Events
        Player - Player 1 (Red)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 2 (Blue)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 3 (Teal)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 4 (Purple)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 5 (Yellow)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 6 (Orange)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 7 (Green)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 8 (Pink)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 9 (Gray)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 10 (Light Blue)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 11 (Dark Green)'s Current gold becomes Greater than or equal to 100000.00
        Player - Player 12 (Brown)'s Current gold becomes Greater than or equal to 100000.00
    Conditions
        (((Player((Player number of (Triggering player)))) slot status) Equal to Is playing) and (finishbuilding[(Player number of (Triggering player))] Equal to True)
    Actions
        Set kills[1000] = (((Player((Player number of (Triggering player)))) Current gold) mod 100000)
        Set kills[1001] = (((Player((Player number of (Triggering player)))) Current gold) - kills[1000])
        Set kills[1002] = (kills[1001] / 100000)
        Player - Set (Player((Player number of (Triggering player)))) Current gold to kills[1000]
        Player - Add kills[1002] to (Player((Player number of (Triggering player)))) Current lumber
Code:
Subtract lumber
    Events
        Player - Player 1 (Red)'s Current gold becomes Less than 100000.00
        Player - Player 2 (Blue)'s Current gold becomes Less than 100000.00
        Player - Player 3 (Teal)'s Current gold becomes Less than 100000.00
        Player - Player 4 (Purple)'s Current gold becomes Less than 100000.00
        Player - Player 5 (Yellow)'s Current gold becomes Less than 100000.00
        Player - Player 6 (Orange)'s Current gold becomes Less than 100000.00
        Player - Player 7 (Green)'s Current gold becomes Less than 100000.00
        Player - Player 8 (Pink)'s Current gold becomes Less than 100000.00
        Player - Player 9 (Gray)'s Current gold becomes Less than 100000.00
        Player - Player 10 (Light Blue)'s Current gold becomes Less than 100000.00
        Player - Player 11 (Dark Green)'s Current gold becomes Less than 100000.00
        Player - Player 12 (Brown)'s Current gold becomes Less than 100000.00
    Conditions
        ((((Player((Player number of (Triggering player)))) slot status) Equal to Is playing) and (finishbuilding[(Player number of (Triggering player))] Equal to True)) and (((Player((Player number of (Triggering player)))) Current lumber) Greater than or equal to 1)
    Actions
        Player - Add 100000 to (Player((Player number of (Triggering player)))) Current gold
        Player - Set (Player((Player number of (Triggering player)))) Current lumber to (((Player((Player number of (Triggering player)))) Current lumber) - 1)
 

Cidzero

Imma firin mah lazer!!!1!1
Reaction score
39
You're breaking it because, you hit 100k, it subtracts that, but then you have less than 100k, so it gives it back, but then you hit 100k again...
 

Somatic

You can change this now in User CP.
Reaction score
84
You are making an infinite loop, you need to make sure you do not cause a loop from all this subtraction and Addition.

What is it that you want to make?
 

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,706
Read my post above. You replied faster than my editing.

EDIT: never mind. I'll repeat again.

In Hero Line Wars ROC 4.2, there's a feature that converts golds to lumbers. While buying creeps, it not only subtracts golds, but also the lumber. And whenever an income came in, it automatically converts the golds to both lumber and gold. I wanted to use that feature. So, any ideas/helps, thanks in advance.
 

Somatic

You can change this now in User CP.
Reaction score
84
So you mean when it hits a limit for the gold, it automatically change to lumber?
 

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,706
Correct! And back, if not enough golds to buy something.
 

Cidzero

Imma firin mah lazer!!!1!1
Reaction score
39
Somatic you played that multi-square defense map where you hit 200k gold you get 1 wood? Thats what he's trying to do...That was what I based my 2 triggers off of so he could usem, but he changed them to 100k each...and yea...broken fun.

To get your triggers to work, you have to set them to different numbers. 50k normality, 50k for 1 wood by having 100k, or w/e combination. 20/80, 25/75 etc...but they have to be different, otherwise infinite loop.
 

Somatic

You can change this now in User CP.
Reaction score
84
Ic, Agree, using of different combination does prevents the infinite loop problem.
 

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,706
Won't that make unequal values between conversions from gold to lumber and lumber to gold?

I was hoping for:

Golds = cents.
Lumber = dollars.
1000000 lumbers = the maxinum amount of golds you get.

Unless you tell me that:

1 US dollar = 33 New Taiwan Dollars

Converting between these two in an infinite loop causes the value to become closer to 0, or should it become closer to 1 USD, 33 NTD, or should it becomes a "∞" ?
 

Terrabull

Veteran Member (Done that)
Reaction score
38
1 US dollar = 33 New Taiwan Dollars

Converting between these two in an infinite loop causes the value to become closer to 0, or should it become closer to 1 USD, 33 NTD, or should it becomes a "∞" ?

Wrong your analogy is not correctly expressing the situation. What you need is:
Gold = Quarters
Lumber = Dollars

When you trade in your Quarters for dollars, you need to do it when you have $2.00 worth of quarters.
When you trade it back, you only need $1.00 to get your quarters.
 

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,706
$2.00 for trading quarters.
$1.00 to pay the trade.
You get your quarters, but you lose $1.00 more of it.

Same with golds and lumbers, making the total of golds not equal to the (total of lumber) x (a specific number of gold, like 100000 golds per 1 lumber) + (leftover golds.)

Correct?
 

Cidzero

Imma firin mah lazer!!!1!1
Reaction score
39
Ummm...yea sure, just have different values that are seperated that when you remove the gold, the player still has at least enough gold to not be under the other trigger's amount...
 

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,706
I understood now.

And check out this newly-updated map, if the solution is just like what you told me. I could be wrong, I could've used a different way to do it, but I think the results are expected to be. What would you think?

I really made a mistake on using both 100000 golds conversion.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • 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

      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