ahope1 / BeebScott

An interpreter for playing Scott Adams text adventure games on a BBC Micro computer
3 stars 1 forks source link

Handle AUTOGET/AUTODROP in the same way that ScottFree et al do? #5

Closed ahope1 closed 2 years ago

ahope1 commented 2 years ago

See https://intfiction.org/t/scott-adams-interpreter-discrepancies/48864/33

Henrik Åsman heasm66 Jan '21 The difference between the two families of terps is that the “modern” ones loops through all the “actions” and if there is a match with the VERB and NOUN it evaluates the conditions (all after the “when”-part. If all things match then the action is executed and the parser returns and waits for user input. If there is no exact match then the AUTOGET/DROP routine is called before returning to the prompt.

The ADVENTUR/CMD on the other hand only match the VERB and NOUN. If they match AUTOGET/DROP is not called. The instructions, of course, are only executed if the conditions also match.

This will produce this behaviour for the printed code.

Is it a bug and in wich version? I don’t know? The old terp acts strange when you try to “get fox” when you have the box and the new terp acts strange when you are allowed to “get bat” without the hat.

I would recommend not to trust the AUTOGET/DROP when you are overriding it and to write all actions you want to handle and let undefined actions default to “I can’t do that…yet!”. I also think this is the way Scott Adams wrote his games.

Example from Adventureland:

action GET MUD when here mud and carried bites1
  destroy2 bites1
  get mud
  print OK
  print "BOY that really hit the spot!"

action GET MUD when here mud and carried bites
  destroy2 bites
  get mud
  print OK
  print "BOY that really hit the spot!"

action GET MUD when here mud
  get mud
  print OK
ahope1 commented 2 years ago

I will probably leave BeebScott's AUTOGET/AUTODROP handling as is, to retain compatibility with ADVENTUR/CMD.