ParelVRDocs
Player site

Scripting / Reference

Storage

Types in the ParelVR.Volt.Storage namespace.

VoltAchievements#

ParelVR.Volt.Storage.VoltAchievements static

Achievements of this world for the local player, kept in their storage for the world.

VoltAchievements methods#

static VoltStorageRequest Check(string id)

Checks an achievement; the request's Exists is true when it is unlocked.

static VoltStorageRequest Unlock(string id, string title)

Unlocks an achievement; the first time, the player sees a notification with the title.

VoltLeaderboard#

ParelVR.Volt.Storage.VoltLeaderboard static

High score boards of this world, kept in its world storage. The answer arrives as OnStorageResult; its Value is the board as JSON: {"lowerIsBetter", "entries": [{"id", "name", "score"}]}, best first, at most 100 entries, one per player.

VoltLeaderboard methods#

static VoltStorageRequest Load(string board)

Reads a board.

static VoltStorageRequest Submit(string board, int score, bool lowerIsBetter)

Records the local player's score on a board, keeping their best one.

VoltStorage#

ParelVR.Volt.Storage.VoltStorage static

Data that outlives the session, kept by ParelVR's own backend. Keys are up to 64 letters, digits, dots, dashes and underscores; values are text up to 64 KB. A script can only reach the local player's data.

VoltStorage methods#

static VoltStorageRequest Delete(VoltStorageScope scope, string key)

Removes a key.

static VoltStorageRequest Exists(VoltStorageScope scope, string key)

Checks whether a key has a value.

static VoltStorageRequest Get(VoltStorageScope scope, string key)

Reads the value of a key.

static VoltStorageRequest Set(VoltStorageScope scope, string key, string value)

Stores text under a key.

VoltStorageRequest#

ParelVR.Volt.Storage.VoltStorageRequest class

A storage request in progress. Yield it in a coroutine to wait for the result, or override OnStorageResult on the behaviour that started it.

VoltStorageRequest properties#

VoltError Error { get; }

Why the request failed.

bool Exists { get; }

Whether the key has a value, after a Get or an Exists.

bool IsDone { get; }

True once the request has finished.

string Key { get; }

The key of the request.

bool Success { get; }

True when the request did what was asked.

string Value { get; }

The stored text, after a Get. An empty string when there is none.

VoltStorageScope#

ParelVR.Volt.Storage.VoltStorageScope enum

Whose data a storage key belongs to.

Value Meaning
World (0) One value for the whole world, shared by every visitor in every instance.
Player (1) The local player's data, shared by every world of the same creator.
PlayerWorld (2) The local player's data in this world only.
Instance (3) Data of this instance. It is gone when the instance closes.