Savegame module

The save slots, and starting or reading a saved game.

Enums

  • trx.savegame.Pool

    Which set of save slots a slot belongs to.

    • trx.savegame.Pool.NORMAL = 0
      The numbered save slots.
    • trx.savegame.Pool.QUICK = 1
      The quick-save slots, counted and addressed by their on-screen order.

Structures

  • trx.savegame.SlotNum

    Slot number within the pool. For the quick pool this is the on-screen order. Counted from 1.

Functions

  • trx.savegame.slot_count([pool])
    How many slots a pool has. The quick pool counts only the slots that hold a save, which is how it is shown and addressed.

    Parameters:

    • pool (trx.savegame.Pool, optional). Which set of slots to look in. Defaults to NORMAL.

    Returns:

    • integer. The number of slots.
  • trx.savegame.is_free(slot_num, [pool])
    Whether a slot holds no save.

    Parameters:

    Returns:

    • boolean. Whether the slot is empty.
  • trx.savegame.load(slot_num, [pool])
    Starts the saved game in a slot. The load happens once the game flow picks it up, not on the call.

    Parameters:

    Example:

    trx.savegame.load(1)
    
  • trx.savegame.save([slot_num], [pool])
    Writes a saved game to a slot. A quick save with no slot number goes to the next slot in the rotation; with one, it saves to the slot named.

    Parameters:

    • slot_num (trx.savegame.SlotNum, optional). The quick pool uses the next slot in its rotation when it is omitted.
    • pool (trx.savegame.Pool, optional). Which set of slots to look in. Defaults to NORMAL.

    Returns:

    • boolean. Whether the save was written. false means the quick pool had no slot.

    Example:

    trx.savegame.save(1)