Variables
Variables are mainly used to track state that isn't implicit in
which part of the story is being run.
They allow actions the player took earlier to influence what follows
and are required in story structures other than
linear and
branching.
Variables have been touched on in earlier sections.
This is a more complete discussion of the basics.
See Default and Define.
- Booleans
-
Basic variables that can be
True
orFalse
. - Integers
- Simple whole numbers.
- Floats
- Floating point numbers and the issues you may encounter with them.
- Strings
- Simple string variables that contain text.
- String Formatting
- How to format strings and other variable types into other strings.
- Money
- Some thoughts about tracking money in your game. Hint: don't use floats!
- Bounded variables *
- How to constrain variables to a range of values.