GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • S1API

This view

  • Original page
  • New address

GeezerVison is showing ifbars.github.io — Enum SaveableLoadOrder | S1API Documentation

Table of Contents

Enum SaveableLoadOrder

Namespace
S1API.Saveables
Assembly
S1API.dll

Defines when a modded saveable should load relative to base game saveables.

Override the Saveable.LoadOrder property in your Saveable class to control load timing.

public enum SaveableLoadOrder
Extension Methods
ReflectionUtils.GetValueTupleItems(object)
ReflectionUtils.IsValueTuple(object)

Fields

AfterBaseGame = 1

Load after base game saveables (default). Runs as a postfix after NPCsLoader.Load (one of the last loaders).

Use this when your mod data depends on base game entities being loaded first, such as:

  • Storing references to NPCs, buildings, or vehicles
  • Modifying base game entity states after they're loaded
  • Most general-purpose mod saveables

This is the default behavior. If you don't override LoadOrder, your saveable will use AfterBaseGame. Base game entities are loaded when Saveable.OnLoaded is called.

BeforeBaseGame = 0

Load before base game saveables. Runs as a prefix before BuildingsLoader.Load (one of the earliest loaders).

Use this when your mod data needs to be available before base game ISaveables load, such as:

  • Setting up hooks that intercept base game load events
  • Initializing global state that base game loaders depend on
  • Advanced modding scenarios requiring early initialization

Important: When using BeforeBaseGame, base game entities (NPCs, buildings, vehicles) are not yet loaded when Saveable.OnLoaded is called.

Examples

public class MyCustomSaveable : Saveable
{
    // Override to load BEFORE base game entities
    public override SaveableLoadOrder LoadOrder => SaveableLoadOrder.BeforeBaseGame;

    [SaveableField("my_data")]
    private MyDataClass _myData = new MyDataClass();
}
Edit this page
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.