This is an Inform 6 question, correct?
The default spatial model assumes that all objects in the same room are close enough to reach from any part within it. I don’t believe that there’s a direct analogy to I7’s
reaching inside rules in the Standard Library. However, relatively straightforward code can do the trick. This example uses a
before() routine applied to the room in question, which makes use of the Standard Library’s
Constant Story "Reaching the Kettle";
Constant Headline "^from https://intfiction.org/t/able-to-get-object-while-in-a-chair/52586^";
Room Start "Starting Point"
"An uninteresting room.",
if ((parent(player) ~= self) &&
(CommonAncestor(player, noun) == self))
"You can't reach ", (the) noun, " from where you are.";
Object chair "chair" Start
with name 'chair'
has enterable supporter;
Object table "small table" Start
with name 'small' 'table'
has static supporter;
Object kettle "white tea kettle" table
with name 'white' 'tea' 'kettle'
[ Initialise ;
location = Start;
EDIT: I’ve made some small changes to the relevant code for minor improvements in efficiency.
Note that this is a plain vanilla I6 solution (Inform 6.31, StdLib 6/11). There may be better options when using Puny Inform, or when using the latest version of the Standard Library.
For a more advanced solution, you may want to look at Marnie Parker’s
outofrch.h library, available from the IF Archive. It was originally written in 1999, so it may need some adjustments for compatibility with Glulx and/or Puny Inform.