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

I7: A question on kinds of kinds in a table?

0 views
Skip to first unread message

Roger

unread,
Nov 14, 2009, 11:31:59 PM11/14/09
to
Okay so to make a long story short, I'd like to define a number of
"hats" in my game with tables. This is fine if you only want one of
any given hat in the game world at any given time, but lets say we
want the player to be able to have 20 baseball caps. Is there any way
to define kinds via a table?

Right now I have a "Table of Equippable Hats" and I'm defining the
hats in the game world (off-stage) by invoking "some hats are defined
by the Table of Equippable Hats". I'd like to be able to generate,
say, 20 of each hat and move them to the player as needed.

I have a feeling I cannot do this, though.

Mike Tarbert

unread,
Nov 15, 2009, 12:55:38 AM11/15/09
to

Hm, I was pretty sure this is covered in the docs, but I can't seem to
find it. Ch. 15.15 mentions that "... we can define many similar things
(or kinds) using a table," but doesn't give the syntax for kinds. At any
rate, the syntax you're looking for is "some kinds of ... are defined by
the Table ..."

[code]
A hat is a kind of thing. It is always wearable.
Some kinds of hats are defined by the Table of Equippable Hats.

Table of Equippable Hats
hat description
fedora "It looks like a fedora."
cap "It's a typical baseball cap."

Lab is room. Three fedoras and two caps are in the lab.
[/code]

Note that you can still create unique instances as well:

[code]A cap called the Orioles cap is in the lab. The description is
"It's an Orioles cap."[/code]

Just remember not to get yourself into disambiguation trouble with names
of duplicate instances of the kind and unique instances. In other words,
watch out for:

>x cap
Which do you mean, a cap or the Orioles cap?


Skinny Mike

Roger

unread,
Nov 15, 2009, 1:21:18 AM11/15/09
to

That works? I tried... I'm guessing my syntax was off, and my source
code is becoming huge now. I'll try again...thank you!

Roger

unread,
Nov 15, 2009, 2:32:28 AM11/15/09
to
On Nov 15, 12:55 am, Mike Tarbert <miketarb...@embarqmail.com> wrote:

Thank you SO much. Perfect. This makes my life tons easier.

0 new messages