I7 - make a troll drop his apple?

Can’t figure it out … any hints?

Trolls Pretty Lair is a room. "A dark place with the stench of death about it. Decorated with pink ribbons." The troll is here. "You see a big nasty troll." The troll holds the apple. Instead of examining the troll: say "The troll is so perplexed by your rude starring that he drops an apple!"; let the troll drop the apple. [or whatever it's supposed to say here]

now the apple is in Trolls Pretty Lair

It works! :slight_smile: Is it possible to make the troll drop the apple at whatever room she happens to be in?

In that case you could say

now the apple is in the location of the Troll

You might want to put a logic check in there, to make sure the troll is carrying the apple. Otherwise, you’ll repeat the code even when the apple has fallen. Something like this, maybe (untested!)

Trolls Pretty Lair is a room. "A dark place with the stench of death about it. Decorated with pink ribbons."
The troll is here. "You see a big nasty troll."
The troll is carrying the apple. [changed this to "is carrying."]

Instead of examining the troll:
     If the troll is carrying the apple:
          say "The troll is so perplexed by your rude starring that he drops an apple!";
	  Now the apple is in the location of the troll;
     Otherwise:
          say "The troll squints back at you.";

Just tested - it worked flawlessly. Thanks!

If the troll is an npc, can’t they “try the troll dropping the apple”?

Seconding this. The built in checks will make sure the troll is holding the apple, and any special rules about e.g. objects dropped in the Slide moving to the Dungeon will be considered.

True enough … but now the output is this:

Not good. I tried inserting a ‘stop the action’ after “try the troll dropping the apple”, but that didn’t prevent the double message output.

Maybe like this:

[code]Instead of examining the troll when the troll carries the apple: try the troll dropping the apple.

After the troll dropping the apple: say “The troll is so perplexed by your rude staring that he drops an apple!”[/code]

“silently try…” works here as well. But as matt w said, it’s better to move the message to the dropping action, otherwise there’ll be problems if the action fails for some reason.

You cannot stop an action that has succeeded, but I think “rule succeeds” after the check might.

You could also make the troll “offended” during carry out, then “report an offended troll dropping the apple…”

Although I just realized the other report will still fire as less specific. Never mind!!