Disabling the (first moving off X) action.

In a room the player needs to be on a crate to go up through a vent in the ceiling. However, when ‘enter vent’ is used it will have (first moving of crate). This is bearable because it still technically works but if the up command is issued it moves off of the crate first and then fails because the actor is no longer on the crate.

The code concerning this is here:

(room code)
up: OneWayRoomConnector
{
-> ventGrill
canTravelerPass(traveler) {return traveler.isIn(crate) && traveler.posture==standing; }
explainTravelBarrier(traveler)
{ “You cannot reach the vent from where you are.”; }

    travelDesc =  "By standing on the crate you just manage to reach the vent  
    and haul yourself into the vent.<.p>"
}

;

+ventGrill: SecretDoor ‘vent grill’ ‘vent grill’
“It’s the grill from the air vent. <<isOpen? ‘It has been moved to reveal a way up into the vent itself.’ : ‘’>>”
dobjFor(Open) remapTo(Push, self)
dobjFor(Close) remapTo(Pull, self)
dobjFor(Push)
{
check(){}
verify()
{
if(isOpen)
{
“It has already been moved out of the way.”;

        }
        if(gActor.isIn(airVent))
          {
            "You see no reason to move the grill from inside the vent";
            exit;
          }
    }

    action()
    {
        if(gActor.isIn(crate) && gActor.posture==standing)
        {
            makeOpen(true);
            "You push grill out of the way. ";
        }
        else
        {
            "You cant reach it. It is too high.";
        }
    } 
}

I know certain bits of the code are probably wrong or unnecessary or whatever but it is specifically to do with the standing on crate stuff that i would appreciate help with.

Oh yeah, the code of the crate is…

+crate: Chair, TravelPushable ‘large crate’ ‘crate’
initSpecialDesc = “A large crate sits in the corner.”
lookInDesc = “The crate is nailed shut. You cannot see inside.”
bulk = 100
describeMovePushable(traveler, connector)
{
"You push the crate into <<traveler.location.destName>>. ";
}
;

I need the actor to be on the crate and when Up is typed, the actor to climb into the vent without stepping off of the crate.

Thanks.

You may want to look up “staging locations” in “Learning TADS 3.” Also, we did this type of thing in “Mrs. Pepper’s Nasty Secret.” Eric coded the bit about the trash can, I didn’t, so I don’t know the details (if I ever did), but the source code for “Mrs. Pepper’s” is downloadable from the Archive in the directory games/source/tads/MrsPepperSrc.zip.

Thanks, I’ll go look them up now :slight_smile: