WelcomeWhat's NewsORLibraryDownloadsLinksWebMaster@OnyxRing.com

This site
pageviews since

Today's date:

Author: Roger Firth
Title: Making VERBOSE the default mode

Creation Date: 8/6/2004 10:38:26 PM
Last Updated: 8/6/2004 10:38:26 PM

Making VERBOSE the default mode

The Inform Library provides three commands for players to control how rooms are described: VERBOSE prints a room's full description every time you go there, BRIEF prints the full description only on your first visit, and SUPERBRIEF never prints the full description.

The Library's default setting is BRIEF, but many authors (and players) prefer VERBOSE behaviour -- to have a room fully described on each visit. Of course, just typing a VERBOSE command achieves this, but it's annoying to have to remember every time: much more convenient to make VERBOSE the standard setting.

The Library uses a global variable lookmode which can take the values 1 (BRIEF), 2 (VERBOSE) and 3 (SUPERBRIEF), and which is initialised to 1 in the parserm.h file. So, to make VERBOSE the default, you can either just edit that file, or better (since it's preferable where possible to over-ride the Library rather than change it) add this line to your Initialise() function:

lookmode = 2; !! default is VERBOSE mode

At a mimimum, that's all you need to do. However, here are three additional changes that you may wish to incorporate. First, the message printed by the BRIEF command starts off:

YOURSTORY is now in its normal "brief" printing mode...

when of course BRIEF now isn't the normal mode. Second, the command NORMAL should be a synomym for VERBOSE rather than for BRIEF. Finally, you may consider that players should always see a room's full description at least once; therefore, you wish to disable entirely the SUPERBRIEF command. Here's the skeleton of a game which does all this:

Constant Story "MyStory";
Constant Headline "^An example game.^";

Include "Parser";

Object  LibraryMessages with before [; !! replace three Library messages
  LMode1: " is now in its ~brief~ printing mode, which gives long descriptions
            of places never before visited and short descriptions otherwise.";
  LMode2: " is now in its normal ~verbose~ mode, which always gives long
            descriptions of locations (even if you've been there before).";
  LMode3: " doesn't support ~superbrief~ mode.";

Replace LMode3Sub; !! don't use original Library routine

Include "VerbLib";

[ Initialise;
        lookmode = 2; !! default is VERBOSE mode
        location = hall;
        "^^Adventures don't get much simpler than this.^^";

[ LMode3Sub; print (string) Story; L__M(##LMode3); ]; !! replacement routine

Class   Room
  has   light;

Room    hall "Hall"
  with  description "A door leads south from the hall...",
        s_to study;

Room    study "Study"
  with  description "A door leads north from the study...",
        n_to hall;

Include "Grammar";

Extend only 'normal' replace * -> LMode2; !! NORMAL = VERBOSE

Copyright 2004 - 2021 : Roger Firth
OnyxRing.com has been given the potentially non-exclusive right to display the content of this article. However the original author retains all rights. Permission to reproduce this article -- either in part or in whole -- is left strictly to the discretion of the original author.

Table of ContentsAuthorsSearchIndex
Would you
recommend this
article to
someone else?
You bet I would! Heck No!