VoidExpanse/scope-storage
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". |