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?
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]
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."