[I6] Understanding Brief Mode

Hello,

I’m hoping that someone can help me out with Brief Mode.
I have my game in lookmode = 1; But none of my rooms will go brief. They all print long descriptions.
I’ve found this in the verblib.h. It looks like it deals with the room description.

! The room description (if visible)

if (lookmode < 3 && visibility_ceiling == location) {
    if ((allow_abbrev ~= 1) || (lookmode == 2) || (location hasnt visited)) {
        if (location.&describe) RunRoutines(location, describe);
        else {
            if (location.description == 0) RunTimeError(11, location, description);
            else PrintOrRun(location, description);
        }
    }
}

So I’ve even tried: has visited; in one of the rooms, but I can’t get it to drop the decription.
Does anybody know what I’m missing here? Or how visited works?
BTW, the game does go into superbrief. I’m using the 6.12.5 library set.

From Roger Firth works:

Change the default BRIEF lookmode into SUPERBRIEF or VERBOSE

Normally, an Inform game will set BRIEF as the default look mode, which gives long descriptions of places never before visited and short descriptions otherwise. You can change this by setting the variable lookmode to a suitable value:

  lookmode = 1;             ! BRIEF mode.
  lookmode = 2;             ! VERBOSE mode (always long descriptions).
  lookmode = 3;             ! SUPERBRIEF mode (always short descriptions).

First visit should give you long description. Subsequent visits should give you short description. Is this not so?

No. I have it in lookmode = 1;

It keeps giving me the long description. It shouldn’t, but it does.

I think you should post a short illustration code to show the problem, maybe 2 rooms, so people can help. I don’t see anything wrong with your approach. Lookmode=1 should be the default.

Maybe it does have something to do with the way I build my rooms.

I put everything in the description.

Here’s a two room game that uses all the current libraries off GitLab:
BriefMode-6.35.zip (503.2 KB)

  • Thanks for the help
RoomObj -> firstRoomObj "room"
    with  name 'room',
          description [;
	            <<Look firstRoom>>;
          ],

I’m pretty sure this is the problem.

Look firstRoom; (command)

Will always give long description. Try putting in temporary text and see what happens. If not this, then maybe someone else who is more well versed with the library can help.

I’ve stripped the room to:

  Room    firstRoom "First Room"
   with   description 
              "This is the first room description.",

And it’s still printing the long description everytime.

Oh, well. I tried. Hopefully somebody smarter than me can help. Maybe it’s the way you structure your Room and RoomObj (and class declaration and instantiation), but that kind of manipulation is beyond me. Sorry.

That’s a good point. I tried it with the room as an object and get the same error.

  Object  firstRoom "First Room"
   with   description
              "This is the first room description.",

So maybe there’s a bug?

Bug? Maybe. Here’s something else I notice:

s_to [;
              return PlayerTo(secondRoom);

You usually don’t do it that way. The use of PlayerTo is considered advanced usage. I think there’s a second form of PlayerTo(Room,2) where it changes description behavior. Please consult DM4 manual for details.

the north and downwards to south, pale white like shark’s
teeth in the diffused light from the sodium lamp above.",
ne_to Shrine, n_to Canyon_N, u_to Canyon_N,
s_to Canyon_S, d_to Canyon_S,

is commonly done. From DM4.

I don’t think you should split room description on each separate files either.

Really, I think DM4 is the go to document for Inform6.

So yeah. s_to secondRoom, works.

But why? What is being set? It has something to do with “location hanst visited” in the code above.

Is there any way to set visited?

Doing something like s_to secondRoom, wouldn’t work. I’m doing that for a reason. If I could set visited and stop it from printing the room description, it would help.

Visited should be set automatically. That’s why I suggested doing it the standard way. If that doesn’t work, then there may be a bug.

Fixing it will involve deep dive into the library, and that’s not something I do. Sorry.

If you want to hack it, I’d just replace the description with a routine (not a command) that returns appropriate text depending on has visited. But even that is too much for me. I usually just ignore the problem. :grin: If it’s library bug, then it will automatically be resolved … eventually.

Yeah. I’ve been digging in the library, and I can see visited is being set. So now I think it might have something to do with allow_abbrev. I need to see where that’s changed.

I dug into the PlayerTo Routine.

I could be wrong, but I think this will work:
return PlayerTo(secondRoom, 2);

The 2 become LookSub(1);

[ PlayerTo newplace flag;
    NoteDeparture();
    move player to newplace;
    while (parent(newplace)) newplace = parent(newplace);
    location = real_location = newplace;
    MoveFloatingObjects(); AdjustLight(1);
    switch (flag) {
      0:    <Look>;
      1:    NoteArrival(); ScoreArrival();
      2:    LookSub(1);
    }
];

I"ve tested this a bit, and it seems to work. I just hope I’m not breaking something else. :confused:

Thanks. Hopefully someone that knows this code can say if I’m doing it correctly or not.

1 Like

You seem to be working against the library rather than with it. This is bound to get you into trouble.

A routine in an exit property (like s_to) should never move the player. It should either print a message saying why you can’t go there and return true, return 0 if the player just can’t go there, or return the room or door they’ll get to of going that direction.

Just like the description property of a room should just print the description text, not invoke a Look action.

2 Likes

Ok, but then how to I do something like this:

s_to [;
    if (frob in self) return "The way is blocked.";
    return PlayerTo(secondRoom);
],

Something like:

s_to secondRoom,

would miss stopping the player if the frob was in the room.

You should set lookmode = 1 in your Initialise routine. There’s no need to muck about with it anywhere else, except perhaps for testing it.

As @fredrik said, don’t use PlayerTo() in your n_to, etc. routines and when you do use it, use the optional flag with a value of 2 to have it behave the same as lookmode = 1, i.e. PlayerTo(room, 2).

s_to [;
    if (frob in self) "The way is blocked.";
    return secondRoom;
],

That works. :slight_smile:

But @Warrigal is also right. I still need to do:

before [;
    Exit:
        if (frob in self) return "The way is blocked.";
        return PlayerTo(secondRoom, 2);
],

In the Before Routines.

Thanks guys. This helped a lot. :clap:

Glad you got it working.

You need to return true from before. AFAIK, PlayerTo isn’t guaranteed to do that. It’s safer to do:

PlayerTo(SomeRoom);
rtrue;

As it happens, this also compiles to shorter and faster code, at least on the Z-machine.