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
setoradd, number or text. A load puts them back; a new game starts with none. See Variables and Counters. - Flags
- Every flag raised with
flag setorWorld.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.SetandRandomEvents.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 createputs 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.PresetandLight.Playerhold 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:
- A flag, for a yes or no:
World.FlagSet("met_the_king"), read withWorld.Flag("met_the_king"). - A currency kept for the purpose (Project Settings > Currencies), for a count:
Player.AddCurrency("wishes", 1), read withPlayer.Currency("wishes"). - 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_spentWorld.Fire("well_count", "use")
if (World.Flag("well_spent")) print("the well is spent")
else print("the well still listens")the well still listensA 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.