Relative and absolute

From ENIGMA
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

In GameMaker and LateralGM, absolute indicates a set value. For example, if you set the variable puzzles to be 3, you have set puzzles to be exactly three, without considering what the value of puzzles used to be.

Conversely, relative indicates a change in value. For example, if you set the variable puzzles to be relative to 3, you have increased the value of puzzles by three units. Similarly, if you set it to be relative to -3, you have decreased its value by three units.

In D&D

Whether you are changing a variable absolutely or relatively is determined by whether you check the box Relative when using any action that requires you to input a number (for example, when using the action set alarm).

In GML

  • Typing puzzles = 3 will set it to the absolute value of 3.
  • Typing puzzles += 3 will set puzzles to be three greater than its previous value.
  • Typing puzzles -= 3 will set puzzles to be three less than its previous value.