Today I wanted to share some of the small helper tools I've made for myself. It's a set of 15 divided in three categories: Flow and logic, Math, and Vectors. Descriptions and zip file with the .assets below the pic.
FLOW AND LOGIC
- Float to Bool: Converts a float to a boolean value. Values larger than 0 return true, while lower than 0 return false. Default for zero is false but can be toggled to true.
- Bool to float: Converts a boolean to a float value. True returns 1, false returns 0, but can optionally be set to return -1. Very useful when taking boolean values from events or superunit inputs and converting them for direct math use and not need Select units
- Counter: Counts from A number to B number. Doesn't matter if its ascending or descending. Can be set to wrap back to the start, and to also include the starting number. If the start and end numbers are set to the same it returns invalid.
- Do Once Then: Does something only once and afterwards does something else. Has a reset port.
- FlipFlop: Switches the flow output every time it is entered. It always starts on A and then flips to B, back to A, etc. Has a return boolean and reset port too.
- Branch Toggle: Like the normal branch unit, but returns a boolean value that is the inverse of the incoming boolean. The flow is executed first so the incoming boolean is true, returns true flow and then returns a false bool.
- Branch Switch: This one diverts the flow in a more advanced manner than the usual branch. Given a boolean input, the switch will flow continuously on true / false through the corresponding ports (like branch), but it will also output one time pulses when the boolean changes from false to true (switched on) or from true to false (switched off). It also returns the present state of the switch.
- Decimals: Receives a float value and cuts off the decimals that exceed the specified precision value, rounding them either to ceiling (up) or floor (down).
- Get Sign: receives a float and returns it as a normalized value with sign (1 or -1), with the choice of how to treat zero. Useful with the bool <> float tools to convert numbers into boolean logic.
- Negate Float: Reverses the sign of a float (multiplies it by -1)
- Negate V3: Reverses the direction of a V3 (multiplies all its components by -1)
- Get XYZ: Gets all 3 components without having to use the individual get X get Y, get Z. Also much more compact and specific than using expose.
- Replace V3: Takes a V3 and replaces the value of its components with a specific number, with toggles for each component, as well as outputs. This can be used as a much more advanced Get XYZ to filter and replace values in a single unit, say get rid of a component by zeroing selectively.
- Add to V3: Adds to the components of a V3 individually, so you can choose what value to add (or subtract) to each without having a ton of Get (), Add, units. If you don't attach a vector to the port you can also fill in the values to create a new one. There is a boolean to choose substraction instead (effectively reverses the sign of all inputs).
- Multiply V3: Just like Add to V3, but with multiplication / division.
Get them here, they're just macros so you can modify them to your needs:
Customer support service by UserEcho