This is a comprehensive guide on counters. Now, you may be thinking, “Counter go up, counter go down, counter go back, counter hit target. what else does counter have?”. This will show you.
There are 2 different families of concepts that this guide will have: counter symmetry and counter arrays. Counter symmetry increases a counter’s usefulness and counter arrays decrease memory usage. Symmetry also reduces memory usage, in a way.
Counter Symmetry
There are 2 subfamilies to counter symmetry. We have limits and multiple targets. But first, we need to define what symmetric counters are. Symmetric counters are 2 or more counters that edit the same property (if they do need to edit a property), increase on the same channels, decrease on the same channels, have the same defaults, and reset on the same channels. But they can have different targets. So basically, the input is the same, but the output can be different. This allows us to detect multiple things from symmetric counters.
Limits
Say that we have a counter with a lower limit of 3 and an upper limit of 7. Assume the default is in between 3 and 7. If the counter goes below 3, it should automatically set to 3. So we need the target of one below the lower limit to increase the counter back to the lower limit. For the upper limit, we need a 2nd symmetric counter. Its is the same for the upper limit but it decreases the symmetric counters and the target for other counter is one above the upper limit.
Another Target
This just has a symmetric counter with a different target.
More to come
Counter Arrays
This uses the same mechanic as PCPs, but instead uses it to avoid blocks. So basically you want to set a property to a constant number that you know. You put that number as the default of a counter that edits a property. Make the target of the counter be one more than the constant. The target resets the counter. When you want to set the property to that constant, you increase the counter.
To use decimals, scale your property. If you want to set it to 23.5, then make it 235. When you need to actually use the property inside blocks, divide the property by 10 and store it inside a variable.