Login
Remember
IF Answers
Ask a Question

# 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?

- inform7
- data-files

## 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.

## Related questions

- No option to save a .quest file?
- QuestJS asked for a .quest file and when I save my Quest adventure it saves as a .aslx file
- Forcing the player to be on a vehicle when entering a room
- [Inform 7] How to implement a blanket 'not understood' comment for an Inanimate Listener
- Copying the location of a thing to a variable when it's in something other than a room.

...