Toggle Mechanism

Being able to toggle between two options is a very neat system for games. Here is the most memory efficient way to toggle something (both block code and devices/props)

Toggling

Get a property, and a counter. The property should be numerical. All other settings don't really affect the function. The counter should update the property. Make the counter have a target value of two more than its default value. If the target value is reached broadcast on a channel that also resets the counter. Now make the counter increase on an activation channel of your choice. When broadcasted on, this channel will toggle the properties value from 0 to 1 which can then be compared by a checker or block code.

If you want to toggle something outside of block code you will need to add a checker. This checker will check to see if the property's value is greater than one effectively allowing you to toggle a device or prop based on the result.

Memory Cost: 35 (doubles if used outside block code)

Pros Cons
1.Can be used in block code and for activating devices and props None really
2. Very cheap in memory and easy to create
6 Likes

Nice guide! Maybe add pictures though!

It’s too short to really warrant them. If their was a way to detect an absence of a channel being broadcast on this could be cheaper though.

1 Like