Hi! Relatively new to Inform 7, and I’ve been having an issue with the way Inform treats identical objects. Any solutions or workarounds would be much appreciated!
I have a scale set that I want the player to be able to move blocks around on, with three kinds of blocks - small, medium, and large - which weigh different amounts. I have it so that the scale set will lean left or right, depending on which side has more weight. The scale set is a thing, and the left side and the right side are supporters which are part of the scale set. Part of the puzzle is that the player can’t take blocks, they can only “vanish” and “unvanish” them, which are actions I wrote myself.
The problem is with being unable to distinguish between the blocks. Typing “vanish large block” vanishes the block from the left side without asking the player for clarification, presumably because the left block was created first and Inform doesn’t see any use in differentiating between two identical objects. However, as long as they’re in different places, which object does matter. I’ve been able to get it to accept “vanish left large block” and “vanish right large block”, but what I’d really like is for it to respond to “vanish large block” with something as complex as “Which do you mean, a large block from the left side, the large block from the right side, or the large block from your inventory?” or at least not assume the player means any one of them. Similarly, I’d like it to differentiate between locations with blocks of the same size when the player types “vanish block”, where it currently only differentiates between size and not the locations. I tried giving them unique object names and the same printed names, but it still grouped them. I haven’t found a way to get it to ask “which do you mean” when it wasn’t already, and I’m not even sure how that would work.
Here is my code:
The scale set is a fixed in place thing on the plain wooden table. Understand "scales", "set of scales" as the scale set.
A side is a kind of supporter. The left side, the right side are sides. The left side, the right side are part of the scale set. The left side, the right side have a number called the sum.
Understand "tilt [scale set]", "tilt [side]", "push on/-- [scale set]", "push on/-- [side]", "pull on/-- [scale set]", "pull on/-- [side]" as a mistake ("You try, but the scales seem magically locked in place.").
A block is a kind of thing. A block has a number called weight. A block has some text called size. A large block is a kind of block. The weight of a large block is always 3. The size of a large block is always "large". A medium block is a kind of block. Weight is always 2. Size is always "medium". A small block is a kind of block. Weight is always 1. Size is always "small".
Instead of taking a block which is on a side: say "You try, but it can't seem to budge from the scale."
There is a small block and two medium blocks on the left side. There are three large blocks on the right side.
This part will print “large block from the left side” when asking which do you mean between multiple sizes of blocks, but then will neglect to mention any large blocks that might be on the right side:
After printing the name of a block (called the block) while asking which do you mean:
if the block is carried by the player:
say " from your inventory";
else if the block is on a supporter (called the supporter):
say " from the [supporter]";
else if the block is in a container (called the container):
say " from the [container]";
else:
say " from the ground".
Understand "left" as a block when the item described is on the left side. Understand "right" as a block when the item described is on the right side. Understand "inventory" as a block when the item described is carried by the player. Understand "floor/dropped large/medium/small/big/-- block" as a block when the item described is not enclosed by anything.
Thanks for any insight!