I6: sky and ceiling

I’ve noticed that both “x ceiling” and “x sky” are treated as synonyms for “look up” in ALL locations. While this makes sense in an indoor location with a window, it makes no sense whatsoever to refer to a ceiling outdoors. Is there any way I can make the game recognise that ceilings exist only indoors?

An easy way is to redefine the verb look. A hard way is to hack the I6 library.

In my WIP, I’ve replaced the verb look so that ‘look up’ doesn’t exist.

I would vote for hacking the library. What I usually do, when engaging in this type of trickery, is put a comment that includes the words “JA HACK” just above the new lines, together with an explanation of what I’m changing. This makes it easy to search for my hacks. If you copy the original library code itself into the comment, it will be easy to restore the original later. (A diff program can do the same chore, if you forget to add comments. On Windows, I recommend CSDiff.)

Having gotten rid of the default behavior, you can create, if you like, a floating ceiling object with a found_in that lists all indoor rooms, and a sky object that works similarly with all outdoor rooms. I have been known to create IndoorRoom and OutdoorRoom as classes. This lets me define default messages for them. In an IndoorRoom, for instance, the default for nw_to and other diagonals might be, “You go over and stand in the corner for a minute.” Outdoors, the error message for ‘down’ might be, “There are no entrances to caves, mines, or wells here.”

Inspired by Jim’s comments, I wrote the following nifty code snippet.

compass_look [ obj direction;
     objectloop(direction in compass)
     {
      if(obj == direction)
      {
       if(self provides obj)
       {
        if(self.obj() ofclass Room)
        {
         print "You see an exit leading ";
         if(self.obj() has visited)
          {print "to ", (the) self.obj(), ".^";rtrue;}
         else
          {"you know not where.";} 
        }
        if(self.obj() ofclass DoorClass)
        {
         print "You see ", (a) self.obj(), " leading ";
         if(self.obj().door_to() has visited)
          {print "to ", (the) self.obj().door_to(), ".^";rtrue;}
         else
          {"you know not where.";}
        }
       }
      }
     }
     ],

When typing LOOK WEST, you’ll get an exit or a door or the default “You see nothing special in that direction.” If you’ve already visited the location, the routine will print its name. Now, having read Poster’s blog, I’m curious how you’d do this in I7.

In I7, there is no need to hack the library. Here is one way to do it:

Instead of examining a direction (called the direction looked): let the destination be the room-or-door the direction looked from the location; if the destination is a room: say "You see an exit in that direction, leading [if the destination is visited]to [the destination][else] you know not where[end if]."; otherwise if the destination is a door: say "You see a door in that direction, leading [if the other side of the destination is visited]to [the other side of the destination][else] you know not where[end if]."; otherwise: say "You see nothing special in that direction."

You might not think it from the overblown animosity toward Inform 7’s documentation you’ll find in some quarters, but you will find very clear documentation of all of this in section 3.12 (Doors) and Section 16.14 (Adjacent rooms and routes through the map); the latter is cross-referenced from the former.

–Erik

Nice. An insult to my reading comprehension skills mingled with some high-falutin’ snobbery and a deligitimization of my experiences and emotions. Keep the hate alive, man.

I’m afraid that I don’t share your Postercentric model of the universe, so the only way I can read this is as egocentrism tinged with paranoia. In other words, while I do find your recent posts on this topic hilariously hyperbolic, I wasn’t referring to you in particular.

–Erik

I like this a lot :laughing: