Newsgroups: rec.arts.int-fiction
Path: nntp.gmd.de!news.ruhr-uni-bochum.de!news.rwth-aachen.de!uni-paderborn.de!golden-gate.owl.de!fu-berlin.de!unlisys!blackbush.xlink.net!tank.news.pipex.net!pipex!arclight.uoregon.edu!nntp.primenet.com!netcom.com!erkyrath
From: erkyrath@netcom.com (Andrew Plotkin)
Subject: Re: [Inform] redirecting actions
Message-ID: <erkyrathDzuot9.LEx@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
X-Newsreader: TIN [version 1.2 PL1]
References: <54r8ti$8m4@sjx-ixn10.ix.netcom.com>
Date: Fri, 25 Oct 1996 21:24:45 GMT
Lines: 48
Sender: erkyrath@netcom.netcom.com

Russell Wain Glasser (rglasser@ix.netcom.com) wrote:
>     Here's something new I want to try.  Let's say you have some
> objects, and one should "steal" the actions for the other one.  For the
> sake of argument (not the actual goal), let's say I was trying to code
> up a ghost who would possess some people in the room:

> "Seance Room
>     You and your friends Cathy and George are holding an impromptu
> seance.
>     The ghost of Yorick floats mischievously around the room.
>     There is a whoosh of cold air, and you realize that Cathy is now
> possessed by Yorick.

> >EXAMINE CATHY
> [parser redirects action to: EXAMINE YORICK]
> Yorick makes his host body look cold and lifeless.

This is a job for react_before. See the manual for a full description, 
but it would look something like

ghost
with react_before [;
  Examine:
    if (noun == parent(self)) {
      switch (noun) {
        George: "George looks lifeless.";
        Cathy: "Cathy looks lifeless.";
        default: rfalse;
      }
    }
    rfalse;
];

Actually it might not be good to put the ghost *in* the person. A 
react_before is only run if the object (the ghost) is in scope, so you'd 
have to make all the people transparent. I'd probably just leave the 
ghost in the room and give it a "possessing" property to determine which 
person it's possessing. Of course then you have to do work to make the 
ghost follow the person around.

Assuming any of that has relevance to your real goal. :-)

--Z

-- 

"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the
borogoves..."
