Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Inform] Handling walls in each object elegantly....

3 views
Skip to first unread message

David A. Cornelson

unread,
Mar 12, 2001, 11:43:18 PM3/12/01
to
Hey,

As I'm working on my game, one of my beta-testers has been determined to
point out that outside locations should not have 'walls'.

There's a library routine Compass.H that will help you do some stuff to
handle this, but I was looking for something more conducive to 'writing'.

So here's what I've come up with. If someone can figure out how to package
this into a library, feel free.

In grammar.h I added in the look verb
* noun=ADirection Examine
so Look East would work the same as Examine East

In english.h I changed the Class CompassDirection to:
Class CompassDirection
with article "the", number 0,
before [; Examine,Look: if (location provides compasslook) return
location.compasslook(self); ],
has scenery;
....the only thing different is the addition of the before property....

In my game I added the property compasslook, although this would
theoretically belong in one of the Inform library files.

In my game file I can now add the following code:

Object river "River"
with name 'river',
description "You're near a river. To the east is a wide plain and
to the west is a large forest.",
compasslook
[ obj; switch (obj) {
e_obj: print "To the east you see a wide open
plain.^";
w_obj: print "To the west you see a large forest.^";
default: rfalse;
}
rtrue;
],
has scenery;

So now at this location, if the player types look east or examine east, they
get:

>look east
To the east you see a wide open plain.

>

instead of

>look east
I only understand you as wanting to look.

or

>x east
You see nothing special about the east wall.

which when you're outdoors, or even indoors in an elaborate location, makes
little or no sense and clearly takes away from the 'feel' of your
environment.

Jarb


0 new messages