More on building a “page” or screen that looks like an Inform 7 game (as is an Inform 7 game)
last time, on let’s make IF…
In the previous episode, I revealed my sinister plan to build a short (anti-?)narrative out of eight “pages” of Inform 7 content. That is, I hope to build screens with highly variable texts that have the familiar features of a parser game. In hopes of explaining, I used this image with arrows pointing to texts that could vary based on player choice and turn count.

To this end, I built a “to say” definition that would print a fake “banner” at the top of every screen, using a table to store the texts. Refresh your memory here:
we need more.
Considering our current source code, there are a few outstanding texts to implement (musts):
- an opening “blurb” that prints between banner and room description
- the “epitaph”
- a prompt to “restart” (not actually a restart in the Inform sense of “clear all progress and begin from scratch”
- room description is currently fixed; need to switch to variable text
- room name is not sufficiently variable; need to convert to table lookup by magic number
- table description is currently fixed
- card names are currently fixed
Other musts (in my opinion):
- handling responses for parser errors
- handling responses for standard rules verbs
- limiting the parser to keep focus on the main four commands
It’s always something, isn’t it? There are different ways of considering an Inform 7 project “finished.” One model is that a game is finished when the competition or jam deadline hits. Some people thrive while working in that way. Perhaps one can get it out now and fix it later. Another option: competition be damned, this is done when it’s done. I prefer this second approach, but even if it limits the number of games I can release.
I would not publish a game without accounting for every parser error, for instance, but many people do not go that far. The real question is what will make you happy, or satisfied, or proud? That’s going to vary from person to person, so give things a thought and approach releases on your own terms.
Full disclosure: I have my own personal “Project With Wolf” that I am not sharing here. It has missed two release deadlines, and I am fine with that. That’s why I get to talk about it here with you.
keep moving.
I’m almost ready to test my own project, and I’d like our work here at Top Expert to keep pace. That means we have a lot to build out! I’ll try to do two updates a week until we get close to my goal. A lot of what’s coming will be old hat by now: substitutions based on table entries. I won’t make you watch me reinvent the wheel each time. Instead, I’ll mention what I’ve added and update the source code I share with every post.
We still have some unique substitutions to build out, though. The fake endings, with epitaphs and final “questions,” will have a couple of flourishes beyond a basic substitution.
We have a couple of ways we could handle the text, but a rule with substitutions is the first step. This should all look pretty familiar.
after card-picking when the magic number is not 9:
say the the concluding assertion;
say paragraph break;
say "[bold type][tab][bold type]*** [the fake epitaph] ***[roman type]".
The [tab] substitution has been part of the project for a while, but we’ve never actually used it. There’s not much to it. I use it to print a set number of fixed-width spaces. This will give a uniform look to indented texts. In this, it’s only three, but some fiddling might be needed before everything looks right.
To say tab:
say "[fixed letter spacing] [variable letter spacing]"
We have our substitution variables now, “the fake epitaph” and “the concluding assertion. I’ll set up some “to say” definitions, just as we have on many occasions.
to say the concluding assertion:
choose row with an index of the magic number from the table of fake assertions;
say the fake tombstone entry.
to say the fake epitaph:
choose row with an index of the magic number from the table of fake endings;
say the fake epitaph entry.
I had some choices to make. I could have used one table, for one thing. I also could have made one large “to say” phrase that handled everything. I chose not to do either of these things, because I want to keep everything as modular as possible. What if I want the epitaph to change based on different clicker counts? Instead of breaking open everything, I can just tweak the “to say” for the epitaph. Besides, the overall format and shape (blurb, epitaph, final question) is a fixed thing. It’s best (in my opinion) to get it right once and for all, then focus on the content.
Tables will follow, of course. The next task is to ask the fake final question (with a supporting table). I’ll just keep adding to our “after” rule. Afterward, I’ll do a “wait for any key response” before clearing the screen and, hopefully, printing a believable fake banner. I might need to make some adjustments but let’s see how things go. Here’s the updated rule:
after card-picking when the magic number is not 9:
say the concluding assertion;
say paragraph break;
say "[bold type][tab][bold type]*** [the fake epitaph] ***[roman type]
[fake final question]"
say line break;
wait for any key;
clear the screen;
try looking.
As a reminder, Inform does not recognize line breaks in printed text, but it does honor white space (as above between [roman type] and [fake final question]. What does it all look like?
Some of the spacing isn’t working. When I bring up another test project, I see that there should be two empty lines before the epitaph, and four empty lines afterward. I also see that, after clearing the screen, I should set four blank lines before our fake banner. Here’s how I’m leaving things for now:
after card-picking when the magic number is not 9:
say the concluding assertion;
say "
[bold type][tab][bold type]*** [the fake epitaph] ***[roman type]
[the fake final question]";
say line break;
wait for any key;
clear the screen;
say paragraph break;
say paragraph break;
try looking.
Note that paragraph break and line break substitutions would work just as well as white space, but I like being able to visualize the breaks in code.
Note: since we don’t have unique text written for our tables, this isn’t obvious yet, but the “magic number” is currently incrementing before any of this happens. That means we currently have a potential mismatch between tables. We’ll move the increment somewhere else next time. Better yet, experiment with it yourself and find a better place for it!
We still haven’t done any real text generation, but I hope you can see how we could build something by filling in the tables. If you were to fill something like this in, what would you do?
Speaking of testing: I’ll be writing about playtesting (both testing your game and testing somebody else’s). I might also be looking for a couple of testers for my own. Stay tuned!
If it isn’t clear what this project is doing, you can always put the current source in your IDE and play it yourself!
One response to “let’s make IF #12: formatting and forgeries”
-

[…] let’s make IF #12: formatting and forgeries […]
LikeLike

Leave a comment