Selecting responses based upon character name

I want to set up a situation where, if the player tries to tickle a thing called Elmo, one response will be given – but if the player tries tickling anything else, a second (different) response will be given.

I have tried many variations on the IF phrase but haven’t hit upon one which will work yet. I tried:

[code]Tickling is an action applying to one visible thing. Understand “tickle [something]” as Tickling.

To tickle, Something or Elmo:
if Elmo then say “Elmo giggles and giggles!”;
otherwise say “[noun] is not ticklish.”;[/code]

This does not lead to any errors, but it doesn’t work either… Elmo correctly giggles and giggles when tickled, but all other uses of the command lead to a new command prompt with no textual response at all.

Where am I going wrong?

To tickle, Something or Elmo: if Elmo then say "Elmo giggles and giggles!"; otherwise say "[noun] is not ticklish.";

This isn’t a rule for a player action. What you’ve done is created a function to be called from inside the source code. That you named it “tickle” is an arbitrary detail, it doesn’t have anything to do with the player action that you defined.

To make a player action do something, you need to create Before, Instead, Check, Carry Out, After, and/or Report rules for it.

This sets up the default response for tickling something:

Report tickling something: say [the noun] is not ticklish."

This creates an exception if you happen to be tickling Elmo:

After tickling Elmo: say "Elmo giggles and giggles!"

Incidentally, I noticed you defined your action as applying to one visible thing. This means that the action will work on something even if it is only visible (as opposed to being both visible and touchable). For example, it would let you tickle something inside a closed glass box.

What you want is an action that applies to one touchable thing (touchable also implies visible). Since touchable is the default state for a new action, you can just write:

Tickling is an action applying to one thing. Understand "tickle [something]" as Tickling.

Thanks, Michael!

I learn more and more with each question I ask. Great board.