Modules / Game flow & UI

storeplugin

The page's values the server never reads: volume, a tint, rebound keys.

Putting it in a scene

It has no row, no server half and no world.store. The scene gives the starting values in a store prefab. The table lives on the link the page mounted, so every scene of the page reads and writes the same one, and no other page and no server ever sees it.

"plugins": ["loader", "scenemanager", "player", "store"],
"prefabs": {
  "store": { "volume": 0.8, "tint": "#ff8844", "binds": { "fire": "x" } }
}

Properties

store : { [key]: Value }

The scene's store prefab.

The starting value of each key. A value is any JSON value: a number, a string, a list or a table. A key is given its starting value only when the page's table does not hold it yet, so a value a scene has changed is kept when the seat moves to another scene.

Methods

On the page, through plugins.store, from an actor or another plugin. They work from the plugin's first tick.

get( key ) : Value

The value itself, not a copy. A key the table does not hold fails, so ask has first for a key that may be missing.

set( key, value )

Replaces the value, or adds the key.

has( key ) : boolean

Whether the table holds the key.

Used by

  • player
    Reads and writes the page's values, such as the keys a player rebound.

In the guide