I’m not sure if there’s a way around it using only action definitions. I expect someone who knows more than I will immediately come and say there is shortly after this post of mine, but I can have my fun before that happens
Here’s a system I worked out for differentiating various kinds of drawing.
The main thing it adds to yours to catch out attempts to draw (words) on (something not present) is by checking if the player typed the word ‘on’ somewhere in their command. If they did, we could then use text matching to isolate the useful bit of what they typed (the description of the artwork, presumably) from the non-useful bit (the thing they named that isn’t present.) I haven’t implemented that yet, just the framework to catch it.
Try this demo and say ‘test me’. I gave the player a notepad so they can draw stuff without naming a surface. Also I added a command to try to ‘draw on’ something, but without saying what to draw.
[code]There is a room called Studio.
the cat is an animal in Studio.
player holds a notepad.
the wall is a fixed in place thing in the studio.
Drawing it on is an action applying to one topic and one thing.
Understand “draw [text] on [something]” as Drawing it on.
Carry out Drawing it on:
say “You draw [topic understood] on [the second noun].”
Vague drawing is an action applying to one topic.
Understand “draw [text]” as Vague drawing.
Drawing on something is an action applying to one thing.
Understand “draw on [something]” as drawing on something.
Carry out Drawing on something:
say “You draw on [the noun].”
Carry out Vague drawing:
if player’s command includes “on”:
say “If you read this message, the player tried to draw on something that ain’t here, so now we need to write some code to deal with that.”;
say “You draw [topic understood] in your notepad.”
Test me with “draw a face on cat / draw face on wall / draw face on cupboard / draw a big face / draw on the wall / draw on the cupboard”.[/code]
Edit PS - Also, at this most basic level of checking for the presence of ‘on’, the wrong thing will happen if you type something like ‘draw a man on a skateboard on the wall.’ Technically that should work because the wall is real, but the two 'on’s will trip it. So if you want that kind of thing, you’d have to get into more sophisticated text matching.