Instead of or Carry out giving / After giving

Still learning the ropes, so this one is also probably a quick answer - thanks everyone who’s helped me out with other stuff!

[code]Instead of giving the money to someone:
say “You come close and slip the bill in [the second noun]'s hand.”;
now the noun is carried by the second noun;
rule succeeds;

After giving the money to Joe:
say “Joe hands back your bill, and takes out a pair of handcuffs”;
end the story saying “You attempted to bribe a clean cop”;[/code]

All right, the “after” isn’t happening, what am I missing? Is it that the giving isn’t actually happening, even with “rule succeeds” being there, so the “after” doesn’t happen? But with actions on, it even notes that the giving succeeds…

The “rule succeeds” in your Instead rule cuts off the action-processing procedure completely, so the After rule never fires. I think I would do something like this:

The block giving rule does nothing when giving the money to someone.

After giving the money to someone:
      say "You come close and slip the bill in [the second noun]'s hand.";
      if the second noun is Joe:
            say "Joe hands back your bill, and takes out a pair of handcuffs.";
            end the story saying "You attempted to bribe a clean cop."

I had actually tried it with “Carry out” as well, but it fails the block giving rule? [edit: sorry, didn’t notice that you accounted for that. looks good, thanks!]

I’ve edited my post above to do everything with an After rule. That’s to stop Inform’s default Report rule from firing when you give the money to someone other than Joe. (There are lots of other ways to deal with that, though. I don’t think mine is the most elegant.)

Hm, what do you mean - why is that bad? (In the non-fake-placeholder version of this, I’m probably going to write a custom line blocking you from giving the key item to someone else.)

Well, the code I originally suggested would have produced output like

Using an After rule instead of a Carry out rule avoids the “You give the money to Sam”.

Ah, okay, yes, I didn’t notice because I wrote a more specific “block giving rule does nothing” to begin with.