Skip to content

specialDesc

Jim Nelson edited this page Sep 7, 2021 · 2 revisions

Absolutely unique: Give an item a unique room listing

"Always remember that you are absolutely unique. Just like everyone else."
–Unknown

Problem

When TADS describes a room to the player, it will conclude with a listing of visible items:

Kitchen
You're in the kitchen.

You see a penny, a nickel, a quarter, and a dime here.

The canned message feels generic and disaffected, and makes the game feel unpolished.

It's desirable for items—particularly important ones—to be listed with custom messages:

Kitchen
You're in the kitchen.

Your lucky quarter is here.

There's a solid-looking dime here waiting to be picked up.

A shiny penny gleams up at you.

You see a nickel here.

Solution

Use the specialDesc property to print a custom message for an object when it's listed. Each item will get its own paragraph:

quarter: Thing 'a quarter' 'quarter' @kitchen
  specialDesc = "Your lucky quarter is here.  "
;

penny: Thing 'a penny' 'penny' @kitchen
  specialDesc = "A shiny penny gleams up at you.  "
;

dime: Thing 'a dime' 'dime' @kitchen
  specialDesc = "It's a solid-looking dime.  "
;

(Note the message is double-quoted.)

specialDesc is only used for listing the item with a room description. specialDesc is not used when the item is examined or listed in the player's inventory:

>examine quarter
You see nothing unusual about it.

>inventory
You are carrying a penny, a nickel, a quarter, and a dime.

Source

See also

Clone this wiki locally