Hi there. I’m writing my first game in Inform 7 on Mac OSX and I am having a lot of trouble trying to figure out how to get around the problem where you need to tell Inform to call or print something in a specific manner.
A few examples:
- I have a room (the closet) with a scenery door (the closet door).
I want the player to be able to x the following objects:
The closet door itself
The closet (but only if the closet door is open).
Otherwise, when the player types “look closet,” I want it to say something like “you’ll have to open the door first.”
- I have a scenery table (the computer desk) which I am going to put a computer on.
I want the player to be able to x the following objects:
The computer table itself
The computer
When the player types “look computer,” I want to make Inform figure out that the player is looking at the computer itself, unless they specifically type “computer desk.”
Obviously, this is happening because the parser is only picking up the first word, like “closet” or “computer.” I figured this was a common problem (I’ve played a lot of text adventures with closet doors!) so I poked through the documentation for a workaround.
I have tried a bunch of stuff, including “calling” the “closet door” the “closet door.” But it’s not working, and I know it’s because I’ve messed up the way I’m calling it (looking at it from the complier’s point of view, it’s obviously going to throw an error).
Here’s my current code:
The closet door is a scenery door. The closet door is called the closet door. The closet door is north of Your Bedroom and south of the Closet. It is a closed, openable, not lockable door. The description is “A white door with a black knob.”
The Closet is a room. “Just a half-empty closet. There are some wrapped boxes on the shelves here.”
The boxes are scenery in the Closet. “Colorfully wrapped gifts.” Instead of taking boxes: say “Those aren’t for you, and if you opened them you’d just have to rewrap them and put them back anyway.” Understand “box” or “boxes” or “wrapped boxes” or “wrapped box” or “package” or “packages” or “wrapped package” or “wrapped packages” or “present” or “presents” or “wrapped present” or “wrapped presents” or “gift” or “gifts” or “wrapped gift” or “wrapped gifts” as boxes. Understand “closet” or “closet interior” or “interior of closet” or “closet inside” or “inside of closet” as Closet.
The shelves are scenery in the Closet. “Slightly dusty shelves.” Understand “shelf” or “shelves” as shelves. Instead of taking shelves: say “They’re attached to the wall.”
If somebody could help me out, that would be great–this problem is driving me crazy!
I also looked at the Inform Recipe Book example of Desolation Bay, where there is a room (the Cabin) and a door (the cabin door) with the same problem that I am having, but the problem wasn’t addressed in the Recipe Book, and in the Inform manual the cigarette case example is really not being helpful, here.
Thanks!