inform7

Inform 7 [the noun] in description of location


I'm trying to put "stranger man" instead [the noun]. In this piece of code:

Rule for listing nondescript items: do nothing.

A staircase is a kind of door. A staircase is usually open.
A staircase is seldom openable. The ladder is a staircase. 
The ladder is above the Entry and below the Reception. 
The description of Entry is "You see ladder forward.".
A stranger man is man in the Reception. 
The description of Reception is "You see [the noun] at the reception. On the left side is corridor.".

In describing the location, I see "the up" instead of "the stranger man". But after attack and remove the noun from play;, I see "nothing" - all right.

Entry
You see ladder forward.

>up

Reception
You see the up at the reception. On the left side is corridor.

>attack man
You attack the stranger man, causing 5 points of damage!

The stranger man attacks you, causing 7 points of damage!

>attack man
You attack the stranger man, causing 8 points of damage!

The stranger man attacks you, causing 7 points of damage!

>attack man
You attack the stranger man, causing 6 points of damage!

The stranger man attacks you, causing 2 points of damage!

>attack man
You attack the stranger man, causing 4 points of damage!

The stranger man attacks you, causing 8 points of damage!

>attack man
You attack the stranger man, causing 10 points of damage!

The stranger man die, you win!

>attack man
You can't see any such thing.

>look
Reception
You see nothing at the reception. On the left side is corridor.

why is this happening?


Solution

  • "The noun" is a global variable referring to whatever the main object of the previous action was, which in this case is the direction "up". When you looked the second time, it tries to access the previous object, but because the parser failed the result is the null object, "nothing".

    I'm not too sure what you're trying to do, but trying to refer to a man who won't always be there in the room description like that is almost certainly the wrong approach. If what you're trying to do is to list the man before the exits, then the Room Description Control by Emily Short extension might help.