Taking objects from people

Firstly I’m a bit of a novice at i7 development and I’m having a problem taking items from NPCs.
What I need is the phrase “take ipod from Huw” to illicit a custom response:

I have the following:

instead of taking ipod from huw when huw has the ipod: say "You wrestle the ipod from Huw's mitts."; move ipod to player.

But the compiler complains that it doesn’t make sense. Any ideas?

Hi there! I’m new myself, and this is my first chance to help someone!

This works:


instead of taking ipod when huw has the ipod:
say “You wrestle the ipod from Huw’s mitts.”;
move ipod to player.


The problem was the words “from Huw”, which aren’t required.

Good luck finding your way around!

Thanks for the speedy reply :slight_smile:

That works to an extent. However it turns out that I seem to need two different clauses:

[code]instead of removing ipod from huw when huw has the ipod:
say “You wrestle the ipod from Huw’s mitts.”;
move ipod to player.

instead of taking ipod when huw has the ipod:
say “You wrestle the ipod from Huw’s mitts.”;
move ipod to player.
[/code]

This allows both the straight “Take ipod” and “Take ipod from huw”.

Why they chose ‘removing’ I’m not sure??

Because removing things from other things is a reasonable synonym and having different actions have almost the same name isn’t a good thing in most cases. (The “main” command is REMOVE X FROM Y which will work in this case as well.)

You can combine the two rules so you don’t have to repeat the contents:

Instead of taking the ipod or removing ipod from huw when huw has the ipod: say "You wrestle the ipod from Huw's mitts."; move ipod to player.

Interestingly I tried that one but the compiler chucked it out with the following:

Oh yeah, I keep forgetting about that limitation. You can do it this way:

[code]Instead of taking the ipod when huw has the ipod:
say “You wrestle the ipod from Huw’s mitts.”;
move ipod to player.

Instead of removing ipod from huw when huw has the ipod:
try taking the ipod.[/code]

(It’s always better not to have identical rules because there’s a big chance that if you later change the one you forget to change the other.)

Nice, that’s a lot tidier.

Thanks everyone :slight_smile: