After a lot of bumbling around, I took Roody's advice for his thread by putting my code in "actor PreParse" in the before rule of the "you" object. I'm trying to insert my own text with a CustomError message, by calling ParseError with the number corresponding to the one I used in my replacement of CustomError. (I learned that GetInput is designed for something totally different).
I think I'm starting to make a little bit of progress, but now I'm about out of ideas. I used the Debugger to follow the code, and I noticed that Parse gets called after my condition "if verbroutine = &DoSwitchOn" is evaluated. I think this may be part of the problem. I'm thinking the whole use of PreParse is to supplant Parse altogether for this command.
Sorry to bother you guys about this. I'll copy my code below. If anyone has any suggestions, they would be greatly appreciated.
Code: Select all
before
{
actor PreParse
{
if self in upper_storey and upper_storey is not light
{
if verbroutine = &DoSwitchOn ! "&" because I don't want to call the routine
{
if word[3] = "light" or "lightswitch" or "lights"
{
ParseError(103)
return true
}
else
{
return false
}
}
} ! end verbroutine
} ! end actor
} ! end before