Looking in a specific direction

Okay, I’m the first to admit that my IF is a little rusty, I haven’t tried to code anything in about 5 years, and the manual has a habit of putting me to sleep if i read it for too long.

However, I digress.

What I need to do in one location is allow the player to “look up”. This will trigger an event and cause an object to appear that is vital to them continuing. The even, the object, etc., are all coded. But for the life of me I can’t figure out how to intercept the command “look up” in the location.

Can someone point me in the right direction. I know this is going to be something obvious, so I have started kicking myself from here to eternity already in anticipation. :smiley:

Thanks in advance.

“look [something]” triggers the examining action. Thus …

Instead of examining the up, say "Up, up, and away.".

… will result in:

I hope this puzzle is heavily hinted, and the “up” direction has many synonyms (e.g. “upwards/ceiling/lights/sky/sun/clouds/spider/cobweb/fly/bird/etc”).

One way to hint this puzzle would be to encourage players to look up at other places and times. You can do that in two ways: one, by indicating that looking up might do something interesting in other text, and two, by saying something interesting any time a player looks up.

[code]A room has a text called the overhead-description. A room can be indoors or outdoors.
The overhead-description of an indoors room is usually “[one of]A spider crawls across the ceiling[or]You see a cobweb in the corner[or]A fly is buzzing around the ceiling[or]The lights flicker slightly[at random].”
The overhead-description of an outdoors room is usually “[one of]The sky is bright and clear, with hardly a cloud in sight[or]One cloud looks a little like a rabbit[or]A bird soars high overhead[at random].”

Instead of examining the up, say “[overhead-description of the location][paragraph break]”.

The overhead-description of the Sistine Chapel is “With the touch of a finger, God gives life to Adam.”[/code]

(* slaps face with palm *) :blush:
I knew it was something obvious.

That did the trick.

Thanks for the extra pointers about using hints, in this case the player’s attention is drawn to the fact that there is a sound from somewhere above them, and any attempts to go up fail. But i’d not thought about the additional things like ceilings, etc., and i’m sure to use this again another time.

Thanks for the help.

So you might want to catch commands like “examine sound”, “find/follow/locate sound”, “look towards sound”…

Okay, I’m being blonde again.

I take it the code given as an example is for Inform 7. I only found out about Inform 7 over the weekend (I have been away for a while) but am still trying to understand the language, so I am coding in version 6 at the moment.

I don’t suppose someone would be kind enough to post a code snippet compatible with version 6.

From what I can figure, code like this should work

Object room “The Room”
with description “You stand in a room”,
[ obj;
if (obj == u_obj) “You look up”;
w_to AnotherRoom,
has light

The English.h and grammar.h have apparently been updated to handle looking in directions from version 6.11, but it just ignores me


The command was compass_look not compasslook, i found it tucked away in the release notes. The online documentation was wrong :slight_smile: