wjousts is right about defining kinds with tables – I don’t think there are any examples in the documentation, but it’s mentioned briefly at the end of section 15.16 which refers you to the source for “Reliques of Tolti-Aph.” Here’s a shorter example.
Buuut that won’t help us here, because that example isn’t about retrieving the kind from the table. And here the problem isn’t really about retrieving kinds from tables, it’s about what to do when you’ve retrieved the kind. There may be a syntax that allows you to test whether an object is of a certain kind, once you’ve retrieved the kind from a table, but I don’t know it. It seems like the sort of thing that you ought to be able to do with kind variables, but those really make my head hurt. This thread might have some ideas, but they seem to involve I6 or not work or both.
However, gravel’s comment in there points the way. Instead of trying to get a kind out of the table and see whether a thing belongs to it, give everything of a kind a throwaway property and store that in the table. Thus:
[code]“Kinds”
Equipment room is a room;
ball is a kind of thing.
hat is a kind of thing. a hat is always wearable.
bat is a kind of thing.
A thing has some text called typetext. The typetext of a ball is “ball”. The typetext of a bat is “bat”. The typetext of a hat is “hat”.
table of stuff
typetext message
“ball” “It’s a ball of some kind. You could probably throw it.”
“hat” “It’s a hat of some kind. You could probably wear it.”
“bat” “It’s some kind of bat. You could use it to hit things.”
The baseball is a ball in the equipment room.
The basketball is a ball in the equipment room.
The cap is a hat in the equipment room.
The cricket bat is a bat in the equipment room.
The tennis racket is a bat in the equipment room.
Instead of examining something:
if the typetext of the noun is a typetext listed in the table of stuff:
say “[message entry]”;
blank out the whole row;
otherwise:
continue the action.
every turn:
if the number of filled rows in the table of stuff is zero:
say “You’ve examined one of everything!”;
otherwise:
say “There are still [number of filled rows in the table of stuff] types of things to examine.”[/code]
Couple of notes:
You need to say “filled rows” to get the number of rows you haven’t blanked out – “the number of rows in the table of stuff” will always be 3.
I added articles to the names of your individual things in order to make the output more elegant.
The table may have copypasted funny; watch the tabs.