can't get Push Into to work (adv3Lite)

I have a widget and a socket. The socket is a container, the widget is a thing.

I can put the widget into the socket and all is well. but push into instead of put does not work…

I’ve read the discussion of push-travel actions in the Adv3Lite Manual…

file:////lib/adv3Lite/docs/manual/thing.htm#pushing

…and tried implementing describePushTravel(Into) and describeMovePushable(connector, dest), even dobjFor(PushIn) asDobjFor(PutIn) on the widget object, but nothing works.

Here’s sample game window output…

…and the code that produced it…

#charset "us-ascii"

#include <tads.h>
#include "advlite.h"

versionInfo: GameID
    IFID = '445C38A3-AD1B-4729-957A-F584600DE5C1'
    name = 'test'
    byline = 'by Jerry Ford'
    htmlByline = 'by <a href="mailto:jerry.o.ford@gmail.com">
                  Jerry Ford</a>'
    version = '1'
    authorEmail = 'Jerry Ford <jerry.o.ford@gmail.com>'
    desc = 'Testing push into.'
    htmlDesc = 'Testing push into.'

;

gameMain: GameMainDef
    initialPlayerChar = me
    paraBrksBtwnSubcontents = nil
   
;

me: Actor 'me' @room
    "The main man.<.p>"
    isHim = true
    person = 2
;

room: Room 'room'
    "In the room, there is a widget that fits into a socket in the wall.<.p>"
;
+ socket: Container, Fixture 'socket'
    "A hole matching the size and and shape of the widget is in the wall."
    
    canPutInMe = true
    
    dobjFor(PutIn)
    {
        check()
        {
            if (gDobj != widget)
            {
                "It does not fit. </p>";
            }
        }
    }
;
+ widget: Thing 'widget'
    "A gizmo."

    canPushTravel = true
    
    describePushTravel(Into)
    {
        if(gIobj == socket)
        {
            "You push the widget gently into the socket. <.p>";
        }
    }
    describeMovePushable(connector, dest)
    {
        if(gIobj == socket)
        {
            "You push the widget gently into the socket. <.p>";
        }
    }
    
    dobjFor(PushIn) asDobjFor(PutIn)
    dobjFor(PutIn)
    {
        check()
        {
            if(gDobj.isIn(socket))
            {
                "The widdget is already in the socket. </p>";
            }
            if(gIobj != socket)
            {
                "The widget does not fit into that. <.p>";
            }
        }
    }
;

What am I missing?

Jerry

First, your code references actions called PushIn and PutEnter, which don’t exist, unless you’ve defined them yourself. The action corresponding to PUSH X INTO Y is called PushTravelEnter.

Second, PushTravel actions are quite unrelated to Put actions. A Push Travel action moves an object (such as a trolley) from one room to another by pushing it from place to place. You are thus attempting to use methods intended for one purpose (such as describePushTravel()) for a quite different purpose they were never intended to serve. That is why they won’t do what you want.

Third, you are probably trying to make the whole thing far more complicated than it needs to be. All you actually need is:

+ socket: Container, Fixture 'socket'
    "A hole matching the size and and shape of the widget is in the wall."
       
    dobjFor(PutIn)
    {
        check()
        {
            if (gDobj != widget)
            {
                "It does not fit. </p>";
            }
        }
    }
    
    iobjFor(PushTravelEnter) asIobjFor(PutIn)
;
+ widget: Thing 'widget'
    "A gizmo."

    dobjFor(PushTravelEnter) asDobjFor(PutIn)

    dobjFor(PutIn)
    {
        check()
        {
            if(gIobj != socket)
            {
                "The widget does not fit into that. <.p>";
            }
        }
    }
;

Okay, got it, thanks.

Yes, PutIn is a custom verb.

I did in fact try your simpler approach in the beginning. When that didn’t work, I built up to the more complicated, and increasingly incorrect, stuff that tried to use things in unintended ways.

Turns out it was the iobjFor(PushTravelEnter) piece on the socket that I was missing in my earlier attempts. I had the dobjFor(PushTravelEnter) on the widget, but without the corresponding iobjFor(…) on the socket nothing was happening. With that in place, it works.