WelcomeWhat's NewsORLibraryDownloadsLinksWebMaster@OnyxRing.com

This site
produced
516416
pageviews since
8/19/2004

Today's date:
9/3/2010

Google

Web
OnyxRing





Author: Site Admin
Title: CompassLook:Scenery From a Distance

Creation Date: 8/6/2004 10:38:29 PM
Last Updated: 8/17/2004 11:25:38 PM


Note: This article has been eliminated from AIDG proper, since the functionality it describes was implemented in the new 6/11 standard library. It is being kept for posterity.

CompassLook:Scenery From a Distance

I found myself very frustrated with outside direction descriptions. The opening scene in my work in progress includes a very panaramic view of the world. Obviously, the default behavior of the library is insufficient to describe background scenery. If a player were to try:
     > LOOK EAST
     I only understand you as far as wanting to look.

...clearly this is a jolt to the player. I wanted something more like this;
     > LOOK EAST
     You cover your eyes and squint into the morning sun, trying to make out the 
     landscape in the distance. To the northeast, a grove of orange trees
     stretches into the distance, directly east is a long and winding dirt road,
     and southeast is widespread farmland with mountains in the background.

...this gives the player a much larger feel for the game and I would try to encourage use of this feature to help with imersion.

So the changes I added to the library are as follows:

Modifications:

In english.h
     *** OLD ***
     Class  CompassDirection
          with article "the", number 0,
          has  scenery;

     *** NEW ***
     Class  CompassDirection
          with article "the", number 0,
          before [;     
               Examine,Look: 
                    if (location provides compasslook) return
                    location.compasslook(self); ],
          has  scenery;

In grammar.h
     *** OLD ***
     Verb 'look' 'l//'
          *                                         -> Look
          * 'at' noun                               -> Examine
          * 'inside'/'in'/'into'/'through' noun         -> Search
          * 'under' noun                            -> LookUnder
          * 'up' topic 'in' noun                    -> Consult;

     *** NEW ***
     Verb 'look' 'l//'
          *                                         -> Look
          * noun=ADirection                         -> Examine
          * 'at' noun                               -> Examine
          * 'inside'/'in'/'into'/'through' noun         -> Search
          * 'under' noun                            -> LookUnder
          * 'up' topic 'in' noun                    -> Consult;

Implementation:

In order to use these changes, you simply add a compasslook property procedure to a given location object:
     Object Spot_In_Road "Spot In Road"
          with     name 'spot' 'in' 'road',
          description "You're standing in a spot in the road 
                 that stretches east and west. You can see a great 
                  distance in all directions.",
          compasslook
          [ obj;
               switch(obj){
                    e_obj,se_obj,ne_obj:     print "To the far east 
                                 stretches a great sea of wheat.";
                    n_obj: print "To the north you see a large mountain.";
                    w_obj,nw_obj,sw_obj:     print "To the west there is large 
                            wall stretching from north to south.";
                    s_obj: print "A great wall curves from the west and around 
                            to the south.";
                    u_obj: print "As you look up a large bird does dootie on 
                            your face.";
                    default: rfalse;
               }
               rtrue;
          ],
          has light;

It would be convenient if the IFNDEF WITHOUT_DIRECTIONS was placed before the CompassDirection class and Compass object because then this would possibly be a library contribution. But if you want to post it on your site, that's good enough for me. I think many people have asked for an elegant way to handle this situation.



Copyright 2004 - 2010 : Site Admin
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