Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Please read the forum rules before posting.



Check if you are posting in the correct category.



The Off Topic section is not meant for discussing Cookie Clicker.

How To Make A Clickable Take All Of One Resource And Give It To Another

NisshokuNisshoku Member Posts: 51 ✭✭
Alright guys, so basically, in my game you get a new resource by converting 350 of the main resource. However once a player starts making like 2,000/sec it gets really tiring mashing the mouse button to get to say 1,000 of the second resource. I could use new clickables that give 500 of the resource in exchange for 500 times the amount of the other exchange clickable, but that would just make my game have a lot of buttons all over looking very untidy and neat.

I was wondering if it's possible to make a clickable that will take all of the current main resource you have and give it to the next resource times the amount exchanged.

For example, if a player has 3,500 Green Rupees (Main Resource) and it costs 350 to exchange for 1 Blue Rupee (Secondary Resource) how can I make it so instead of the player pressing the button 10 times, only presses it once and it gives 10 Blue Rupees.

This also needs to be flexible, if a player has 33,275 Green Rupees pressing the button would take those away giving the player 95 blue rupees and leaving the leftovers in green rupees.

Sorry if the explanation seems vague.

Comments

  • erdbeereerdbeere Member, Helpful Posts: 3,372 ✭✭✭✭✭
    edited February 7
    I don't know if it works, but maybe something like this:

    *convert_all_possible - unlocks converter1 *converter1 - abstract - gives 1 blue_rupee for 350 green_rupee - unlocks converter2 requiring 350 green_rupee - locks converter1 *converter2 - abstract - gives 1 blue_rupee for 350 green_rupee - unlocks converter1 requiring 350 green_rupee - locks converter2

    The first one is the clickable and the other 2 are abstract buildings. The buildings should act as a kind of loop. The building should do one conversion and only keep the loop going when there is still more to be converted.
  • dt200dt200 Member, Wiener Posts: 2,707 ✭✭
    *Change
    -named _________
    -turns Resource1 into Rescource2
    "You can't get into sigs if you try hard!!!!!!!!!!!1!!!!!!!11!!" -Darkmatterfire
    "Dude, you can't just quote yourself." -kirdneh
    "Now I can." -dt200 in reply to kirdneh even though it is sig only
    "I have bent all known laws!" -dt200 in reply to the above
  • NisshokuNisshoku Member Posts: 51 ✭✭
    edited February 8
    dt200 said:

    *Change
    -named _________
    -turns Resource1 into Rescource2

    I'm a little confused on your answer. The *Change is that supposed to be a clickable, or a building?
    erdbeere said:

    I don't know if it works, but maybe something like this:

    *convert_all_possible - unlocks converter1 *converter1 - abstract - gives 1 blue_rupee for 350 green_rupee - unlocks converter2 requiring 350 green_rupee - locks converter1 *converter2 - abstract - gives 1 blue_rupee for 350 green_rupee - unlocks converter1 requiring 350 green_rupee - locks converter2

    The first one is the clickable and the other 2 are abstract buildings. The buildings should act as a kind of loop. The building should do one conversion and only keep the loop going when there is still more to be converted.

    Is it possible to use this code on a clickable instead of a building? If not I can maybe work around it. I would just prefer the convert all be a clickable.

    **EDIT**
    That code doesn't seem to work as a clickable or a buiding.
    Post edited by Nisshoku on
  • NisshokuNisshoku Member Posts: 51 ✭✭
    dt200 said:

    *Change
    -named _________
    -turns Resource1 into Rescource2

    Using this, it gives the amount of green a player has to the blue. So 500K green becomes 500K blue. This doesn't work for my game, as 1 blue = 350 green.
  • dt200dt200 Member, Wiener Posts: 2,707 ✭✭
    You can't do what you want, then.
    "You can't get into sigs if you try hard!!!!!!!!!!!1!!!!!!!11!!" -Darkmatterfire
    "Dude, you can't just quote yourself." -kirdneh
    "Now I can." -dt200 in reply to kirdneh even though it is sig only
    "I have bent all known laws!" -dt200 in reply to the above
  • NisshokuNisshoku Member Posts: 51 ✭✭
    dt200 said:

    You can't do what you want, then.

    That's what I thought was probably the case from the beginning, but didn't hurt to ask. I do realize that what I need for it is a little more complex than IGM but I've seen a lot of complex stuff with it. Anyway thanks for the suggestions.
  • Zammorak3285Zammorak3285 Member Posts: 170 ✭✭
    edited February 15
    I've been gone for quite awhile but I'm pretty sure I can help you.

    Resouces : *Zero -abstract Clickables : *G2B -multiplies GreenRupee .0028571428571429 //cut this off whenever, it keeps going -converts GreenRupee to BlueRupee -converts GreenRupee to zero

    Unfortunately this won't leave you the leftovers, it'll give partial blue rupees but it will convert all of the green rupees to blue. It's probably the closest you can get to what you want in igm
    Post edited by Zammorak3285 on
  • NisshokuNisshoku Member Posts: 51 ✭✭
    edited February 13

    I've been gone for quite awhile but I'm pretty sure I can help you.

    Resouces : *Zero -abstract Clickables : *G2B -multiplies GreenRupee .0025871428571429 //cut this off whenever, it keeps going -converts GreenRupee to BlueRupee -converts GreenRupee to zero

    Unfortunately this won't leave you the leftovers, it'll give partial blue rupees but it will convert all of the green rupees to blue. It's probably the closest you can get to what you want in igm

    Just one question, I can probably work with what you gave me, however I just wanna understand this part of the code:
    -multiplies GreenRupee .0025871428571429

    I just wanna be able to understand what my code is actually doing lol.
  • erdbeereerdbeere Member, Helpful Posts: 3,372 ✭✭✭✭✭
    The decimal is the result of dividing 1 by 350. You would still have to multiply that number by 100 though since "multiplies" uses percentages.
  • Zammorak3285Zammorak3285 Member Posts: 170 ✭✭
    edited February 14
    Nisshoku said:



    Just one question, I can probably work with what you gave me, however I just wanna understand this part of the code:
    -multiplies GreenRupee .0025871428571429

    I just wanna be able to understand what my code is actually doing lol.

    Like erdbeere said, it represents the conversion rate of 350 to 1. However I'm pretty sure it's not meant to be multiplied by 100, the decimal is already the % value. If we were to multiply the decimal by 100 it'd give us .258... meaning it'd exchange about 4 GR for 1 BR. That decimal does need a % at the end though!!


    I generally use this kind of function for reset currency. Where say each 1 billion resource1 turns into 1 resetresource1. In that case the multiplies would look like this:

    -multiplies R1 .000000001%
  • NisshokuNisshoku Member Posts: 51 ✭✭
    erdbeere said:

    The decimal is the result of dividing 1 by 350. You would still have to multiply that number by 100 though since "multiplies" uses percentages.

    Nisshoku said:



    Just one question, I can probably work with what you gave me, however I just wanna understand this part of the code:
    -multiplies GreenRupee .0025871428571429

    I just wanna be able to understand what my code is actually doing lol.

    Like erdbeere said, it represents the conversion rate of 350 to 1. However I'm pretty sure it's not meant to be multiplied by 100, the decimal is already the % value. If we were to multiply the decimal by 100 it'd give us .258... meaning it'd exchange about 4 GR for 1 BR. That decimal does need a % at the end though!!


    I generally use this kind of function for reset currency. Where say each 1 billion resource1 turns into 1 resetresource1. In that case the multiplies would look like this:

    -multiplies R1 .000000001%
    Much appreciated :D this makes a lot more sense now. Thanks for the assist. Gonna go see if it works.
  • erdbeereerdbeere Member, Helpful Posts: 3,372 ✭✭✭✭✭

    Like erdbeere said, it represents the conversion rate of 350 to 1. However I'm pretty sure it's not meant to be multiplied by 100, the decimal is already the % value. If we were to multiply the decimal by 100 it'd give us .258... meaning it'd exchange about 4 GR for 1 BR. That decimal does need a % at the end though!!

    In the help it says "(200% would double it)". I just tested it and "multiplies x 200" doubles the amount of X. Thus you have to multiply the factor by 100.
  • Zammorak3285Zammorak3285 Member Posts: 170 ✭✭
    edited February 15
    erdbeere said:

    Like erdbeere said, it represents the conversion rate of 350 to 1. However I'm pretty sure it's not meant to be multiplied by 100, the decimal is already the % value. If we were to multiply the decimal by 100 it'd give us .285... meaning it'd exchange about 4 GR for 1 BR. That decimal does need a % at the end though!!

    In the help it says "(200% would double it)". I just tested it and "multiplies x 200" doubles the amount of X. Thus you have to multiply the factor by 100.

    This is true, 200% does double it. 100% would the keep it the same, 50% would half it, 25% would quarter it, 10% would tenth it, 5% would twentieth it, 1% would give one hundredth of it, .00285...etc% would give 1/350'th of it. That number being what is desired. Remember we're taking the larger quantity and making it smaller, so it needs a small percent for the right conversion rate.
    Post edited by Zammorak3285 on
  • BillaboBillabo Member, Friendly, Conversationalist Posts: 1,190 ✭✭✭✭
    edited February 15
    So .00258 and .258% both work?
    Fire Emblem: Fates castle address
    08619-69569
    56318-03154
  • Zammorak3285Zammorak3285 Member Posts: 170 ✭✭
    @Billabo That's what happens when I think too much lol The correct one is .00285%. I messed it up somewhere in translation (my brain to the keyboard), I would take the number out a little bit though to get as close as you can to a 350/1 exchange.
  • erdbeereerdbeere Member, Helpful Posts: 3,372 ✭✭✭✭✭
    @Zammorak3285: You correctly say that 1% would give a hundredth, i.e. multiplies X 1 would reduce the amount of X to a hundredth of its former value. For a conversion rate of 350 to 1 you would want the amount to be reduced to 1/350 times it value. If we combine the two (1/350 = 1/100 * 1/3.5) we get multiplies X 0.258 and not 0.00258. Because if we want to multiply the amount by a factor we would need 0.00258, but since the command uses percentages we actually need 0.258 keeping in mind that this is using percentages.

    @Billabo: For the multiplies command both 0.258 and 0.258% are correct. Either way it will use the number as a percentage.
  • Zammorak3285Zammorak3285 Member Posts: 170 ✭✭
    @erdbeere Huh turns out you're right, I just made a game with the function lol
Sign In or Register to comment.