Associating things with other things

I’ve been thinking about and around this problem for a while and I haven’t gotten anywhere. I feel like someone here might get a kick out of solving it, though, so here. Let this be a juicy steak for your Inform7 teeth to sink into.

It’s pretty easy to explain what the idea is though (so maybe this will be too easy?): For the sake of new players who don’t know well enough to stay away from phrasal verbs, I’d like to create a “SIT AT” verb, (as in, if this is a Thanksgiving story, “sit at kid table” or “sit at grown-up table”). The actual interaction, of course, is going to be between the player and a specific chair (“folding chair” or “antique chair”). So somewhere in the source there has to be something that says this chair is associated with this table, and sitting at a given table should be carried out by sitting on the associated chair.

I thought the best way to do this would be with a table. So I made that table, and then I looked at it a while, and then I got rid of it because I had no idea where to go from there. But you guys are smart, right? This will be a piece of cake. I mean, a juicy steak. It can be whatever you want.

Look at Chapter 13 on relations. You can create a relation (for example, the “surrounding” relation) between each table and one or more chairs; then use an “instead” rule to redirect an attempt to sit at the table to sitting on a random chair which bears the specified relation to that table. I’m not sure whether you also will need to create a “sitting at” action, or whether the existing “sitting” action is triggered by a “sit at” command (which you then redirect).

Robert Rothman

delicious steak cake

Thank you Robert! I guess if my brain had thought of the word “relationship” instead of “association” then I’d have had it no problem.

No thank you, tove. No thank you.

You’re still going to need to make a table :laughing:

(Avoiding confusion is more important than not explaining the joke: Because the player is sitting at a table. So you need to implement a table object.)

Now THAT’s a philosopher talking! :wink:

I suppose you could always use a Table of Tables to keep track of which chairs are associated with which tables listed in the table of tables. On the other hand, while that idea might not be very practical, it might be an effective means of illustrating the point through a story, which would be the Fable of the Table of Tables. Alternatively, if you want to prevent a player from moving a chair too far from its designated table, you could attach the two with a cable of the table (but only if you’re able).

Maybe we should just table the whole idea for now.

Robert Rothman