This is a tricky one. In the game I have a sheet of paper and a pen, or equivalent. I’ve implemented the WriteOn action exactly as shown in the library manual, and it works. I can enter WRITE DAFFY DUCK ON PAPER and get the desired result.
However, when I enter a bare WRITE ON PAPER command, I get a runtime error on line 1532 of action.t. This player command ought to trigger the Write action, which is defined in actions.t as follows:
DefineLiteralAction(Write)
againRepeatsParse = nil
execAction(cmd) { askForIobj(WriteOn); }
;
It appears that the result ought to be that the parser asks the player what they want to write on. But that’s not what happens.
If I try a different input, such as WRITE ON TABLE (the table being in scope), I get a run-time error at line 2392 of action.t. This bug occurs only when there is an object (the piece of paper in this case) which uses the WriteOn action. If there’s nothing in scope for which WriteOn is implemented, I get the library’s response when I try WRITE ON BRICK WALL or whatever.
This may be a library bug – I don’t know. I think I’ve copied my code for WriteOn precisely from the Library Manual, so I don’t think that’s the problem, though it might be. My own code doesn’t include a Write action of any kind, so that’s not the source of the problem.
For reference, here (not really a spoiler, as these objects will definitely show up when you enter the room) is as follows:
writtenText = ''
dobjFor(WriteOn) {
verify() {}
check() {
if (gLiteral == nil) "You'll need to say what you want to write. ";
if (!quillPen.isDirectlyIn(gPlayerChar))
"You have nothing to write with. ";
else if (!inkBottle.isDirectlyIn(gPlayerChar))
"You'll need some ink. ";
}
action() {
"Using your best penmanship, you write <q><<gLiteral>></q> on the
parchment. ";
writtenText += (gLiteral + ' ');
}
}
I think I’m going to simplify the puzzle (for other reasons) so as to eliminate the need for WriteOn. But I still think it would be useful to try to track down what’s going on here. If it’s a library bug, I’d like to notify Eric. I don’t know if he’s still active in IF, but it would be a courtesy to let him know.