heasm66 / mdlzork

Different versions of original mainframe Zork reconstructed and patched to run under Confusion.
15 stars 6 forks source link

Error message after using the "NOOBJ" command #33

Closed eriktorbjorn closed 1 year ago

eriktorbjorn commented 1 year ago

The 711211 and 810722 versions of Zork have a "NOOBJ" command to suppress the printing of objects when entering a room, even without using superbrief mode. But if I enable it, I get the following error:

>NOOBJ
Don't print objects.

>SOUTH
South of House
You are facing the south side of a white house. There is no door here,
and all the windows are barred.
Args to ANDB must be of PRIMTYPE WORD

LISTENING-AT-LEVEL 1 PROCESS 1

Though I can apparently keep playing after that. I think it may be coming from this bit of ROOM-INFO:

     <COND
      (<NOT <LIT? .RM>> <TELL "I can't see anything.">)
      (<OR <AND <NOT .FULL> <NOT ,NO-OBJ-PRINT!-FLAG>>
       <NOT <0? <CHTYPE <ANDB .FULL 1> FIX>>>>
       <MAPF <>

The error message itself seems to be correct in what it's saying about data types, but I have no idea what causes the error in the first place. I know very little about MDL.

heasm66 commented 1 year ago

First I thought this was a difference between the original MDL and Confusion, but

Confusion:

<SETG FULL <>>
#FALSE ()
<ANDB ,FULL 1>
Args to ANDB must be of PRIMTYPE WORD

LISTENING-AT-LEVEL 1 PROCESS 1

And in MDL on PDP-10 ITS:

MUDDLE 56 IN OPERATION.
LISTENING-AT-LEVEL 1 PROCESS 1
<SETG FULL <>>$
#FALSE ()
<ANDB ,FULL 1>$

*ERROR*
ARG-WRONG-TYPE
ANDB
LISTENING-AT-LEVEL 2 PROCESS 1

This test obviously have to be rewritten slightly...

Too bad you weren't around playtesting at M.I.T. in the late 70s...

heasm66 commented 1 year ago

I think the test should be:

     <COND
      (<NOT <LIT? .RM>> <TELL "I can't see anything.">)
      (<OR <AND <NOT .FULL> <NOT ,NO-OBJ-PRINT!-FLAG>> .FULL>
       <MAPF <>

This makes the game print the objects when there is a full room description (when entering for the first time), but not printing objects when returning to an already visited room. This is as expected, right?

the ANDB test looks like an artefact from earlier versions that never got tested (at least not fixed). FULL is never used in this way anywhere else in the function.

eriktorbjorn commented 1 year ago

I'm not sure what the intended behavior is, but FULL can apparently be <>, 1, 2 or 3, and I assumed the ANDB was to catch 1 and 3, but not 2?

I hope the behavior you described would only apply to NOOBJ mode, because otherwise mapping the mazes is going to be even more annoying. :-)

heasm66 commented 1 year ago

You're right. The condition should return:

<> --> <>
 1 --> T
 2 --> <>
 3 --> T

Changing the predicate to: <AND .FULL <NOT <0? <CHTYPE <ANDB .FULL 1> FIX>>>> does that.

<SET FULL <>>
#FALSE ()
<AND .FULL <NOT <0? <CHTYPE <ANDB .FULL 1> FIX>>>>
#FALSE ()
<SET FULL 1>
1
<AND .FULL <NOT <0? <CHTYPE <ANDB .FULL 1> FIX>>>>
T
<SET FULL 2>
2
<AND .FULL <NOT <0? <CHTYPE <ANDB .FULL 1> FIX>>>>
#FALSE ()
<SET FULL 3>
3
<AND .FULL <NOT <0? <CHTYPE <ANDB .FULL 1> FIX>>>>
T

The other place where .FULL is tested with ANDB, <OR <NOT .FULL> <NOT <0? <CHTYPE <ANDB .FULL 2> FIX>>>>, seems to work correct and returning T in all cases except when.FULL is 1.

heasm66 commented 1 year ago

There's different behavoiur between interpreted and compiled MDL. See link above.