scripting:system_values_functions_overview
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| scripting:system_values_functions_overview [2012/03/25 18:49] – created mit | scripting:system_values_functions_overview [2025/05/28 16:34] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 9: | Line 9: | ||
| </ | </ | ||
| - | Here is the full current | + | For a full list of the system values available, see the [[Scripting: |
| + | Values|System Values Reference]]. | ||
| - | ===== Player Stats ===== | + | ===== System |
| - | These values give details about the player the current event is executing for.\\ | + | |
| - | For further details on each value, see the [[Scripting: | + | |
| - | < | + | |
| - | <TABLE align=left WIDTH=90%>< | + | |
| - | </ | + | |
| - | '' | + | |
| - | gPlayerTeam \\ | + | |
| - | gPlayerLevel \\ | + | |
| - | gPlayerKudos \\ | + | |
| - | gPlayerFamily \\ | + | |
| - | gPlayerCash \\ | + | |
| - | gPlayerVehicle \\ | + | |
| - | gPlayerFuel \\ | + | |
| - | '' | + | |
| - | < | + | |
| - | </ | + | |
| - | </ | + | |
| - | '' | + | |
| - | gPlayerFollowing \\ | + | |
| - | gPlayerNumFollowers \\ | + | |
| - | gPlayerKills \\ | + | |
| - | gPlayerDeaths \\ | + | |
| - | gPlayerRobocrowKills \\ | + | |
| - | gPlayerRobocrowDeaths \\ | + | |
| - | '' | + | |
| - | < | + | |
| - | </ | + | |
| - | </ | + | |
| - | '' | + | |
| - | gPlayerHealth \\ | + | |
| - | gPlayerHunger \\ | + | |
| - | gPlayerThirst \\ | + | |
| - | gPlayerMaxHealth \\ | + | |
| - | '' | + | |
| - | < | + | |
| - | </ | + | |
| - | </ | + | |
| - | \\ | + | |
| - | ===== Other System | + | System |
| - | < | + | |
| - | <TABLE align=left WIDTH=90%>< | + | |
| - | </ | + | |
| - | **Player Location**\\ | + | |
| - | '' | + | |
| - | gPlayerY \\ | + | |
| - | gNearestBuilding \\ | + | |
| - | '' | + | |
| - | **Tasking interface**\\ | + | For example, to find out how much of a particular item the current player has : |
| - | '' | + | |
| - | gTaskItem2 \\ | + | |
| - | gTaskItem3 \\ | + | |
| - | '' | + | |
| - | < | + | |
| - | </ | + | |
| - | </ | + | |
| - | **Server Status**\\ | + | |
| - | '' | + | |
| - | | + | |
| - | '' | + | |
| - | **Building access**\\ | + | <codedoc> |
| - | '' | + | |
| - | gBuildingScriptParam \\ | + | *say %PLAYER% is currently carrying $numInInv Wood |
| - | '' | + | </codedoc> |
| - | <html> | + | |
| - | </ | + | |
| - | </html> | + | |
| - | **Combat Players**\\ | + | |
| - | '' | + | |
| - | gKilledID \\ | + | |
| - | gTargetID \\ | + | |
| - | '' | + | |
| - | **Player User-details**\\ | + | The reference section contains a [[Scripting: |
| - | '' | + | |
| - | gPlayerIsMember \\ | + | ===== System Variables ===== |
| - | '' | + | |
| - | <html> | + | Systems Variables are persistent key/value pairs that you can set and retrieve. There are 3 types : |
| - | </TD></TR></TABLE> | + | |
| - | </html> | + | * **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: | ||
| + | |||
| + | <codedoc> | ||
| + | $gServerKey[Hello] = "Your personalised random number is " | ||
| + | $gPlayerKey[1] = sysRand( 100 ) | ||
| + | *say Hi %PLAYER%. $gServerKey[Hello] $gPlayerKey[1]. | ||
| + | </codedoc> | ||
| + | .. 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.1332701353.txt.gz · Last modified: (external edit)
