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 [2012/03/26 00:06] – mit | scripting:system_values_functions_overview [2025/05/28 16:34] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 14: | Line 14: | ||
| ===== System Functions ===== | ===== System Functions ===== | ||
| - | In addition | + | System Functions are used to query the state of a particular aspect of your world where parameters are required to obtain the result. System Functions usually start with **sys**. |
| + | |||
| + | For example, to find out how much of a particular item the current player has : | ||
| + | |||
| + | < | ||
| + | $numInInv = sysPlayerInventory( " | ||
| + | *say %PLAYER% is currently carrying $numInInv Wood | ||
| + | </ | ||
| + | |||
| + | 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** | ||
| + | |||
| + | The ''< | ||
| + | For example: | ||
| + | |||
| + | < | ||
| + | $gServerKey[Hello] = "Your personalised random | ||
| + | $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 | ||
| + | |||
| + | For advanced scripting, you can access building and player system variables by changing the event context using '' | ||
| - | TBC | ||
scripting/system_values_functions_overview.1332720366.txt.gz · Last modified: (external edit)
