Changing 'throw' command for one item?

The deafult for response throw is to drop an item, which is fine, except in my game I want a special response when you throw a ball, I have the following which compiles but doesn’t work, just returns the drop action when you ‘throw ball’

Description of the rubber ball is “An old and scuffed rubber ball.”

Instead of throwing the rubber ball at nothing:
Say “You throw the rubber ball, in a shot Dylan bounds away and catches it in his mouth before it hits the ground. He runs back and returns it to your hand.”

Managed to solve it with the following, but not sure it’s the simplest solution:

Instead of dropping rubber ball when the player’s command includes “throw”:
Say “You throw the rubber ball, in a shot Dylan bounds away and catches it in his mouth before it hits the ground. He runs back and returns it to your hand.”

Instead of throwing rubber ball at something when the player’s command includes “throw”:
Say “You throw the rubber ball, in a shot Dylan bounds away and catches it in his mouth before it hits the ground. He runs back and returns it to your hand.”

I am on my mobile phone at the moment so will have to make this answer brief. “THROW” is defined as a synonym of “DROP”. To create a separate throw command you need to put something like this:

Understand the command "throw" as something new.

You can then define new variants like “throwing it at” and “throwing it over”. I don’t think I’ve made a single game in which I didn’t define “throw” as a separate command.

I think the chapter of the documentation you want is 6.2.

1 Like

cheers!

1 Like

Alternately:

After dropping the rubber ball when Dylan is in the location:
     Say “You throw the rubber ball, in a shot Dylan bounds away and catches it in his mouth before it hits the ground. He runs back and returns it to your hand.”;
     Now the player carries the rubber ball.

After dropping the rubber ball:
     Say "You give the rubber ball a half-hearted toss, but Dylan is not around, so you'll need to retrieve it yourself."

You can specify conditions in rules, and Inform will always follow the most specific rule it has when conditions are met, so the plain “After dropping the rubber ball” won’t fire if the first one does.

You could also specify “when the player’s command includes ‘throw’” but that gets into the weeds of verb synonyms - THROW BALL/TOSS BALL/PITCH BALL/CHUCK BALL/HURL BALL…

1 Like