Mother DocsMother Docs
Buy me a Coffee
Steam Workshop
Discord
  • Mother OS (Ingame Script)
  • Mother GUI
  • Mother Autopilot System (MAPS)
  • Mother Core (Script Framework)
  • Cheatsheet
  • Brand Guidelines
Buy me a Coffee
Steam Workshop
Discord
  • Mother OS (Ingame Script)
  • Mother GUI
  • Mother Autopilot System (MAPS)
  • Mother Core (Script Framework)
  • Cheatsheet
  • Brand Guidelines
  • Cheatsheet
  • Mother OS (Ingame Script)
    • Getting Started

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

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

      • Air Vent Module
      • Battery Module
      • Terminal Block Module
      • Cockpit Module
      • Connector Module
      • Display Module
      • Door Module
      • Gas Tank Module
      • Hinge Module
      • Landing Gear Module
      • Light Module
      • Piston Module
      • Programmable Block Module
      • Rotor Module
      • Screen Module
      • Sensor Module
      • Sorter Module
      • Sound Block Module
      • Thruster Module
      • Timer Block Module
      • Wheel Module
    • Compatibility
    • Examples
  • Mother GUI
    • Getting Started

      • Installation
      • Configuration
    • Commands
    • Menus
    • Views
  • Mother Autopilot System (MAPS)
    • Getting Started

      • Upgrade Guide
      • Installation
    • Modules

      • Flight Planning Module
      • Map Module
      • Flight Control Module
      • Attitude Module
      • Docking Module
  • Mother Core (Script Framework)
    • Getting Started

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

      • Color Helper
      • Number Helper
      • Security
      • Serializer
    • Tutorials
  • Powered By Mother
  • Brand Guidelines

Local Storage

  • Storing a Value
  • Reading a Value
  • Storing Structured Data
  • Clearing Storage
  • Emitted Events

LocalStorage is the lightweight persistence layer behind Program.Storage. Modules usually store serialized strings under stable keys and let Mother flush the data during Save().

Storing a Value

FlightModule.cs
LocalStorage storage = GetModule<LocalStorage>();
storage.Set("minAltitude", "50");

Reading a Value

FlightModule.cs
LocalStorage storage = GetModule<LocalStorage>();
string minAltitude = storage.Get("minAltitude");

Storing Structured Data

If you need more than a single string, serialize a dictionary and store that string as one value.

MissileModule.cs
Dictionary<string, object> saveData = new Dictionary<string, object>
{
	{ "State", "Armed" },
	{ "Target", "GPS:Home:123:456:789:" }
};

GetModule<LocalStorage>().Set(
	"missile",
	Serializer.SerializeDictionary(saveData)
);
MissileModule.cs
string raw = GetModule<LocalStorage>().Get("missile");
Dictionary<string, object> saveData = Serializer.DeserializeDictionary(raw);

Clearing Storage

Clear() removes every stored key, including data used by Mother Core modules such as Almanac.

GetModule<LocalStorage>().Clear();

Note

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

Emitted Events

LocalStorage does not emit any built-in events.

Last Updated: 5/2/26, 10:05 PM
Contributors: Luke Morrison, lukejamesmorrison, Copilot
Prev
Intergrid Message Service
Next
Log