I’ve been playing around with ScottKit and PerlScott, and I’ve noticed that they handle the light timer/countdown differently.
If you compile the following ScottKit code and play it in ScottKit and then in PerlScott, you’ll find that the command-sequence GET LAMP, LIGHT LAMP, DROP LAMP, LOOK will result in the light running out in ScottKit — but in PerlScott the light will shine indefinitely until you pick the lamp up again!:
action score: score
action inventory: inventory
action look: look
room chamber "square chamber"
item lamp "old-fashioned brass lamp"
called "lamp"
item lit_lamp "lit lamp"
called "lamp" nowhere
item empty_lamp "empty lamp"
called "lamp" nowhere
lightsource lit_lamp
lighttime 3
action light lamp when present lamp
swap lamp lit_lamp
print "OK, lamp is now lit and will burn for 3 turns."
look
occur when flag 16
clear_flag 16
swap lit_lamp empty_lamp
look
comment "The engine sets flag 16 when the lamp runs out"
It seems that PerlScott decrements the available-light counter only when you’re carrying the lamp, whereas ScottKit seems to decrement the counter whether you’re carrying the lamp or not.
Which behaviour is “correct”? If I were starting from scratch, then I would tend to think that the behaviour I’d implement would be ScottKit’s, simply because it seems more realistic that a lamp would continue to run down even though it’s not being carried!
PerlScott’s behaviour is probably due to the codebase it’s derived from, which I believe is the v4.6 interpreter in BASIC, for Pirate Adventure, as published in BYTE magazine. My BBC BASIC port of BYTE’s Pirate Adventure behaves in the same way as PerlScott, but I wonder if PerlScott’s behaviour differs from that of the latest iteration of the Scott Adams interpreter, which was at least v8.2, I think…? In contrast, perhaps ScottKit behaves in the same way as the latest version of the terp and hence is compatible with the most recent of the official Scott Adams game releases…?
EDIT: I compiled the test game code (above) with ScottKit, manually edited the resultant .sao file, and changed the filename extension to “.dat”. Attached.
advent-q9-testlight-edited.dat.zip (500 Bytes)