Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

I don't understand this error

9 views
Skip to first unread message

Ben Perlmutter

unread,
Dec 21, 2009, 5:14:06 PM12/21/09
to
This object definition appears to use template notation, but it
doesn't match
any defined object template. Check your 'object template' definitions
to make
sure this object syntax is defined, or correct this object definition
to match
one of the defined templates. If this object is not intended to use a
template
at all, the object's first property definition probably has a syntax
error, so
check the object's property list syntax.

When I double click, it brings me to this line:

+ cellDoor: Door 'cell door' 'door' 'locked door' 'closed door'

What is wrong with that line - English please.

Jim Aikin

unread,
Dec 21, 2009, 5:28:09 PM12/21/09
to

Templates are potentially rather confusing, until you get used to them
-- but they're a very convenient feature. You may want to open up the
Library Reference Manual, click on the Templates link in the top row,
and then click on Thing in the lower left box. You'll be taken to a
definition that looks like this:

'vocabWords' 'name' @location? "desc"?

What this tells you is that after defining a Thing using template syntax
(and Door is a descendant of Thing), you need to have two single-quoted
strings, followed by an optional @location, followed by an optional
double-quoted desc. Since you're already using + notation, you shouldn't
use @location too. So what you want is this:

+ cellDoor: Door 'cell locked closed door' 'cell door'
"It's a massive iron door."
;

...and so forth. This template is described on p. 33 of "Learning TADS
3." All of the adjectives go in a nice list within the vocabWords
property, followed by all of the nouns, the nouns being joined by slashes.

--JA

Khelwood

unread,
Dec 21, 2009, 6:11:12 PM12/21/09
to

The compiler is trying to infer a template that has four successive
single-quoted strings, of which there isn't one. I believe you mean

+cellDoor: Door 'cell locked closed door' 'cell door'

assuming you mean the object's printed name to be 'cell door', and its
vocabulary to be 'cell (adjective)', 'locked (adjective)', 'closed
(adjective)' and 'door (noun)'.

Jim Aikin

unread,
Dec 21, 2009, 6:21:29 PM12/21/09
to
On 12/21/2009 2:28 PM, Jim Aikin wrote:
>
> + cellDoor: Door 'cell locked closed door' 'cell door'
> "It's a massive iron door."
> ;

...or rather, to be just a tiny bit more thorough:

+ cellDoor: Lockable, Door 'cell locked closed massive iron door' 'cell

door'
"It's a massive iron door. "

initiallyOpen = nil
initiallyLocked = true
;

Note the standard T3 usage of a space at the end of a string, and also
the inclusion of all of the adjectives that the player might use.

Lockable is a mix-in class, so it goes first in the class list. I'm
reading your mind here, assuming that you want the door to start out
closed and locked.

--JA

0 new messages