Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A variable can be seen as container to store a value. You can fill this container with content, for example numbers or strings. Other variable have the ability to store more than one value and it is even possible to mix the different types: strings with numbers, vectors with strings and so on. The content or value of a variable can change during the execution of the script and old values can be overwritten or updated with new elements. Variables can be declared wherever they are needed and their number is not limited.

Global and Local Variables

Modern programming languages differentiate between two fundamental types of variables: global and local.  The difference lies in the way the variables are stored within your script. Local variables, as the name indicates, only actlocally inside a function. . A function always starts with a def statement and can be considered as a closed code segment. With simulation events scripts, these functions are not directly visible, because you cannot see any predefined functions in the editor, as with scripted emitters or daemons. The editors for emitters, waves and daemons all show an initializing function, e.g.

...