Hey, I made it work! Before I show off the example, let me point out a couple things:
First, the syntax The file of [whatever] (owned by project "[insert IFID here]") is called "[name]". as given in the documentation didn’t work for me. I pasted the IFID for one project into the file declaration for the other project, and I ended up with a runtime error. Maybe it was a matter of different hyphens?
But secondofly, it turns out I didn’t really want to stipulate the IFID, for reasons that will become apparent. The syntax The file of [whatever] (owned by another project) is called "name". suited my purposes perfectly.
Let us imagine a series of games called “The Chronicles of Swords.” In each installment, your goal is to collect a sword. Each new game should remember which swords from previous games you have collected already.
First I made an example pair of games where Episode 1 was only able to your progress, and couldn’t receive any information generated by Episode 2. I realized this could cause some problems. The most obvious one is: What if you’re making games that don’t have to be played in a specific order? So I messed around a little more. In these examples, your progress from Episode 2 will be preserved in Episode 1 if you happen to play them in that order.
I wrote some blog posts a while back about using external files for autosaving, and the same basic principles apply here. You have to be careful about how the format of external files. You kind of have to know what kind of information you’re passing from game to game before you start making any actual games! For purposes of this example, I picked this format that should be easy to read, where everything is just texts:
Table of Chronicles
state status
"claimed sword of daggers" "no"
"claimed crystal rose" "no"
"claimed sword of trowels" "no"
Saving and restoring progress is a matter of reading from and writing to (a file with the same format as) (and crucially the same number of rows as) this table. Here’s the first game in the series:
"The Sword of Daggers" by Ryan Veeder
The story headline is "Episode 1 of the Chronicles of Swords".
Ancient Tomb is a room.
The crystal rose is here.
The scorched altar is here.
The Sword of Daggers is on the scorched altar.
The Sword of Trowels is a thing. [footnote 1]
The File of Chronicles (owned by another project) [footnote 2] is called "swordchronicles".
Table of Chronicles
state status
"claimed sword of daggers" "no"
"claimed crystal rose" "no"
"claimed sword of trowels" "no"
When play begins: [footnote 3]
if the File of Chronicles exists:
read the File of Chronicles into the Table of Chronicles;
choose row with state of "claimed sword of daggers" in Table of Chronicles;
if status entry is "yes":
now player carries the Sword of Daggers;
choose row with state of "claimed crystal rose" in Table of Chronicles;
if status entry is "yes":
now player carries the crystal rose;
choose row with state of "claimed sword of trowels" in Table of Chronicles;
if status entry is "yes":
now player carries the Sword of Trowels;
After taking the Sword of Daggers: [footnote 4]
if player carries the crystal rose:
choose row with state of "claimed crystal rose" in Table of Chronicles;
now status entry is "yes";
if player carries the Sword of Trowels:
choose row with state of "claimed sword of trowels" in Table of Chronicles;
now status entry is "yes";
choose row with state of "claimed sword of daggers" in Table of Chronicles;
now status entry is "yes";
write File of Chronicles from Table of Chronicles;
say "You claimed the Sword of Daggers, as was your destiny!";
end the story saying "But what other destinies await?"
Footnote 1: Although the Sword of Trowels isn’t directly obtainable in this game, we make it an offstage thing here so that it can show up if you bring it from Episode 2.
Footnote 2: Here’s the utility of saying the file is owned by another project. At this point, this is only necessary for letting the player finish Episode 2 first. If you tell this project that the “File of Chronicles” is owned by another project, then it’ll be able to read from a file named “swordchronicles” that was created by the other episode.
Footnote 3: This beginning-of-play routine is only necessary to restore the player’s progress from Episode 2.
Footnote 4: In this example I decided to save progress only at the end of the story. In an open world situation, you might want to save things as you go along, so that the player can putter about in one game, make some progress, find some amulets, find a good place to stop in that game, and then open another game and still have all their amulets.
Here’s the second game:
"The Sword of Trowels" by Ryan Veeder
The story headline is "Episode 2 of the Chronicles of Swords".
Icy Grotto is a room.
The Sword of Trowels is here.
The File of Chronicles (owned by another project) is called "swordchronicles".
Table of Chronicles
state status
"claimed sword of daggers" "no"
"claimed crystal rose" "no"
"claimed sword of trowels" "no"
The crystal rose is a thing.
The Sword of Daggers is a thing.
When play begins:
if the File of Chronicles exists:
read the File of Chronicles into the Table of Chronicles;
choose row with state of "claimed sword of daggers" in Table of Chronicles;
if status entry is "yes":
now player carries the Sword of Daggers;
choose row with state of "claimed crystal rose" in Table of Chronicles;
if status entry is "yes":
now player carries the crystal rose;
choose row with state of "claimed sword of trowels" in Table of Chronicles;
if status entry is "yes":
now player carries the Sword of Trowels;
After taking the Sword of Trowels:
if player carries the crystal rose:
choose row with state of "claimed crystal rose" in Table of Chronicles;
now status entry is "yes";
if player carries the Sword of Daggers:
choose row with state of "claimed sword of daggers" in Table of Chronicles;
now status entry is "yes";
choose row with state of "claimed sword of trowels" in Table of Chronicles;
now status entry is "yes";
write File of Chronicles from Table of Chronicles;
say "You claimed the Sword of Trowels, as was your destiny!";
end the story saying "But what other destinies await?"
It’s kind of exactly the same! The only difference is, now all the details that optionally enabled out-of-sequence play in Episode 1 (the presence of items from other games, the phrase “(owned by another project),” the When Play Begins rule) are necessary in order for Episode 2 to function properly as a second episode.
I wasn’t sure I could get away with telling both projects that the file was owned by another project (actually owned by no project at all?) but it works!