[size=85]Oops, I thought I was being clever but in fact I was just being careless and not reading your code closely.[/size]
As soon as Inform begins trying to determine whether or not Sally can eat the cake, the implicit taking action will occur automatically (and annoyingly in my opinion); this means you have to intercept the whole action prior to it reaching that stage. I guess that’s the point I was trying to make in my other post–that you generally had the right idea but were trying to intercept the wrong action (taking, as opposed to removing it from).
In the eating example, if I understood correctly (if not it’s certainly my fault rather than yours) I think this is what you’re looking for:
[code]The Stage is a room. “You’re about to wow the audience with your magic trick. All you need to do is ask [Sally], your beautiful assistant, to eat the chocolate cake.”
Sally is a woman in the Stage. The chocolate cake is in the Stage. The chocolate cake is edible.
A person can be polite.
After reading a command:
if the player’s command includes “please”:
now the player is polite;
cut the matched text;
otherwise:
now the player is not polite.
Persuasion rule:
if the player is polite:
persuasion succeeds;
otherwise:
say “‘You [italic type]might[roman type] say [’]please[‘] when you ask,’ [the person asked] says petulantly.”;
persuasion fails.
Before asking someone to try eating something:
if the player is polite:
unless the person asked encloses the noun:
try the person asked taking the noun;
otherwise:
say “You [italic type]might[roman type] say [‘]please[’] when you ask,’ [the person asked] says petulantly.” instead.
After Sally eating the chocolate cake:
say “Humming cheerfully, [the person asked] eats [the noun].”.[/code]
By intercepting the Sally’s eating action before we officially ask her to try eating, we are able to cut off the automatic implicit-taking-while-checking-eatability activity that occurs (even prior to any “Before” rules we might directly write regarding it) when Sally starts to consider eating the cake on her own. Note that we’re considering the results of the persuasion rule here, and we didn’t actually intercept the persuasion rule itself; nor is it necessary to do so unless the code grows considerably more complex.
Therefore we have:
sally, eat cake
You might say ‘please’ when you ask," Sally says petulantly.
sally, please eat cake
Sally picks up the chocolate cake.
Humming cheerfully, Sally eats the chocolate cake.
If you prefer the original reporting style of the implicit action in cases where Sally does eat the cake, you could of course change the Before rule to:
Before asking someone to try eating something:
if the player is polite:
unless the person asked encloses the noun:
silently try the person asked taking the noun;
say "(first taking [the noun])"
otherwise:
say "You [italic type]might[roman type] say [']please['] when you ask,' [the person asked] says petulantly." instead.
Hopefully the above is more helpful to you than my first post; if not please say so and we’ll try again.