Verse Library verse

04 Persistable Data

Demonstrates storing and retrieving persistent player data across sessions using a weak map.

extracted-snippets/documentation/en-us/uefn/constants-and-variables-in-verse/04-persistable-data.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/constants-and-variables-in-verse
# Local doc:  epic-docs/documentation/en-us/uefn/constants-and-variables-in-verse.md
# Section:    Persistable Data
# WARNING: Epic's page marks this snippet as click-to-expand. Only the preview portion was captured by the crawler — the full body is NOT in the markdown.
using { /Fortnite.com/Devices }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Verse.org/Simulation }

var MySavedPlayerData:weak_map(player, int) = map{}

# A Verse-authored creative device that can be placed in a level
persistence_example := class(creative_device):

    # Runs when the device is started in a running game

Comments

    Sign in to vote, comment, or suggest an edit. Sign in