I imagine that this is possible as I have called pieces of text from here and there. I wonder though, can you call a whole room description via some kind of [include room description] as part of another description?
An example might be looking at another room via a surveillance camera.
the controlroom is a room.
the camera is an object.
the camera can be red.
the camera is not red.
the description of the camera is "The camera is focused on [if the camera is red] The yard. You can see [the description of the yard][else if] the chicken coop. You can see [the description of the yard][end if]."
the yard is a room.
the description of the yard is "A dog is chasing a ball round.".
the chicken coop is a room.
the description of the chicken coop is "There are chickens pecking at their bowl of food.".
say the description of the yard works fine so far as it goes, but I suspect youâre after the whole output one would get from looking. And that gets tricky quickly, 'cause the only thing that does that is carry out looking and it requires the player to be there.
This is a crude and hacky work-around with not pretty results but that could give one a starting place:
lab is a room. "xar".
Parlor is a room. "foo".
the settee is in the parlor.
to say teleport to (r - a room):
now the player is in r;
to say looking at (r - a room):
let l be the location;
if l is r begin;
try looking;
else;
let t be "[teleport to r]";
let scratch be "[teleport to l]";
say t;
end if;
instead of jumping:
say looking at parlor.
This pair of statements gets a lot of what you want, although itâs not exactly the same as being there:
say the description of R;
carry out the printing the locale description activity with R;
(The âprinting the locale descriptionâ activity shows all the objects in the given room. If youâre not personally there, it goes âIn the room you can also seeâŚâ instead of just âYou can also seeâŚâ)
(This is imperfect in a number of ways, mind you. Secretly teleporting the player may be better, although Iâd recommend the âmove the player to R, without printing a room descriptionâ phrase.)
Now why is this? I feel like Iâve been trying to discern any difference between âmove blahâ and ânow blah is in blahâ in the long term and never noticed one. The main difference so far has been that âmove (blah)â is easier to search up in the source.
Thanks, Andrew; I didnât remember the modifiers to move <object> to <object>; they make for a much less grotty approach:
To remote view (r - a room):
let l be the holder of the player;
if l is r begin;
try looking;
else;
move the player to r, without printing a room description;
try looking;
move the player to l, without printing a room description;
end if;
(That also fixes my original use of location instead of holder of the player.)