Questions about WI §7.15. Kinds of action

Hello! I’m new to Inform 7 and struggling to catch my own fish, as it were. I have two questions about §7.15. Kinds of action.

  1. What, exactly, is being declared? I expected

    going somewhere is interesting behaviour.
    

    to be equivalent to

    interesting behaviour is a kind of action.
    going somewhere is interesting behaviour.
    

    but in the second stanza, the first declaration is rejected. I was expecting this to allow me to a disambiguating the kind of action called ... syntax to help me unravel cases where when is not being considered a condition, but no dice.

  2. Could somebody explain how to have an action performed by an actor that is not the player be considered a kind of action? I can’t determine the correct syntax.

    going somewhere is interesting behaviour.
    after going somewhere:
        say "Hmm, interesting.".
    

    triggers for the player, but not for another actor. Fine, but I can’t figure out how to describe the an actor going action in order to say it is an interesting behaviour. Certainly both of

    an actor going is interesting behaviour.
    an actor going somewhere is interesting behaviour.
    

    produce the same “appears to say two things are the same” error.

    This is similar in spirit to this question from 2012, but not identical, since I think in my situation the action should exist without conditionals.

  3. If there is a way to achieve what I want, can you also help me understand the path to discover it? I have read (some small part of) The Standard Rules, which refer to an actor going, e.g.,

    Check an actor going when the actor is on a supporter (called the chaise) (this is the stand up before going rule):
    ...
    

    However, this isn’t how these actions are referred to here. Normally I’d dive into the compiler source code, but… well, soon enough, we hope.

Any suggestions? Thanks in advance!

  1. Conceptually, yes, those are the same. But it’s not legal to actually declare something as a kind of action other than implicitly via the first way.
  2. The actor is not itself part of the kind of action. But this works:
Going somewhere is performing interesting behaviour.
After an actor performing interesting behaviour:
	say "[The actor] is doing something interesting.";
	continue the action.

(Note that I’ve also added performing – this is mostly arbitrary but keeping a verb format in the name makes the rule definition look less weird.)

Note that this occurs after the actor succeeds at the action but before it Reports what they did, so you need to be careful what you say, since the player hasn’t been told what the actor did yet (and continue the action unless you want to disable the default Report).

If you want this to only apply to someone other than the player doing it, then use someone rather than an actor.

If you want to say something after the Report rule, usually the best method is to set a global variable of some kind in the After rule, and then have an Every Turn rule that detects this and says what you want before clearing the variable again (so it doesn’t happen again). Although there is a caveat that this can run into trouble if NPCs perform a chain of actions (e.g. implicit taking or opening) in a single turn.

1 Like