Profile image

Advanced funky trees advice needed

107k winterro  3 months ago

So ibasically i am trying to get this

##click
= (FireGuns)`

##counter
= click = 1 ? Add 1 : (0)

click pressed and released 4 times counter should be 4

how should i go about doing this?

If click remains one it should only add 1

Also how do i make a memory? so it remembers the previous action?

  • Log in to leave a comment
  • Profile image
    148 llFLMTll

    @winterro Also, for memory, the easiest is a locking variable:
    CannonAmmo
    SelectedWeapon="[put name here]" ? ammo(SelectedWeapon) : CannonAmmo

    or, for any purpose:
    VariableName ---> condition ? A : VariableName

    i just recently found out how to use this for example to store the value of how much ammo you have of a certain type and stores that value even if the activating boolean returns 0. if it doesn't activate, or behaves jerky, add smooth([activation condition],1/[Time in s(best a really small value)])=1. that should fix it.

    21 days ago
  • Profile image
    107k winterro

    @Grob0s0VBRa aight, i'll try that!

    +1 3 months ago
  • Profile image
    13.5k Grob0s0VBRa

    Try this:
    counter
    repeat(counter+( (clamp01(rate(FireGuns)>0))!=0?1:0),5)


    click = clamp01(rate(FireGuns)>0)

    +1 3 months ago