Sorry, my Instead advice was potentially a bit harsh. It’s kind of a pain to have to know to turn off or overcome a rule (the block giving rule) rather than write an Instead that goes around it. But on the other hand, I’ve seen other people who were new here soon after say the main thing they wish they knew early on was not to just go crazy with the Instead rules
Now, between what Steven and I said, Amy should be receiving the coin as a result of a successful give action. And you shouldn’t be getting ‘You can’t see any such thing’ for trying to give again, UNLESS you’re not in the same room as Amy. I’ll share a demo below. This leaves the last bit you wanted to attend to to deal with – having the game remember we gave it to her.
In the default situation, when you try to give her the coin (that she already has) Inform starts with the assumptions that you can’t give what you don’t have, and can’t even try to give what you can’t see. But by default, the player can see what other people are carrying, scope-wise. There’s no sign of this if you type X AMY (which is what made you think she hasn’t got it), but trust me, she got it! After giving her the coin, type the test command SHOWME AMY. You’ll see the coin in her inventory tree.
So now she’s got it, attempts to give it to her again do all they can to try to make this happen – they first try to take the coin they can see, which she’s holding. This fails because this kind of stealing is blocked automatically.
This is actually where a Before rule might be good… we want to kill the attempt to take the coin from Amy in these circumstances before it even begins. In these circumstances, an Instead rule happens too late, trying to intervene after Inform’s decided we want to try taking the coin off her. That’s not something I knew off the top of my head, I just found it out when I tried.
So here’s a demo that puts all this together. If you copy-paste it to a project then run it and type TEST ME, it will try the test commands in order. The Before rule does the job for the moment, but if you had more coins around, or more people to give them to, it might need more clarification. It works great for now because there’s only one coin.
lab is a room.
Amy is a woman in lab.
player holds coin.
The block giving rule does nothing when noun is the coin and second noun is Amy.
After giving coin to Amy:
say "Amy says, 'Ta.'";
Before giving coin to Amy when Amy carries coin:
say "I already gave it to her.";
rule fails;[In a Before rule, we have to manually stop an action from going any further]
Test me with "give coin to amy/x amy/showme amy/give coin to amy/get coin".