The TADS Alternate Library
Version 2.0

Special Display Attributes


Copyright 2000 by Kevin Forchione.
This is part of the TADS Alternate Library Authors Manual.

Introduction and Table of Contents




Special Display Attributes

 

Alt implements the so-called inform-style room display. TADS authors can take advantage of the following object description properties:

 

         initial

         describe

         whenOpen & whenClosed

         whenOn & whenOff

 

Additionally, Alt will alter the normal room display to reflect the following order:

 

         room.initial

         room.nrmLkAround

o        room.describe or room.ldesc

o        room.contents_fixeditems.heredesc

o        room.contents.describe room.contents_containers.whenOpen & whenClosed

o        room.contents_switchItems.whenOn & whenOff

o        room.contents_doorway.whenOpen & whenClosed

o        room.contents_actors.actorDesc

o        room.contents.initial

o        room.contents.listCont()

o        room.contents.listContCont()

         room.firstseen

Why Use Special Display Attributes?

The initial, describe, whenOpen, whenClosed, whenOn, and whenOff are useful to create certain effects in a game display. For instance:

Wonderful World of Containers

This is Room 11, east of the foyer. You notice a typical piece of scenery which turns out to be a surface: a mantelpiece.

A bearded psychiatrist has you under observation.

A portable television set has two sub-objects attached: a power button and a screen.

A pretty typical shut cupboard is bolted to one wall.

A macrame hangs from the ceiling, shut tight. Inside you can make out a music box.

You can also see a green ball, a red cone, a blue pyramid, a plain shopping bag (which can only hold 2 things), and a glass box with a lid, a steel box with a lid, a toothed bag, and a bolted key here.

 

Ordinarily TADS would display the room.sdesc, followed by the room.ldesc, actor.actorDesc, and then a listing of the room contents. The above display demonstrates the use of initial and describe to separate out certain objects from the room contents as being of special note, and provides more information than would normally be available with obj.sdesc.

initial String or method

For objects: The description of an object not yet picked up, used when a room is described.

For rooms: Called when the room is arrived in. Displays before room.sdesc.

Warning: If the object is a doorway, or a container, or is switchItem, then use one of the when-properties rather than initial.

No return value expected from method.

describe String or method

For objects: Called when the object is to be described in a room description, regardless of whether the object has been moved or not.

For rooms: not yet incorporated.

No return value expected from method.

whenOpen String or method

For objects: Called when the container or doorway is open.

No return value expected from method.

whenClosed: String or method

For objects: Called when the container or doorway is closed.

No return value expected from method.

whenOn: String or method

For objects: Called when the switchItem is active.

No return value expected from method.

whenOff: String or method

For objects: Called when the switchItem is not active.

No return value expected from method.