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 player can gain X Buildings2 for every Y Buildings1 he already have?

dizzykeidizzykei Member Posts: 5
edited November 26 in Developer's Lounge
Let's say i have cow as building 1 and house as building 2. I want that player earn 1 house for every 10 cows he buy. And it will be the only way to have houses. But he still can sold it. How to do it?

Comments

  • hoglahoohoglahoo Member Posts: 20 ✭✭
    edited November 27
    for building 1 you could do:
    on tick:building2 is 0.1*building1
    and then for building 2 make sure to use "no buy"
  • dizzykeidizzykei Member Posts: 5
    Thank you! It works, but in a strange way. I get first building 2 for 10 b1, next for 15, next for 25, next for 35.
  • hoglahoohoglahoo Member Posts: 20 ✭✭
    Looks like it's rounding. Maybe try rounding down to the integer by using floor()

    on tick:building2 is floor(0.1*building1)

    This way if you have, say, 19 building1s, you'd have floor(0.1*19) -> floor(1.9) -> 1 and then at 20 it should go up to 2
Sign In or Register to comment.