scripting:system_values_functions_overview
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| scripting:system_values_functions_overview [2015/02/23 12:57] – mit | scripting:system_values_functions_overview [2025/05/28 16:34] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 23: | Line 23: | ||
| </ | </ | ||
| + | The reference section contains a [[Scripting: | ||
| + | |||
| + | ===== System Variables ===== | ||
| + | |||
| + | Systems Variables are persistent key/value pairs that you can set and retrieve. There are 3 types : | ||
| + | * **Server Variables** ( '' | ||
| + | * **Building Variables** ( '' | ||
| + | * **Player Variables** ( '' | ||
| + | |||
| + | **Server** system variables are global (there are one set of values for your world), each constructed building has its own set of **Building** system variables and each player has their own set of **Player** variables. | ||
| + | |||
| + | The ''< | ||
| + | For example: | ||
| + | |||
| + | < | ||
| + | $gServerKey[Hello] = "Your personalised random number is " | ||
| + | $gPlayerKey[1] = sysRand( 100 ) | ||
| + | *say Hi %PLAYER%. $gServerKey[Hello] $gPlayerKey[1]. | ||
| + | </ | ||
| + | .. this would print '' | ||
| + | |||
| + | Each script event is run in a particular context which determines the building and player variables the script is currently accessing - i.e. When an ' | ||
| + | |||
| + | For advanced scripting, you can access building and player system variables by changing the event context using '' | ||
scripting/system_values_functions_overview.1424696275.txt.gz · Last modified: (external edit)
