VoidExpanse/scope-storage: Difference between revisions
(Created page with "<noinclude> Category:VoidExpanse/api_scopes </noinclude> = Scope storage = Extremely useful scope for persistent, global variables and data storage. Used in complex quest...") |
No edit summary |
||
Line 31: | Line 31: | ||
* object: value | | * object: value | | ||
void | | void | | ||
<pre style="margin:0px;">storage.Set("quest_rats_in_the_cellar", "house", {address: "Moscow, Krasnaya street, house 66"});</pre> | | <pre style="margin:0px;">storage.Set("quest_rats_in_the_cellar", | ||
"house", | |||
{address: "Moscow, Krasnaya street, house 66"});</pre> | | |||
Sets an entry in specified table. | Sets an entry in specified table. | ||
}} | }} |
Latest revision as of 09:59, 13 February 2014
Scope storage
Extremely useful scope for persistent, global variables and data storage. Used in complex quests and overall in game. Storage has tables and entries, which can contain any javascript object. This scope and it's data can be accessible from any other script.
Visibility: Global.
List of functions
Get | ||
---|---|---|
Arguments | Returns | Example |
|
object |
storage.Get("quest_rats_in_the_cellar", "house"); |
Description | ||
Retrieves object, which was set with storage.Set call. |
Remove | ||
---|---|---|
Arguments | Returns | Example |
|
void |
storage.Remove("quest_rats_in_the_cellar", "house"); |
Description | ||
Removes an entry from storage. |
Set | ||
---|---|---|
Arguments | Returns | Example |
|
void |
storage.Set("quest_rats_in_the_cellar", "house", {address: "Moscow, Krasnaya street, house 66"}); |
Description | ||
Sets an entry in specified table. |
GetGlobal | ||
---|---|---|
Arguments | Returns | Example |
|
object |
storage.GetGlobal("best_player_id"); |
Description | ||
Gets an entry from table "default". |
IsSetGlobal | ||
---|---|---|
Arguments | Returns | Example |
|
bool |
storage.IsSetGlobal("best_player_id"); |
Description | ||
Returns whether variable in "default" table is set. |
RemoveGlobal | ||
---|---|---|
Arguments | Returns | Example |
|
void |
storage.RemoveGlobal("best_player_id"); |
Description | ||
Removes an entry from storage. |
SetGlobal | ||
---|---|---|
Arguments | Returns | Example |
|
void |
storage.SetGlobal("best_player_id", {name: "dlirry"}); |
Description | ||
Sets an entry in global table "default". |