Custom Maps & Logic
  • Custom Map Tutorial
    • Custom Map Introduction
    • Your first map
    • Map Navigation
    • Object Selection
    • Object Positioning
    • Object Attributes
    • Shortcuts and Macros
    • Editor Settings
    • Built-in Components Common Errors
    • Map Performance
    • Custom Assets
      • Your first Asset Bundle
      • Asset Bundles in Map Editor
      • Asset Bundles in Game
      • Adding to Asset Bundles
      • Asset Bundle naming
  • Custom Logic Tutorial
    • Custom Logic Introduction
    • Your first script
    • Variables
    • Types
    • Variable Inspector
    • Expressions
    • Conditionals
    • Loops
    • Functions
    • Coroutines
    • Classes
    • Static Classes
    • Components
    • Extensions
    • Cutscenes
    • Static Objects
    • Networking
    • Commenting
  • Reference
    • Static Classes
      • Game
      • Network
      • Map
      • UI
      • Time
      • Convert
      • String
      • Input
      • Math
      • Random
      • Cutscene
      • Camera
      • RoomData
      • PersistentData
      • Json
      • Physics
    • Objects
      • Component
      • Object
      • Character
      • Human
      • Titan
      • Shifter
      • MapObject
      • Transform
      • Player
      • NetworkView
      • Color
      • Vector3
      • Quaternion
      • Dict
      • List
      • Range
      • LineCastHitResult
      • MapTargetable
      • Random
    • Callbacks
      • Main
      • Components
  • Examples
    • Gamemodes
      • Survive
      • Waves
      • Endless
      • Racing
      • Blade PVP
      • Thunderspear PVP
      • Titan Explode
      • Cranked
      • More Examples
    • Components
      • SupplyStation
      • Daylight
      • PointLight
      • Rigidbody
      • NavMeshObstacle
      • Cannon
      • Dummy
      • Wagon
      • Tag
      • KillRegion
      • DamageRegion
      • MovePingPong
      • RacingCheckpointRegion
      • RacingFinishRegion
      • TeleportRegion
      • Animal
      • SignalMover
      • SignalSender
      • More Examples
Powered by GitBook
On this page
  1. Reference
  2. Static Classes

PersistentData

Store and retrieve persistent data. Persistent data can be saved and loaded from file. Supports float, int, string, and bool types.

Note that any game mode may use the same file names, so it is recommended that you choose unique file names when saving and loading.

Saved files are located in Documents/Aottg2/PersistentData.

Function
Returns
Description

SetProperty(name: string, value: object)

null

Sets the property with given name to the object value. Valid value types are float, string, bool, and int.

GetProperty(name: string, defaultValue: object)

object

Gets the property with given name. If property does not exist, returns defaultValue.

Clear()

null

Clears current persistent data.

SaveToFile(fileName: string, encrypted: bool)

null

Saves current persistent data to given file name. If encrypted is true, will also encrypt the file instead of using plaintext.

LoadFromFile(fileName: string, encrypted: bool)

null

Loads persistent data from given file name. If encrypted is true, will treat the file as having been saved as encrypted.

IsValidFileName(fileName: string)

bool

Determines whether or not the given fileName will be allowed for use when saving/loading a file.

FileExists(fileName: string)

bool

Determines whether the file given already exists. Throws an error if given an invalid file name.

PreviousRoomDataNextJson

Last updated 9 months ago