building doors that you can knock on

So, I’ve successfully (I think) built a knock action, that looks like this:

[code]
DefineTAction(KnockOn);

VerbRule(KnockOn)
(‘knock’) ‘on’ singleDobj
: KnockOnAction
verbPhrase = ‘knock/knocking on (what)’
;

modify Thing
dobjFor(KnockOn) {
check() {
failCheck ('There is no reason to knock on the {the dobj/he}. ‘);
}
}
;
modify Actor
dobjFor(KnockOn) {
verify() {
illogical (’{the dobj/he} would not enjoy that. ');
}
}
;[/code]

Now, I want to pair this with a SenseEvent, so that I can have Actors answer the door from the other side. I found in the Learning T3 document that the code is basically provided, lucky me:

doorKnockEvent: soundEvent; modify Door dobjFor(KnockOn) { verify() { logicalRank(120,'door'); } action() { defaultReport(knockNoEffectMsg); doorKnockEvent.notifyEvent(otherSide); } } knockNoEffectMsg = '{You/he} knock{s} on {the dobj/him}, but nobody replies. ' ;

Unfortunately I’m having a hard time actually putting this into my game. As I understand the code, it’s modifying all objects with the Door class to receive the soundEvent when knocked on. I get complaints about undefined symbols as a superclass of “doorKnockEvent”. Did I miss defining “doorKnockEvent”?

I can tell this is inches away from working, but it’s not… working.

Maybe I’m not understanding your problem correctly, but it seems to me you are trying way too hard to get the door answered.

I have also implemented a KnockOn command. When the PC knocks on the door, the text describing NPC answering the door is in the door’s dobjFor(KnockOn). Any other fallout gets implemented on the appropriate object (the NPC actor character’s before/afterAction() method, for example).

Here’s an extract of my code, where the PC (Harry—it’s a 3rd person game) knocks on Lolita’s door and she invites him in (carried out by the setInvite() method. The following code is in the door object to Lolita’s apartment…

    dobjFor(KnockOn)
    {
        action()
        {
            if(lolita.isIn(lolitasApt))
            {
                "Harry rapped gently on the door to 4B, directly across the
                hall from his apartment to the north.
                <.p>
                The door opened a crack; an eye heavily laden with mascara
                peered out.
                <.p>
                <q>Oh, Harry, it's you,</q> Lolita purred. <q>Come on in.</q> \b
                She closed the door,
                unchained it, and opened it up again wide enough to permit
                entry. <<setInvite(true)>>";
            }
        }
    }
    setInvite(stat)
    {
        lolitasApt.harryInvited = stat;
        isOpen = stat;
    }

…you are correct. It seems like every one of my problems is because I’m trying to do something the hard way.

Thanks. That really turns things on their head, I can do THIS.

Aaaaand it works. Thanks so much for the direction.