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.

Giving a random resource from multiple set resources

LeviC53LeviC53 Member Posts: 41 ✭✭
I would like to know if it is possible to have a clickable choose randomly between two or more resources and give me that random resources. Example:

Clickables:
*Clickable
gives 1 Xresource or Yresource or Zresource for Xcost

Something like that. The word "or" doesn't seem to work. What can I do to make the Clickable choose between those three resources and give me Xamount of a random resource.

Comments

  • 1234abcdcba43211234abcdcba4321 Member, Friendly, Flagger, Conversationalist Posts: 9,633 ✭✭✭✭✭
    edited November 2014
    Uh...
    I think you might be able to do
    gives a res1 gives a res2 for a res1 x% of the time gives a res3 for a res1 y% of the time gives a res4 for a res1 z% of the time

    a, x, y, z can be any amount you want. Note that res1, res2, res3, etc. are the resources you want it to be able to give. You can expand as far as necessary.
    I recommend tinkering with the percentages until you get something that works well for you.
    Generally the chance will start low and will go up as you go closer to the bottom, usually never going above 50%. Place a low chance near the bottom for something to be rare. Place a high chance near the top for sometching to be common.
  • LeviC53LeviC53 Member Posts: 41 ✭✭
    edited November 2014

    Uh...
    I think you might be able to do
    gives a res1 gives a res2 for a res1 x% of the time gives a res3 for a res1 y% of the time gives a res4 for a res1 z% of the time

    a, x, y, z can be any amount you want. Note that res1, res2, res3, etc. are the resources you want it to be able to give. You can expand as far as necessary.
    I recommend tinkering with the percentages until you get something that works well for you.
    Generally the chance will start low and will go up as you go closer to the bottom, usually never going above 50%. Place a low chance near the bottom for something to be rare. Place a high chance near the top for sometching to be common.

    I've tried something like this, which they explain in the idle game maker help page. The problem with this is that it only gives you what you can pay for. So if I can pay for "gives a res1", it will give me that and then if I can also pay for "gives a res2 for a res1 x% of the time", then it will give me that, and so on. I just thought there might be a word that can be or replace "or" so that if I have "gives a res1 or a res2 x% of the time", it would either give me res1 or res2 but not both. Thank you for your help though! I will try anyways.
  • 1234abcdcba43211234abcdcba4321 Member, Friendly, Flagger, Conversationalist Posts: 9,633 ✭✭✭✭✭
    edited November 2014
    LeviC53 said:

    Uh...
    I think you might be able to do
    gives a res1 gives a res2 for a res1 x% of the time gives a res3 for a res1 y% of the time gives a res4 for a res1 z% of the time

    a, x, y, z can be any amount you want. Note that res1, res2, res3, etc. are the resources you want it to be able to give. You can expand as far as necessary.
    I recommend tinkering with the percentages until you get something that works well for you.
    Generally the chance will start low and will go up as you go closer to the bottom, usually never going above 50%. Place a low chance near the bottom for something to be rare. Place a high chance near the top for sometching to be common.

    I've tried something like this, which they explain in the idle game maker help page. The problem with this is that it only gives you what you can pay for. So if I can pay for "gives a res1", it will give me that and then if I can also pay for "gives a res2 for a res1 x% of the time", then it will give me that, and so on. I just thought there might be a word that can be or replace "or" so that if I have "gives a res1 or a res2 x% of the time", it would either give me res1 or res2 but not both. Thank you for your help though! I will try anyways.
    have you even tried this?

    it'll first give you a res1, then there's a CHANCE for it go give a res2 but you'll lose the res1.
    Then there's a CHANCE to give a res3, but you'll lose the res1. Oh, and you need res1 in the first place for you to get the res3, but the only place you'll have the res1 is from the gives a res1 at the beginning an you can't have lost it before.
  • LeviC53LeviC53 Member Posts: 41 ✭✭
    edited November 2014
    Ok, I might try that...

    But I also found a way for the player to have to progress more before being able to get rarer gems. When I tried this way, the only way I could get the rest of the other gems to be given to me was to store up more than 100% power, and then click "dig for gems" or whatever. If I have 5 resources being given through one button, it will take the price from the first, then the second, third, etc. It will then add all that it can until it has reached the point where I cannot afford it. So when I click the button, it gives me a chance to get as much as I payed for.
Sign In or Register to comment.