Skip to content

initSpecialDesc

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

First impressions: Give an item a special description until it's moved or picked up

Problem

You have an item and you want a unique description when it's first seen. Once the item is moved or picked up, the description should revert to a standard text.

This can be used for several effects, for example, if an item appears out of place, or to make a significant first impression upon the player:

Kitchen

A gleaming magic wand is here.

>look
Kitchen

A gleaming magic wand is here.

>get wand
Taken.

>examine wand
A boring magic wand.

>drop wand
Dropped.

>look
Kitchen

You see a magic wand here.

Solution

Use the initSpecialDesc printed text property:

MagicWand: Thing 'a magic wand' 'magic wand' @kitchen
  "A boring magic wand.  "
  initSpecialDesc = "A gleaming magic wand is here.  "
;

Source

See also

Clone this wiki locally