Absolute Beginner Questions

I started writing a short example about doors and space, which grew into a really long example because I was enjoying it!

Essentially it’s the beginning of Alice in Wonderland, using only 3 rooms. I also annotated it with my thought process. Sorry for the indulgence:

[rant][code]“Rabbit Hole” by Hanon Ondricek.

[A demonstration of creating lots of space with only three rooms]

When play begins: [this is printed before the banner]
say “Oh goodness. Perhaps you shouldn’t have followed that rabbit so far down his rabbit hole. Or stolen the tarts, or made that rude comment about the Duchess…but we’ll get to that…[paragraph break]”

Yourself can be small or big. [this adjective will cause magic later, allowing me to restrict the player and change things based on which property the object (in this case the player) has. a thing will take the last property named in a list - so the player is big.]

The description of the player is “[one of]Curiouser . . .[or]. . .and curiouser . . .[stopping]”

Falling is a room. [The player is going to fall for a while, so there are no exits. The movement is conveyed by description]

The Description is “[one of]You seem to be falling down an incredibly deep hole. Up and down both fade away into darkness. Your hair and dress flutter in the breeze.[or]You continue to fall.[or]My goodness, will this fall never end?[or]Why, if you fall any further, you may come about with the people who walk with their heads downwards.[or]How awkward will that be to introduce yourself, ‘Excuse me Ma’am, is this New Zealand or the Belgian Azores?’[or]…and…you continue to fall…[stopping]”

my hair is part of the player. The description is “Golden blonde locks.” [in case the player examines it, since it’s mentioned]

Every turn when the location is Falling: [random ambience in this room]
if a random chance of 1 in 3 succeeds:
say “[one of]Your apron straps flutter around your head.[or]A shelf whizzes past…or rather you whiz past on your way down. Was there a tea service set up there?[or]You idly scratch an itch on your shin; such an odd thing to do whilst plummeting to your death.[or]You wonder if you should ever worry much about falling down the stairs next time it happens. Why you could fall off the roof after this and barely think of it.[or]You hum a bit of a tune to yourself, not sure if you’ve got the melody right.[cycling]”.

Instead of going when the location is Falling, say “Up, down, northwest – like you have any choice about where gravity takes you.” [this lets the player try going in directions, but will prevent them]

The player wears an apron. Understand “apron/strap/straps” as an apron. The description of apron is “You forgot to take it off after tea. [First time]It complements your blue dress nicely.[only]”.

The player wears your favorite blue dress.

Understand “tea-dress” as blue dress.

Instead of taking off blue dress, say “Your British modesty prevents you.” [since we implemented clothing, we don’t want the player naked in this case]

A tea service is scenery in Falling. The description is “You only wish you had some tea.” [since we mentioned a tea service, we don’t wan’t ‘you can’t see any such thing’]

A shelf is scenery in Falling. The description is “You think you make out shelves and cabinets and bookcases built into the walls, but they all speed by too quickly to interact with.” Understand “shelves/cabinet/cabinets/book/case/bookcase/bookcases/wall/walls” as shelf when the location is Falling.

a jar of orange marmalade is a thing. The description is “[if the location is Falling]It falls tantalizingly near you at nearly the same speed.[otherwise][one of]A jar of your favorite orange marmalade.[or] Gitchy lady mar-ma-laaaaAAA…[or]…aaaaaa…[or]…aaaaaade.[or]It’s orange marmalade.[stopping]” [created out of world or “off-stage” instead of in a room keeps it ready for later]

Instead of taking something when the location is Falling: [since the player may try taking all sorts of things]
if the noun is orange marmalade:
continue the action; [I want the player to only be able to take the marmalade when it appears - “continue the action” negates the “instead” rule so someone won’t see the next text if the noun is the marmalade]
say “[one of]You make a grab for a shelf, and miss.[or][The noun] speeds by, tantalizingly out of reach.[or]You manage to knock a jar off the shelf, but can’t grab it due to an abrupt shift in direction of the vertical tunnel.[or]You have grown tired of reaching for things, and continue to fall lazily, waiting for death.[stopping]”. [sometimes it’s good to let a player try something and fail a couple of times so the refusal is more natural]

Rule for printing the name of orange marmalade when the location is Falling:
say “falling jar of orange marmalade”. [changes how an item is described in this room]

Every turn when the player has been in falling for 7 turns: [here’s how we make the marmalade appear after a while]
if marmalade is off-stage:
move marmalade to falling;
say “A falling jar of orange marmalade catches up to you and hovers nearby.”

After taking marmalade for the first time, increase the score by 1. [“for the first time” keeps the player from re-scoring points]

Instead of opening Marmalade, say “It’s stuck obnoxiously closed.” [I don’t want the player to open it till the tea party]

Bottom of Rabbit Hole is a room. “You have landed in an underground chamber with hundreds of doors leading in all directions.” [it’s not connected to Falling, as I’ll manually put the player there later]

Definition: a thing is unheld if it is portable and it is not held by the player. [I’m going to make a complicated phrase, so this defines specific types of things which may or may not be present]

Every turn when the player has been in Falling for 15 turns: [they’ve fallen long enough]
say “Aaaand…THUMP. You land hard, but surprisingly not with enough violence to kill yourself as you expected, luckily due to several years[’] worth of fallen leaves piled at the bottom of the rabbit hole.”;
move the player to Bottom of Rabbit Hole;
repeat with item running through unheld things in Falling: [this makes every unheld thing as I’ve described hit the ground with the player so they’re accessible]
move item to rabbit hole;
say “[The item] lands [one of]a moment later[or]a moment after that[stopping].”

Garden is a room. [I don’t connect it since there’s going to be an actual usable door in the way. also getting to Garden wins the game so I don’t bother with a description]

hundreds of doors is a fixed in place thing in Rabbit Hole. The description is “You approach [doordesc] and [dooraction]. [Frustration]!” [I don’t need to make hundreds of actual doors, but I need to vary the descriptions enough so it seems like there are. these are say phrases I’ll define next]

To say doordesc: say “[one of]a wooden door with metal bolts in it[or]a tall narrow door[or]a metal door with a window in it[or]a revolving door[or]a padded naugahyde door[or]a round door[or]a barred iron door[or]a battered looking slat on hinges[or]a bronze portcullis[or]a hallway lined with spikes[cycling]” [it’s important to make sure your say phrases all hang together no matter what order they go in.]

To say dooraction: say “[one of]regard it quizzically[or]try to figure out where the handle is[or]make several attempts to get through[or]stand in front of it, tapping your foot[or]try several different variations of a combination on a dial you find nearby[or]stamp the floor in frustration[or]try to figure out what to do[at random]”

To say Frustration:
say “[one of]Useless[or]Fruitless[or]Nonsense[or]Bother[or]Humph[or]Pointless[at random]”

Instead of opening hundreds of doors, try examining the noun. [I make the description random enough so it can apply to examining or opening]

Does the player mean examining hundreds of doors: it is likely. [to avoid disambiguation “do you mean the tiny door or hundreds of doors?”]

Before going nowhere from Rabbit Hole, say “You wander [one of]around in circles[or]past several more doors[or]in a figure eight pattern[or]down a promising looking path[or]for a long while in one direction[at random], then realize you[one of][’]re right back where you started[or] haven[’]t made any progress[or][’]re going in circles[or] appear to be lost. After more wandering, you recognize the tiny door[or] should try making a map[or] couldn[’]t even begin to draw a map of this place[cycling].” instead. [going nowhere means trying any direction that does not go anywhere with a map connection, so it feels like we can walk around even though we’re not]

Understand “door/wooden/wood/metal/bolt/bolts/tall/narrow/metal/window/revolving/padded/naugahyde/round/barred/iron/battered/slat/hinge/hinges/bronze/portcullis” and “hallway/spikes/combination/dial/handle/knob/doorknob” as hundreds of doors. [the player will probably try all the doors i describe. They’re all the same one.]

a tiny door is a door. “[if the player is small]The formerly tiny but now normal sized door beckons to the southwest.[otherwise][one of]One tiny door catches your attention, since it’s so much smaller than the others.[or]The tiny door sparkles.[or]…and there’s the tiny door.[stopping]” [here’s the actual door. I want it to change appearance depending on how big the player is]

Tiny Door is openable and locked. The description is “[if the player is big]It’s far too small for you to get through.[otherwise]It’s just the right size to go through![end if]”. [more description if the player examines it]

a tiny key unlocks tiny door. [but it’s off-stage]

Tiny door is southwest from Rabbit Hole and northeast from Garden. [the door connects the rooms, but a door is not a room, so you can test “if the player is going through it” but they will not stop in a doorway]

After opening tiny door:
say “The [if the player is big]tiny [end if]door opens, at last, in a southwesterly direction.”;
increase the score by 1. [award points and clarify which way to go, the door won’t open till we have the tiny key and it’s unlocked. by default, a door starts closed.]

The description of tiny key is “Tiny. And key-shaped.”

Every turn when the player has been in Rabbit Hole for 5 turns: [the key will appear mysteriously]
if tiny key is off-stage:
move tiny key to Rabbit Hole;
say “Clink! You turn around and around looking for the source of the noise.” [I don’t need to say what happened exactly, because the object is there and will hopefully get noticed]

After taking tiny key for the first time:
increase the score by 1. [ding]

Before going through tiny door when the player is big:
say “There’s no way to fit through there.” instead. [Not only must you unlock the door, but you must shrink]

Before going through tiny door when the player is big and tiny door is open: say “You squeeze down to the floor and peek through. [one of]A lovely garden is visible through it.[or]You wish you could get through to go in the garden.[stopping]” instead. [I want to give the player a sense of progress, so if the door is open we can see what’s coming up]

gardenview is scenery in Rabbit Hole. The description is “[if tiny door is closed]What garden?[otherwise if the player is big]A beautiful tiny garden of tiny hedges and tiny flowers and tiny venus fly traps.[otherwise if the player is small]The garden beckons through the door to the southwest.[end if]”.

Understand “garden/hedge/hedges/flower/flowers/venus/fly/trap/traps” as gardenview.

a small cake is an edible thing. The description is “A tiny cake with ‘EAT ME’ written in pink frosting. [first time]Sort of an odd cake sentiment…[only]” [first time - only is great to make an observation that won’t repeat every time]

After eating small cake: [magic happens…]
now the player is small; [nothing actually happens, I just change the adjective since the player is either big or small]
say “Strangely oregano-flavored, and – oh my what’s this rushing up at you…the floor!”;
change the printed name of tiny key to “somewhat large key”; [here we can permanently (or semi permanently) alter what things are called or how they’re described]
change the printed name of tiny door to “normal door”;
change the printed name of hundreds of doors to “hundreds of giant doors”;
change the printed name of marmalade to “giant jar of marmalade”;
increase the score by 1.

Understand “somewhat/large” as tiny key when the player is small. [the game can understand different adjectives for the same object in different cases if you spell it out]

Understand “normal” as tiny door when the player is small.
understand “giant” as hundreds of doors when the player is small.

Every turn when the player is in Rabbit Hole:
if small cake is off-stage: [ie, if we can’t get the cake]
if we have not eaten small cake: [so it won’t happen twice]
if a random chance of 1 in 8 succeeds: [we’re not sure when it will happen to vary the game]
move small cake to rabbit hole;
say “With a fluttering of leaves, the White Rabbit scurries by, screaming about his calendar. As he runs off, you notice his lunch pail is open and something drops out of it.” [I don’t need a character since he’s only zipping by. in a longer implementation we’d have an npc]

Instead of unlocking hundreds of doors with tiny key:
say “The key won’t fit any of the normal sized doors you try.” [since “hundreds of doors” are not an actual door, I don’t want the parser to confuse the player by saying that a key won’t fit a door, but of course it shouldn’t work]

Rule for printing the name of hundreds of doors while asking which do you mean: say “another door”. [during disambiguation, I don’t want the parser to say "do you mean the tiny door, or hundreds of doors]

Understand “another” and “another door” as hundreds of doors. [so the player can answer “another door” during disambiguation]

some leaves are scenery in Rabbit Hole. The description is “Hundreds of leaves crunch underfoot, blown down here from countless autumns.” [I mentioned earlier that the player landed in leaves, and the rabbit was described as kicking them]

Understand “pile/leaf” as leaves. Instead of taking leaves, say “You’ve no time to gather leaves.” [I don’t want the player to bother the leaves]

Every turn when the player is in Garden: [reaching the garden is victory, so I want the game to check every turn]
say “You emerge out into the tiny (but normal-sized to you) bright sunny garden! A normal-sized (but giant-sized to you) venus fly trap gnashes its teeth in your direction hungrily![paragraph break]”;
end the story finally saying “. . . And then a whole lot of other stuff happens . . .”

The maximum score is 4312.

[/code][/rant]

How very charming! I have a couple of comments, in case you want to do more with this:

  1. You should probably change the description, printed name, etc. of the marmalade jar when it’s held in Falling. Otherwise it seems to be falling past you even when it’s in your inventory.

  2. I’d call the “tea service” the “tea service set”; that’s how I tried to refer to it the first time.

  3. Unfortunately, the disambiguation involving “another door” doesn’t work, because Inform has already decided that “another” is basically a null reference. So if you choose “another” it disambiguates to the tiny door anyway. It seems to me that the only way to change this is to hack the I6 template files where they mention OTHER1__WD, but the better part of valor would probably be to change the way you try to disambiguate it (say “a normal/giant door” instead of “another door,” for instance).

  4. “x tiny” and “open tiny” tend to disambiguate to the tiny key when you hold it; this is another annoying thing that Inform sometimes does which may be hard to get through.

Again, very nice!

What a wonderful example of what I was trying to say! And it looks like so much fun, I could see why you got carried away coding this example. :slight_smile: I’ll have to give it a spin sometime, I’m heading off to bed.

Great catch! Yes, I’d fix this if I made it longer. I love Alice, but hasn’t it been done to death in IF? There was the Magnetic Scrolls game at least, which I never got very far through.

That’s something I do worry about; I suspect a lot of the IF fan base are European/British, and I have to consider whether American idiom is always appropriate. I have heard of “tea service” as an entire kit for serving tea, but wouldn’t have come up with “tea set” though it makes sense. I know when I put synonyms for “the buttocks” I try to remember and include “arse”. :slight_smile:

I’m so glad I read these forums, I never would have known that. I know enough I7 to be dangerous but when it goes to I6 I’m clueless, except for one line I copy and paste to perform actions inline with quoted text.

I noticed "another door"didn’t work but was done with the code by then. “different” door is probably the appropriate way to go.

If I did this as a full-fledged game, I would probably stylistically need to come up with lots of synonyms for small: tiny, teeny, eensy, wee, minuscule, microscopic…etc. :slight_smile: