Mother DocsMother Docs
Buy me a Coffee
Steam Workshop
Discord
  • Mother OS (Ingame Script)
Buy me a Coffee
Steam Workshop
Discord
  • Mother OS (Ingame Script)
  • Mother OS (Ingame Script)
    • Getting Started

      • Upgrade Guide
      • Installation
      • Command Line Interface (CLI)
      • Configuration
      • Modules
    • Core Modules

      • Activity Monitor
      • Almanac
      • Block Catalogue
      • Local Storage
      • Intergrid Message Service
    • Extension Modules

      • Air Vent Module
      • Battery Module
      • Terminal Block Module
      • Cockpit Module
      • Connector Module
      • Display Module
      • Docking Module
      • Door Module
      • Flight Control Module
      • Flight Planning Module
      • Gas Tank Module
      • Gyroscope Module
      • Hinge Module
      • Landing Gear Module
      • Light Module
      • Map Module
      • Piston Module
      • Programmable Block Module
      • Rotor Module
      • Screen Module
      • Sensor Module
      • Sorter Module
      • Sound Block Module
      • Thruster Module
      • Timer Block Module
    • Command Cheatsheet
    • Compatibility
    • Examples
  • Mother Core (Script Framework)
    • Getting Started

      • Upgrade Guide
      • Installation
      • Architecture Overview
      • Managing Script Size & Complexity
    • Building A Module
    • Console (CLI)
    • Core Modules
      • Activity Monitor
      • Almanac
      • Block Catalogue
      • Clock
      • Command Bus
      • Configuration
      • Event Bus
      • Intergrid Message Service
      • Local Storage
      • Terminal
    • Utilities

      • Color Helper
      • Security
      • Serializer
  • Powered By Mother

Local Storage

Local Storage allows Mother to save data across program cycles, game sessions, and programmable block script recompilations.

  • Get A Value
  • Set A Value
  • Clearing Local Storage

Get A Value

To retrieve a value from the local storage, you can use the Get() method which takes a key as a parameter. The return value will be a serialized string.

LocalStorage localStorage = Mother.GetModule<LocalStorage>();

string almanacData = localStorage.Get("almanac");

Set A Value

To store a value in the local storage, you can use the Set() method which takes a key and a value as parameters.

LocalStorage localStorage = Mother.GetModule<LocalStorage>();

localStorage.Set("minAltitute", "50");

Clearing Local Storage

To complete refresh storage, you can use the Clear() method. This will remove all data stored in the local storage including that being used by other modules.

Mother.GetModule<LocalStorage>().Clear();

Note

The purge command can be used to clear the local storage.

Last Updated: 8/8/25, 10:08 PM
Contributors: Luke Morrison, lukejamesmorrison
Prev
Intergrid Message Service
Next
Terminal