How do you store a count of button presses in a Rec Room circuit?
The cheapest way to do this would be to use what is called a Ring Store. It is a plus chip that has its output connected to its input as follows:
Ring stores will add values that are input on the remaining pins to the value that is already stored. For instance, if the ring store has a value of 3 stored and a new signal inputs a 5 into the red pin, then the ring store will increase to 8 and hold that value.
You can read the value of the ring store from the red output pin. Sending a signal to the reset pin of the ring store will set it back to 0.
Button Press Counter
The way to use a ring store with a button is as follows:
Make sure that the button is configured so that it does not send the Player ID on Press. This should be all you need to count the number of times the button has been pressed.
Triggerzone Counter
Triggerzones only output player IDs, which can be any integers greater than 0. You can still use a ring store to count the number of times a triggerzone has been interacted with, but you have to do a boolean conversion. All this means is that you just connect the output of the triggerzone to a ≠ chip before passing the output of the ≠ chip into the ring store. Refer to the following diagram but replace the button with a triggerzone: