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

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,694
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,694
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,694
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,694
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,694
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,694
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,694
$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,694
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.

      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