The following code
Hats and Wormholes
Constant Story "Hats and Wormholes";
Constant Headline "^(a study)^";
Include "Parser";
Include "VerbLib";
Include "Grammar";
Class Room
has light;
Room Start "Starting Point"
with description
"An uninteresting room.",
e_to End;
Object red_wormhole "red wormhole" Start
with name 'red' 'wormhole',
initial
"A red-tinted wormhole hangs in the air here.",
description
[;
if (parent(orange_hat) == nothing)
print_ret (A) orange_hat, " lies temptingly on the other side.";
else
"There's nothing but some kind of void beyond.";
],
add_to_scope
[;
if (orange_hat hasnt moved)
AddToScope(orange_hat);
]
has static;
Room End "Ending Point"
with description
"Another uninteresting room.",
w_to Start;
Object blue_wormhole "blue wormhole" end
with name 'blue' 'wormhole',
initial
"A blue-tinted wormhole hangs in the air here.",
description
[;
if (parent(green_hat) == Elsewhere)
print_ret (A) green_hat, " lies temptingly on the other side.";
else
"There's nothing but some kind of room beyond.";
],
add_to_scope
[;
if (green_hat hasnt moved)
AddToScope(green_hat);
]
has static;
Room Elsewhere "Elsewhere"
with description
"Someplace else entirely.";
Object green_hat "green hat" Elsewhere ! placed in a separate room
with name 'green' 'hat'
has clothing;
Object orange_hat "orange hat" ! placed off-stage
with name 'orange' 'hat'
has clothing;
[ Initialise ;
location = Start;
];
generates the following behavior:
Hats and Wormholes
(a study)
Release 1 / Serial number 201125 / Inform v6.31 Library 6/11 SX
Starting Point
An uninteresting room.
A red-tinted wormhole hangs in the air here.
>X RED
An orange hat lies temptingly on the other side.
>GET ORANGE
Taken.
>E
Ending Point
Another uninteresting room.
A blue-tinted wormhole hangs in the air here.
>X BLUE
A green hat lies temptingly on the other side.
>GET GREEN
That isn't available.
Note that, although the transcript is from Inform 6.31 with StdLib 6/11, the behavior is essentially identical using Inform 6.34 with StdLib 6.12.4. (The only difference is that the final message is “The green hat isn't available.
”)
The only functional difference between the orange hat and the green hat is that the orange hat is off-stage while the green hat is located in a different room. Should there be a difference in takeability between these two cases? If so, what is the rationale?