Subject: Technical quandry, regarding carried objects

From: Ken Schalk <[email-masked]>
Date: Sat, 23 Jan 1993 17:07:14 -0800

I would like to make an object which can see what's going on in
the room outside of the person who's carrying it, when it's being
carried.  I would especially like to be able to tell when the carrying
player has moved to another room, but general listening would also be
highly desirable.  (Yes, yes, it's for a puppet, so shoot me.)
Logically, it makes sense that a carried object (unless stuffed inside
some pocket, which is another issue entirely) should be able to
observe what goes on outside the player.  Basically, anything that
person hears/sees (well, almost, at least in terms of anything the
object could hear/see when in the same room as the player, but not
being carried) the object ought to be able to hear/see.

    I've been puzzling over this for a while now, and don't see a good
elegant solution in sight.  About the only thing I can think of (and
this is a horrible kludge) is to have some other, somehow invisible
object which sits in the room with this listening object, and will
keep track of whenever a player leaves the room with it, and will then
follow it to it's carrier's new location (by simply moving itself to
the new room).

    Does anyone have any better ideas/suggestions?  Has anyone done
anything like this before, and if so, where/how?

    (Somehow I have this feeling that I'm going to get a very terse
response to this that will amount to 'no, you can't do that,' but I
had to ask.)

//////////////////////////////////////////////////////////////////////
\\ Kenneth C Schalk \\\\"Is conciousness just a special form of \\\\\\  //-\
//(aka Xorian@Lambda)///  hallucination?" -- Frank Herbert      ////// //-O|
\\ [email-masked] \\\\\\\\"We're each other fragments...but each  \\\\\\ |   |
// [email-masked] / fragment reveals the [whole] from a    //////  \_/
\\ [email-masked] \\\ different angle..." -- William Gibson  \\\\\\
//////////////////////////////////////////////////////////////////////

---

From: Matthew Rhoten <[email-masked]>
Date: Sat, 23 Jan 1993 18:40:06 -0800

> [ wants to make object see things outside carrying player ]

I wrote an object that needed to know when its carrier had moved. I
found a solution which seems to me a bit more elegant than extra
objects lying around. While I was at it, I implemented telling the
carried objects what the player heard via :tell as well.

Since the object needed to know basically when :moveto had been
called, I simply hacked on my character's :moveto. I put a
.moveto_xmit property on my character. If this was nonzero, the
:moveto iterated over each inventory object, calling the object's
:moveto_hook verb with the current and asked-for location. (It helps
if this :moveto is not set debug; that way you don't have to check
whether the verb's there when iterating.)

Similarly, I put a .tell_xmit on the character, and had my :tell do
something similar. Later, I decided I didn't need the object to know
everything I had heard, so I removed that code. The :moveto hack is
still present on Ozy@LambdaMOO and a wanderer he owns, #16865. An
object that uses the hook is #25588. Feel free to browse these.

Note that these objects only worked on players who had hacked their
:movetos (and, in your case, :tells). For them to work for any
character, $player or a suitable player class would need modification.

 -matt