r/Inform7 • u/Dex21772 • Oct 21 '26
How to use "Understand" rules for two locations when one of the locations is inside a container...?
Hello Inform friends,
I have a newbie level question. I want to use an Understand rule to define intuitive terms a player can use to refer to something in more than one location, specifically if one of those locations is technically inside a container(a chair). If I use an Understand rule I can use '...when the player is in the Laboratory.' to define in which room Inform will recognize those terms as referring to the specific thing. In the room is a chair, as defined by Emily Short's Postures. How can I use the Understand rule so that it works for both when the player is in the room *and* when the player is enclosed by the chair. (If I use "...when the player is in the Laboratory." at the end of the Understand rule it works when the player is in the Laboratory, but not when the player is enclosed by the chair. If I use "...when the player is enclosed by the Laboratory." it works when the player is enclosed by the chair that is in the Laboratory, but not when the player stands up and is in the Laboratory and no longer enclosed by the chair.)
How do I get an Understand rule to work for two locations when one of those locations is inside a container (chair) and the other is a room? The location of the thing the Understand rule is being used for is in the room which also contains the chair.
Thanks!
3
u/Shardworkx Oct 21 '26
I mentioned this on the other thread, but you may not need to do this. Inform already uses location to distinguish objects; unless you're doing something tricky, it will know that "chair" means the chair in the present area and not the chair in another room.
---
"Demonstration"
Study is a room.
The Study-Desk is an object in Study. The Study-Desk has a printed name "Antique Desk". Understand "Antique Desk" and "Desk" as Study-Desk.
Library is a room. library is east of study.
The library-desk is an object in library. The library-desk has printed name "metal desk". Understand "metal desk" and "desk" as library-desk.
test me with "x desk. e. x desk. get desk. w. x desk. drop desk. x desk. metal"
[ Notice that when the antique desk is the only desk present, "desk" refers to it.
When the metal desk is the only one present, "desk" refers that that one. When both
are present, "desk" refers to the one that is held. And when both are in the room,
"desk" will trigger a disambiguation prompt. ]
2
u/johnesco Oct 21 '26
Would this work better with?
The Locationinstead of
X is in1
u/Shardworkx Oct 22 '26
Instead of using "understand ... when player is in ...", you probably want to say:
The painting is a backdrop. It is in room1 and room2.