It looks like you can’t do lots of fun stuff with kinds like putting them in lists or table columns, which makes some of this a bit challenging. But you can hack up a sort of simulation of that by creating archetypes for the kinds, creating a symbolization relation that relates the archetypes to the things in the kind, putting the archetypes in your list, and whenever you need to do stuff with the list find things that the archetypes symbolize.
[rant=fairly off-topic stuff about how a related issue crops up in one of my games]I’m going to have to do something like this for the next release of Tea and Toast; I defined bread slices and teacups as kinds of things and then tried to put them in the Table of Specific Associations, which compiles under 6G60 (won’t under 6L02) but effectively leaves that row blank. Fortunately the bugs this creates aren’t noticeable to anyone if I don’t point them out – some memories that should be triggered by anonymous instances of the bread slice/teacup kinds won’t be. To fix this I have to create the symbolization relation, make sure most things symbolize themselves but anonymous instances are symbolized by archetypes, and put the archetypes in a table column.[/rant]
Here’s what I came up with:
[code]
An archetype is a kind of thing.
a person has a list of archetypes called the Original Inventory.
a person can be dead or alive. a person is usually alive.
an antelope is a kind of person.
A set of antlers is a kind of thing. The plural of set of antlers is sets of antlers.
A shiny pelt is a kind of thing…
Symbolization relates one archetype to various things. The verb to symbolize means the symbolization relation.
The archetypal set of antlers is an archetype. The archetypal shiny pelt is an archetype.
The original inventory of an antelope is always {archetypal set of antlers, archetypal shiny pelt}.
First when play begins:
now the archetypal set of antlers symbolizes every set of antlers;
now the archetypal shiny pelt symbolizes every shiny pelt.
To give (spawn - an antelope) a/an (possession - archetype):
if the possession symbolizes an off-stage thing (called new possession):
now spawn carries new possession;
otherwise:
say “Warning! [Possession] has no off-stage representatives. Garbage collection routine goes here.”
when play begins:
repeat with spawn running through antelopes:
repeat with possession running through the original inventory of spawn:
give spawn a possession;
devkill is an action applying to nothing. understand “devkill” as devkill.
Carry out devkill:
repeat with x running through antelopes in the location:
unless x is the player:
now x is dead;
repeat with i running through things carried by x:
move i to the location;
say “Poor Stephen :(.”
devspawn is an action applying to nothing. understand “devspawn” as devspawn.
Carry out devspawn:
repeat with x running through dead antelopes in the location:
now x is not dead;
repeat with possession running through the original inventory of x:
give x a possession;
say “Antelopes love it when you do this, especially behind their ears.”
the anteloparium is a room. “Ariums! Antelopes! What more could you ask for?”
the player is in the anteloparium. there are five antelopes in the anteloparium. There are 20 sets of antlers. There are 20 shiny pelts.[/code]
Note that I’m not creating any new pelts or antelopes dynamically; I created a supply of them off-stage and move the off-stage ones on-stage as needed. If you run out of your off-stage supply of stuff you have to figure out a way to garbage collect by moving some on-stage stuff back off-stage (like, some of the antlers that are in another room could disappear off the floor). If that’s not practical you probably have to figure out something with Dynamic Objects or an even more baroque workaround; if you’ve got the kind of design where the player could in theory farm respawning enemies so that there could be thousands of sets of antlers on stage you’ll really need to think hard. Nuku Valente, who does crazy amazing stuff using Inform to make massive RPGs, says he simulates bunches of objects by not using them as things – he just uses values to keep track of the number of a certain kind of object that the player owns.
PS Note that you need to use “or” rather than “rather than” when you’re defining the dead/alive property, and you need to say what the plural of “set of antlers” is or Inform will probably think it’s “Set of antlereses.” Also you need to write 20 as a number in “There are 20 shiny pelts”; I hit a bit of a roadblock when I wrote “there are twenty shiny pelts” and Inform thought I was creating one object called “twenty shiny pelts.” There’s actually a warning about this specific thing in the documentation somewhere; I think you can write out numbers up to twelve and with 13 or more you have to use numbers.