spellingCorrector (adv3Lite)

A question for Eric: Is there a way to shut off the spellingCorrector in specific locations or in specific circumstances? Other than modifying it so as to test the value of a flag variable in the correct() method?

The reason I’m wondering is because I’m creating one of those annoying grid-shaped puzzles where commands like ‘x a3’ are meaningful. (You’re examining cell a3 in the grid.) If the player enters ‘x a9’ or any other number that isn’t part of the grid, the spelling corrector leaps to the rescue, but in this case I’d much prefer that it remain quiescent. “You can’t see any a9 here” is actually a more sensible response.

You can disable the spelling corrector by setting Parser.autoSpell to nil. You could perhaps override Parser.autoSpell to make it a method that returns true or nil according to circumstances of your devising, using your previous sample code:

modify Parser
    autoSpell = (gPlayerChar.isIn(worldHeadquarters))

Of course you could something rather more elaborate than this.

Thanks. That works nicely. It’s an open question whether players would prefer to be able to type other words sloppily in this particular room, or whether a refusal to reinterpret entries like ‘e3’ and ‘a8’ is more natural. If I ever finish this game, I’ll see what testers think…