variableName
cannot be accessed by OtherProcedure()
since it only exists to Main()
, where it was defined.global
variables are persist even after a script is done executing.
They stay in memory while the game is running, but aren't saved to your save file. const
variables are constant, so their value cannot be changed after they're initialized.
This can be useful for referring to values you know in advance by a convenient name.global
, static
or const
, you can also use out variables to pass values between procedures, even void
. It would look like this: