top expert

a biting cat website

Let’s Make IF #13: taking off.

last time, on Let’s Make IF…

Last time, I continued to iron out kinks. The overall focus has shifted from technical frameworks to actual text generation. I started on some new room descriptions for Act One, and implemented some actions for what I am calling “cat behavior.” I also laid out a to-do list of things to accomplish during Act One.

more text.

Things have advanced to a point where I can focus on more mundane IF authorship tasks like room descriptions and action rules. I should start by looking at things that I initially prevented the player from examining.

the description of the chairs is "[if the bag is undiscovered]There were an incredible number of seats there, probably twenty at least! I had a hard time imagining so many people in one place all at once. There weren't any people sitting in them, but I had a feeling that there was more to them than I could see at first glance.[otherwise]Now that I had discovered the secret underneath the chairs, the seats were good for little more than napping. Unfortunately, it would be a while before I could get my next nap."

Note that I’m distinguishing between the bag being discovered and undiscovered. That is one of the important pivot points in Act One. The second is examining the box. I had to do something a little more ornate than the usual [if thing is in the location… otherwise] construction. Here’s my table entry for the current act:

act i	"[if the box is unexamined][unexamined box description][otherwise][examined box description]"

Yes, that is a substitution inside of a substitution… inside a table. If things feel like they’re getting a little weird, that’s because they are, but I believe this is the most manageable option. Now, I could have ended the scene when Marbles examined the box, but another, bigger thing is going to happen soon. What do these substitutions look like?

to say unexamined box description:
if the box is in the location:
say "The box looked quite different in the light. It wasn't black. It was... it was like it was [it]filled with black[rt] somehow. The box was full of darkness, and that darkness seemed to move like fog rolling over the ground. I was curious, as any self-respecting cat might be, but I was also suspicious of it. It had a sort of damp scent to it, an animal smell. I don't mean a cat, mind you. It must have been a very strange animal, because that was a very strange scent.

The box looked and smelled very strange, and there was something dangerous about[em]or in[em]it. I had to make sure that D didn't get too close to it. Just as I was about to turn away from it, I thought I saw something in the darkness: a fang, maybe, or a claw. Perhaps an eye, too! I couldn't be sure. Looking at the whirling darkness was like looking at a cloud; you could see all kinds of things in it if you stared long enough.";
otherwise:
say "The box stood out among the clutter onstage. There was something wrong about it, but I couldn't put my paw on what that was. It seemed to vibrate or shift, even though it never seemed to move.[first time]

I thought that I shouldn't leave D alone with it for too long, just in case he got himself into trouble.[only]".

That’s a lot, and it’s only half of it! Note that I also decided to tree out the whole thing, instead of doing inline [if] conditions. That’s mainly for readability. There’s no harm in doing it inline, but readable to me is what’s best for me. Use your own judgement when it comes to your code. These aren’t really technical issues. It’s just a matter of finding your way of doing things, then doing it.

This hardly ever comes up, but Inform 7 has a character limit so far as printed passages go. The way to get around that is… you guessed it: substitutions within substitutions.

wrapping things up.

There isn’t a lot that needs to happen after Marbles examines the box. She needs to look under the seats in the auditorium, where she will discover a plastic bag. Inside that bag, Marbles and D will find what they need to see inside the box. Once she meows at the bag, thus getting D’s attention, Act One will end. Last week, I set up an “after meowing at something” rule that would give a noun the “discussed” property. Ending the scene is easy:

act i ends when the bag is discussed.

Another priority is implementing cat behavior, of course:

carry out scratching the chairs:
say "D would have never found a way out of the theater without my help. There simply wasn't time for me to enjoy a good scratch, even if those cushions looked perfect for a bit of claw-sharpening.".

Here is the drive where each code update is stored.

Here is today’s update. For best results, paste into an Inform 7 IDE.

next.

I’ve got act i framed in with a beginning, middle, and end, but there’s more to do. I should get all “cat behavior” implemented against every noun, verify that room descriptions still make sense, now that nouns are implemented, and so forth. That will likely take a day, if not more.