I7: More trouble with multiple indistinguishable objects

One of the things about Inform 7 that I always find confusing is multiple indistinguishable objects (which have to implemented as kinds, rather than as specific things). I’m trying to achieve the following effect:

A room will contain three supporters (a serving platter, Fred’s plate and your plate). Initially, two sandwiches will be on the serving platter. I need them to be totally indistinguishable at this stage. At a certain point, the butler (an NPC) enters the room and redistributes the food so that one sandwich is on Fred’s plate and one sandwich is on your plate. Thereafter, I need any attempt by the player to interact with a sandwich to be interpreted as referring to the sandwich that is on your plate. The documentation has some examples on understanding things by their relations, but they don’t seem to be directly applicable. What I want is that if the player types “get sandwich” (after the redistribution has occurred) the game will understand that to mean the sandwich which is on your plate. (Similarly, I will have Fred, an NPC, interacting with the sandwich on his plate, but I can code that manually).

Any help would be appreciated.


Robert Rothman

The easiest way to do this is to have two sandwiches implemented as anonymous instances of a kind and two named objects as the player’s and the NPC’s sandwiches. Start with the anonymous sandwiches on the platter. When the butler comes in remove them from play and put the “real” sandwiches on the correct plates.

Also, if you don’t let the player interact with the sandwiches individually before the butler scene (the player isn’t allowed to take one and carry it around etc) you could just implement them as a single object that responds to “sandwich”, “sandwiches”, “two sandwiches” and so on.

Thanks. I hadn;t thought about that idea, but it turns out that the approach of using a single object prior to the butlerian redistribution may actually have another advantage. I actually simplified the facts somewhat; there will in fact be (changing the names to protect the innocent) not just two sandwiches on the platter, but also two hamburgers and two hot dogs. During the pre-redistribution period, there will be a limited number of ways in which the player can interact with the food, but anything he does during that period will apply to all the items (i.e., if he tries to do something to a hamburger, it will redirect to doing it to both burgers, both hot dogs and both sandwiches). Implementing them all as a single thing avoids the need to redirect; it just requires “understand” statements so that the single thing responds to any of the various ways a player might respond to it.

Robert Rothman