Script Language: Conventions: Scope
|
![]() |
The term scope refers to the context in which an identifier can be recognized, and when an element, such as a variable, is created and destroyed. Any element may have either game or scene scope, plus a variable may have script scope. Game, Scene and Script Scopes An element which is declared in a game script file is said to have a game scope. Such an element is accessible from anywhere in the game, including every scene and every script block. An element declared in a scene script file is only accessible from within that scene, so it has a scene scope. Variables that are declared in a script, whether they are static or not, can only be accessed within that script. Note that a start-block has its own scope separate from the script in which it is defined. See Also...
|
![]() |
![]() ![]() ![]() ![]() ![]() |