Vǫrðr Forge Steam page

Rûn Language

Rûn Saving State

What a script changes, and what of it is still there after the player saves and loads.

What a save keeps

Event script variables
Every variable made with set or add, number or text. A load puts them back; a new game starts with none. See Variables and Counters.
Flags
Every flag raised with flag set or World.FlagSet. See Events and Triggers.
The rest of the game
Her pockets and gear, gold and every currency, stats, level and experience, skills and spells, health and mana, quests, factions, the map, the hour and where she stands. The whole list is on Saves and Player Files.
Random events
Changes made with RandomEvents.Set and RandomEvents.Create.

What a save does not keep

A program's variables
A program's variables last for one run of one section. A live program (one with on update) keeps its variables for the rest of the play and loses them when the play ends; none of them is written into a save.
Things a script made
What object create puts in the world is not written into the map or the save; make it again from a Map start controller.
Session settings
World.SetTune, setrule, Player.Preset and Light.Player hold for the current play only.

Keeping a number from a program

A program cannot read or set an event script variable. It has three ways to keep something across a save:

  1. A flag, for a yes or no: World.FlagSet("met_the_king"), read with World.Flag("met_the_king").
  2. A currency kept for the purpose (Project Settings > Currencies), for a count: Player.AddCurrency("wishes", 1), read with Player.Currency("wishes").
  3. An event script that does the counting, run from the program: World.Fire("well_count", "use").
[use]
add wishes 1
if wishes >= 3
  flag set well_spent
World.Fire("well_count", "use")
if (World.Flag("well_spent")) print("the well is spent")
else print("the well still listens")
the well still listens

A choice the player made

Record a choice as a flag or a text variable the moment it is made, and read it wherever it matters:

[use]
set sided_with marsh
flag set chose_a_side
[use]
require flag chose_a_side : undecided
say You stand with the {sided_with} folk.

[undecided]
say Nobody knows you here yet.

sided_with and chose_a_side both ride the save.