File handling for partial state

I have a large program to build an open-world system. However, I also have a detailed and rich player character (PC). I would like to save the PC data and bring it into a different world (an updated version of the world) occasionally. Is that possible?

You can do this with external files, see chapters 23.11 (Files) to 23.15 (Exchanging files with other programs) in the documentation.

Here’s a minimal example where we transfer some character data from one project to another:

Code for Game 1 (export data by WAITing):

The Lab is a room.

The File of Character Data is called "pcdata".

Table of Character Stats
Stat	Value
"Strength"	12
"Intelligence"	12

After waiting:
	write File of Character Data from the Table of Character Stats;
	say "Character stats saved to file."

Code for Game 2 (import data by JUMPing):

The Second Lab is a room.

The File of Character Data (owned by another project) is called "pcdata".

Table of Character Stats
Stat	Value
"Strength"	6
"Intelligence"	6

After jumping:
	if the File of Character Data exists:
		read File of Character Data into Table of Character Stats;
		say "Character stats were read from an external file.";
		repeat through the Table of Character Stats:
			say "[Stat entry]: [Value entry]."

If you play the compiled games in the same folder, then you can import the data from Game 1 into Game 2, and the stats will be 12 and 12 after the import, instead of the 6 and 6 which we started out with in Game 2.

Thanks so much for this. I informs how my architecture of the world and the PC data are built.