Counter
The Counter block is used to count inputs and allow output logic to be triggered incrementally.
This block is regularly used for creating games, puzzles and escape rooms when combined with a timeline to count and present values within a set period and display it on an interface. The counter can be increased or decreased.
Equally, the Counter block can be used for system analytics to count the occurrence of actions or events.
The counter value increases when an input is received into the Increase input. Each time an input is received into the Decrease node, the counter value is decreased. Send a specific integer to the Set value for the counter to jump to it. Sending an input to the Reset value resets the counter to the Start Value defined in the block.
Inputs
- Increase – Payload / Fixed Value / Integer / String
- Decrease – Payload / Fixed Value / Integer / String
- Set - Integer
- Reset – Payload / Fixed Value / Integer / String
Outputs
- Change – Every time the count value changes, a pulse will be sent from this output.
- Reset - Every time the Reset input is triggered, a pulse will be sent from this output.
- Increase - Every time the count value increases, a pulse will be sent from this output.
- Decrease - Every time the count value increases, a pulse will be sent from this output.
- Maximum - Every time the count value reaches the minimum value defined, a pulse will be sent from this output.
- Minimum - Every time the count value reaches the maximum value defined, a pulse will be sent from this output.
Start Value
- When the Workspace is first loaded or the counter is reset. The value in this field will determine the integer the counter begins from. Define a global variable to set this dynamically.
Tip: Use a global variable as the Start value for it to persist between sessions.
Minimum Value
Create and set a variable associated with the minimum value to enforce this value immediately.
Maximum Value
The highest integer the count will rise to. Every time this value is met by the counter, the Maximum output will emit send a pulse.
Create and set a variable associated with the minimum value to enforce this value immediately.