Object Description Array or One Time Description

I have been scouring the tutorials and manuals for a way to do one, or both of the following:

When examining an object etc - show one description, then any following examination show a different description.


When examining an object etc - show a random description from within an array of descriptions.

I would like to use these techniques to provide the player with some lengthy story development, but if they examine the item again, give them a brief description of it.


You can use initDesc property of an object for this:

modify Thing
    isInInitState = (!described)

someRoom: Room 'xxx' 'xxx'

+ Thing 'nice little thing' 'little thing'
    "Ordinary description "
    initDesc = "First time description. "

If you want a randomly varying description, here’s one way to do it. I’m creating a ShuffledEventList object as a property:

desc = "<<varyingDesc.doScript>>" varyingDesc: ShuffledEventList {[ 'Some description. ', 'A different description. ', 'Another different description. ' ]}

Thank you so much! I have tried the isInInitState and that works great. The script solution seems to do exactly what I need. Thanks!

Just released TADS 3.1 has nice additions to make these kind of tasks much more practical:

+ Thing 'nice little thing' 'little thing'
    "<<one of>>first time description<<or>>ordinary description<<stopping>>"

See http://www.tads.org/t3doc/doc/sysman/strlit.htm#oneof for more examples including ShuffledEventList-like behavior and more.

Ooo! That is really slick! Thanks.