Conversation: Instead vs After (Inform 7)

Well, as per the title.
What are pros and cons of using each one for conversation?
For instance:

Instead of asking Alice about ...

VS.

After asking Alice about ...

The obvious thing is that ‘Instead of’ totally intercepts and “replaces” the command, whereas ‘After’ allows the command to do (whatever) and THEN deal with the Asking (telling, whatnot)
Is one or the other the preferred method? Or perhaps it really doesn’t matter.
Thanks :nerd_face:

Instead runs before (and instead of, by default) the Carry Out rulebook, while After runs after it (but before and instead of the Report rulebook).

For something like ask, where the Carry Out rulebook does nothing, there isn’t really any difference, so it’s just a matter of preference. For other actions, it can make a difference.

1 Like

Instead rules also pre-empt After rules, I think – so if you’ve got other After rules that might apply to the asking action, like if the player does something in a particular location or to a particular person, those won’t work if you use Instead rules. If that’s the case, After rules might be safer.

Yes. Here’s a quick summary:

  • Before: by default, make no decision. If stopped, no further rulebooks are run.
  • (some internal visibility/accessibility sanity checks run here)
  • Instead: by default, stop the action. If stopped, no further rulebooks are run.
  • Check: by default, make no decision. If stopped, no further rulebooks are run.
  • Carry Out: by default, make no decision. If stopped, other rulebooks continue.
  • After: by default, stop the action. If stopped, no further rulebooks are run.
  • Report: by default, make no decision.

“By default” means what happens at the end of a specific rule if it doesn’t otherwise explicitly say what to do (via one of continue the action, stop the action, make no decision, trailing instead, or a few less common phrases). Regardless of how it decided, if the result was anything other than make no decision then no further rules in that rulebook are run, but it may continue on to other rulebooks; continue the action will always continue and stop the action behaves as described in “if stopped” above.

If no rules apply, or it got all the way through the rulebook with every rule making no decision, then it will continue on to the next rulebook by default.

Check/Carry Out/Report rules are intended for the baseline behaviour of any given action (whether that’s defined in the standard rules, an extension, or the story itself). These are explained in more detail in WI chapter 12.

Before/Instead/After rules are intended for story-specific overrides to the default behaviour; which one is more appropriate depends on what other rules are in play and what effect you’re looking for. (Before should be used sparingly; since it bypasses sanity checks it can create some weird behaviour if you’re not careful.) These are explained in more detail in WI chapter 7.

Having said that, sometimes it may make sense for a story to define extra Carry Out rules if there’s something it wants to silently do in addition to the normal action (such as setting flags); this can avoid running into conflicts with custom After rules affecting the same action.

4 Likes

So essentially, for conversations with NPCs, it really doesn’t matter if you use ‘Instead of’ or ‘After,’ is that correct? (barring perhaps very unusual and/or uncommon needs/porpoises)

Provided you’re consistent about which you use, then yes, it doesn’t really matter.

If you’re using a conversation extension, on the other hand, then the documentation for that should usually tell you how to write rules; it may have special requirements.

1 Like