|Name of gadget||Variable Modifier|
|Section||Logic & Processing|
|Number of Tweak pages||1|
|Last updated||27 Feb 2019 [Beta]|
This gadget modifies or reads a named Variable gadget. It works wirelessly and you can have any number of modifiers associated with one variable, so it can keep your logic tidy and legible. There are options that allow you to make a change in a one-off pulse, for example adding gold to your purse when you sell an object, or to change it continuously over time, such as reducing your fuel while you are firing the thrusters on your rocket-ship.
Example Tutorial (adapted from Media Molecule)
- Variable Name
Add the name of the variable you wish to modify here. The name is case-sensitive. Unless you have dozens of variables, it’s easiest to select from a list of existing variable names by hovering the mouse tip over this box and pressing up or down on the d-pad to cycle through them – this reduces the chance of a misspelling breaking your logic. Don’t forget to actually create and name your variable first though!
- Operation Type
Use this to change the value of the named variable directly, to the value of Operation Value (4.).
Use this to read the value of the named variable and output it to Variable Value (5.).
Increases the variable value by the value in Operation Value (4.) – and of course you can “subtract” by “adding” a negative number.
Returns the variable to its default value.
- Update Type
Dictates when the Variable Modifier actually modifies or reads the named variable:
- When Powered On
Only operates at the split-second when the “Power” status of the gadget switches from Off to On. It will then do nothing more until the Power is turned off (and then on) again.
Continuously updates the value of the named variable (or outputs its value) as long as the gadget is powered on. Used with the “Add” operation, this will keep the variable value changing.
- When Powered On
- Operation Value
Used by Operation Types “Set” and “Add” only, it is the value in this field that either replaces the named variable’s value or is added to it.
- Variable Value
Used by Operation Type “Get” only, this outputs the current value of the named variable, no matter where it is in your level.
This is where you turn the gadget on/off