So I’ve been pondering this and I think that it can be done without having to modify the runtime environment. It all depends on what’s inside the “fancy bookmark maker” black box, though, and it what it needs as input, and exactly what you’re tracking about different rooms and objects.
But I threw some code together to implement two different possibilities.
Let’s say you have a simple map set up with some rooms and objects:
Include Epistemology by Eric Eve.
Bedroom is a room. The futon is an enterable supporter in Bedroom.
Hallway is west of Bedroom. The rug is scenery in Hallway.
Bathroom Door is a door. It is west of Hallway and east of Restroom. There is a toothbrush in Restroom.
South of Hallway is Living Room. The blue couch is an enterable supporter in Living Room.
West of Living Room is Kitchen. The electric mixer is a device in Living Room. A beer is a thing in Kitchen.
Southeast of Living Room is Front Lawn. The lawn chair is an enterable supporter in Front Lawn.
I include the Epistemology extension because it tracks the known/unknown
status of objects (and several other things about them, which might be better for your specific scenario, depending on the specifics of that specific scenario). Otherwise, this just sets up a map and sprinkles some objects in it. The only thing I’m using below from Epistemology is the “known” adjective, though.
You can then track the objects and their status in a table:
Making a bookmark is an action out of world applying to nothing. Understand "bookmark" as making a bookmark.
Table of Stuff
Name Status
an object a text
with 50 blank rows
Report making a bookmark:
blank out the whole of the Table of Stuff;
repeat with item running through objects:
choose a blank row in the Table of Stuff;
now Name Entry is item;
if item is a room:
if item is visited:
now Status entry is "True";
otherwise:
now Status entry is "False";
otherwise:
if item is known:
now Status entry is "True";
otherwise:
now Status entry is "False";
sort the Table of Stuff in Name order;
showme the contents of the Table of Stuff.
Tables are the basic structured data format in Inform, so I had to work with that.
The action-processing machinery here is probably not what you want, but it could be easily adapted to do something else with the table once it’s been filled out. One of the downsides is that you probably need to make the table of sufficient size in the beginning (I think? are tables resizable?). I use the command showme the contents of the Table of Stuff
here just as an example for poking at the construction: it results in kind-of-ugly output that’s only intended for debugging, and printing the bookmark to the screen in that format is probably not what you want. (For one thing, I don’t think that Inform has any mechanism for parsing a printed table back into a game state at all.)
But one thing you can do with tables is write them to disk, and depending on your setup, that might work, especially if you’re running in an environment where you’re also doing other stuff; you might plausibly open a socket or some other kind of file-like object and write to that. Writing with Inform 23.11 through 23.15 talks about writing external files.
Notice that the table that gets printed includes all sorts of under-the-hood objects, like the compass and some Inform internals, like the Darkness object and each of the compass directions. I didn’t filter that out, but there’s a good chance that you might want to.
Ryan Veeder has written some blog posts about how he worked with external files in Inform to implement autosaving for his game Ryan Veeder’s Authentic Fly Fishing, they’re here and here (and there are maybe others? poking around his blog might pay off).
You might want to track other things than just a true/false status for each room and object, but this basic idea should be readily adaptable if you do.
Alternately, if what you really want is just to produce a short-form True/False check for each object and room, you might try something like this:
Making a binary bookmark is an action out of world applying to nothing. Understand "binary bookmark" as making a binary bookmark.
To decide what text is the binary bookmark:
let things be the list of objects;
sort things in printed name order;
let the output text be "";
repeat with item running through objects:
if item is a room:
if item is visited:
now output text is "[output text]1";
otherwise:
now output text is "[output text]0";
otherwise:
if item is known:
now output text is "[output text]1";
otherwise:
now output text is "[output text]0";
decide on output text.
Report making a binary bookmark:
say the binary bookmark.
This just gives you a string of ones and zeros with no direct indication of what they represent; bookmarks made this way would of course break if the game’s internal structure changed. But it’s a more lightweight form, and you could (for instance) parse the string representation back into a large integer and do something with it, or maybe break it into six-character chunks for processing into a Base64 string to build the bookmark out of, or something.