Problem creating an activity on actions.

I’m trying to create a simple activity for reacting to specific actions.

Here’s the basics of what i’ve got so far.

[code]Reacting to something is an activity on actions.

Instead of examining the banana:
say “Lorem ipsum dolor sit amet.”;
carry out the reacting to activity with the current action;
say “Sed do eiusmod tempor incididunt.”.

Instead of reacting to examining the banana:
say “Consectetur adipiscing elit.”.[/code]

However, when I try this, I get an error saying “but that would involve comparing things which don’t mean anything to me, so i’m lost.”

The problem goes away if I rewrite the last instead to “Instead of reacting to when the current action is examining the banana”, but that seems a bit long winded. Is there something i’m missing here, or is that the only way to make it work?

You don’t “instead of” an activity. You can make the following constructions:

[code]Before reacting to examining the banana:

Rule for reacting to examining the banana:

After reacting to examining the banana:[/code]

Also, you have to tell Inform explicitly when to carry out the reacting to activity. For example:

After doing something (this is the last after rule): carry out the reacting to activity with the current action.

EDIT: oh, I see you already got that second part covered. Sorry.

Ah, I think I figured it out. You can force Inform understand the action a value by saying “the action of”. This should now compile and work:

[code]Kitchen is a room. A banana is here.

Reacting to something is an activity on actions.

Instead of examining the banana:
say “Lorem ipsum dolor sit amet.”;
carry out the reacting to activity with the current action;
say “Sed do eiusmod tempor incididunt.”.

Rule for reacting to the action of examining the banana:
say “Consectetur adipiscing elit.”[/code]

Thank you for that, it works. :slight_smile:

Just so you know, I already knew about having to write “rule for” instead of “instead of”, but I wrote it incorrectly when making my post. ^^"

If you need a simple set of reactions – just one reaction at a time, no “after” or “before” – you should use a rulebook instead of an activity. An action-based rulebook discriminates on the current action by default.

Kitchen is a room. A banana is here.

Reacting is an action-based rulebook.

Instead of examining the banana:
	follow the reacting rulebook;
	say "Examined banana."

Instead of touching the banana:
	follow the reacting rulebook;
	say "Touched banana."

Instead of jumping:
	follow the reacting rulebook;
	say "Jumped."


Reacting rule for examining the banana:
	instead say "React examine banana."

Reacting rule for touching the banana:
	instead say "React touch banana."

Reacting rule:
	instead say "React default."