Carry Over A Save File

+1 vote
154 views
asked May 29 in Authoring by Wes Lesley
recategorized May 29 by Dannii

I would like to make more than one game. Preferably have them interconnect, with events of the first having repercussions in the sequels.

Like Mass Effect.

I want Mass Effect save file dark sorcery.

I remember reading about such a thing for IF once, but I can't seem to locate that information anymore.

Any help?

1 Answer

+2 votes
answered May 29 by Joseph Geipel (207 points)
edited May 29 by Joseph Geipel

The method for saving information from one game to another is established in §23.11 to §23.15 of the documentation. Through external files you can, as one option, make a table of simple values that can be read by other games.

In your first game, use (with the term "SavedInfo" changed to whatever you want):

The File of SavedInfo is called "SavedInfo".

When you need to save the data which you have accumulated in a table throughout the game, then simply use:

write the File of SavedInfo from Table of Info;

Then, in your next game, use:

The File of SavedInfo (owned by another project) is called "SavedInfo".

And then you can read the data into a pre-established table with enough rows and columns via:

read the File of SavedInfo into Table of Info;

Note that complex kinds of data cannot be put into such a table: the easiest value to place into a table is a number. Consider using these numbers as IDs for things or use another method to link the numbers to what you want.

The other primary option for sending information from one game to another is having the file instead be a text file. Instead of writing from a table, use:

write "hello, my future self" to File of SavedInfo;

And then, to get it back:

say "This is the message from the previous game: [text of File of SavedInfo]";

NOTE: All of this requires Glulx.

This site is now closed.
As of 1st November 2015, this site is a read-only archive. For more information see the intfiction forum post

Welcome to IF Answers, a site for questions and answers about Interactive Fiction.

Technical questions about interactive fiction development tools such as Inform, Twine, Quest, QuestKit, Squiffy, Adrift, TADS etc. are all on-topic here.

Non-technical questions about interactive fiction are also on-topic. These questions could be about general IF design, specific games, entering the IF Comp etc.
...