the-infocom-files / zork1

Zork I: The Great Underground Empire
10 stars 3 forks source link

Wrong response to "CLIMB DOWN" #67

Open eriktorbjorn opened 5 years ago

eriktorbjorn commented 5 years ago

I tried this in East of Chasm:

>DOWN
The chasm probably leads straight to the infernal regions.

>CLIMB DOWN
The object#248 doesn't lead downward.

>CLIMB DOWN CHASM
The chasm doesn't lead downward.

I think "object#248" is the ROOMS object. There is a case in GWIM where it apparently checks if the syntax uses FIND MUNGBIT, in which case it returns ROOMS:

<ROUTINE GWIM (GBIT LBIT PREP "AUX" OBJ)
        <COND (<EQUAL? .GBIT ,RMUNGBIT>
               <RETURN ,ROOMS>)>

And one of the syntaxes for "CLIMB DOWN" is:

<SYNTAX CLIMB DOWN OBJECT (FIND RMUNGBIT) = V-CLIMB-DOWN>

Apparently this is the standard way of defining an action that can, but doesn't have to, take an object. I.e. you can both "CLIMB DOWN" and "CLIMB DOWN LADDER". (Though the actual bit may differ between games.) V-CLIMB-DOWN simply calls <V-CLIMB-UP ,P?DOWN ,PRSO>.

If there is an NEXIT in the direction, or if there is a CEXIT, DEXIT or UEXIT in that direction the object you're trying to climb is not a local global object in the room, it prints a message that the object doesn't lead that way.

        <COND (.OBJ
               <SET X <PTSIZE .TX>>
               <COND (<OR <EQUAL? .X ,NEXIT>
                  <AND <EQUAL? .X ,CEXIT ,DEXIT ,UEXIT>
                       <NOT <GLOBAL-IN? ,PRSO <GETB .TX 0>>>>>
                  <TELL "The " D .OBJ " do">
                  <COND (<NOT <EQUAL? .OBJ ,STAIRS>>
                     <TELL "es">)>
                  <TELL "n't lead ">
                  <COND (<==? .DIR ,P?UP>
                     <TELL "up">)
                    (T <TELL "down">)>
                  <TELL "ward." CR>
                  <RTRUE>)>)>
        <DO-WALK .DIR>
        <RTRUE>)

The ROOMS object does not have a DESC property, so there is no object name to print.

So the problem should actually happen in any room where the up or down exit is a NEXIT, i.e. simply prints a string, if it goes through the default code. It does not happen if you try to "CLIMB UP" in the forest, but that's probably because of FOREST-ROOM:

           (<EQUAL? .RARG ,M-BEG>
        <COND (<AND <VERB? CLIMB-FOO CLIMB-UP>
                <EQUAL? ,PRSO ,TREE>>
               <DO-WALK ,P?UP>)>)>>
eriktorbjorn commented 5 years ago

"CLIMB DOWN" from the Cliff in Zork III also prints "The object#226 doesn't lead downward."

eriktorbjorn commented 3 years ago

Considering the sheer number of cases, I'd say it's probably best to fix V-CLIMB-UP to print something sensible. (Or set a sensible description on ROOMS, but I have a hard time thinking of any that fits the "The object do[es]'nt lead [up|down]ward." message.

Actually, simply changing the <COND (.OBJ to test that there is an object that isn't the ROOMS object might be the most appropriate fix. Then the player will try to walk in the direction instead, which should print the appropriate message.