Pages

3) The file 'locations.i' defines various location classes and attributes.

For example, to implement a simple location in ALAN, you basically do something like this:

THE park ISA LOCATION
   DESCRIPTION
     "You are taking a stroll in a pleasant green park."
     "The exit is to the west."
   EXIT west TO street.
END park.

Now, as the park is an outdoor location, you would naturally need a ground object and a sky object there.

The library helps to implement outdoor and indoor locations by introducing the location classes 'room' and 'site'. 'Rooms' are indoor locations which automatically have floors, walls and ceilings, and 'sites' are outdoor locations with a ground and a sky. Thus, if you declare

THE park ISA SITE
   DESCRIPTION
       "You are taking a stroll in a pleasant green park."
       "The exit is to the west."
   EXIT west TO street.
END park.

the park location will now have a ground and a sky automatically. Similarly, if you declare

THE kitchen ISA ROOM
   DESCRIPTION
"This is a modern kitchen with many devices and utensils." EXIT east TO bedroom. END kitchen.

you will have an indoor location with a floor, walls and a ceiling. In addition, the library takes care of the ceiling and the sky being automatically out of reach - 'reachable' is an attribute that the library uses in many verb definitions to check that objects cannot be manipulated if they are out of reach of the player character.

There is also a class for dark locations. In these, actions requiring seeing have been disabled.

Attributes for locations include e.g. 'visited' and 'described'.

What They Say

"I gotta say, I love it!"

Robert DeFord