version 1/120327 by Kevin Norris

  • Home page
  • Beginning
  • Previous
  • Next

  • Chapter: Following

    If the persuasion rules allow it, the player can ask NPCs and fellow PCs to follow him. This following is relatively simplistic; characters will only follow the player if they are in the same place as the player, and following people other than the player is not possible. It is implemented as the following action, which can be looked up in the index for more details. It is tracked with the "ready to follow" flag.

    By default, waiting will unset the following. This goes somewhat against the tide of historical IF, so the following limitations are placed on it:

    1. It won't happen if the player waits.

    2. It can be prevented entirely by unlisting the "waiting ends following rule".

    3. The report waiting rulebook is unchanged; the default text "Alice waits." (which, admittedly, does seem a little strange for the standard Inform world model) will have to do.

    Of course, you can override these limitations, or extend them, if you see fit.

    If the player tries one of these actions and makes it to the carry out rules, followers will generally try to follow the player:

    1. Going

    2. Entering

    3. Exiting

    4. Getting off (of something)

    If the player moves via some other mechanism, followers won't follow automatically; you will need to add rules for this. Followers *do not* use any form of path-finding; if they become separated from the player, they won't know how to find them again. This is intended to be realistic, but if you would prefer to enable path-finding, it is available:
        Use smart following.

    If the holder of the player is not the holder of the NPC, they generally won't try, except for entering, which is (perhaps) a little too lenient: it will be tried as long as the NPC can see the noun.

    There are a few other restrictions on who can follow and when, mostly common sense things. In particular, if the NPC cannot see the player, no following will take place.

    Technically, the NPC arrives in the destination slightly ahead of the player, but if you write an instead rule such as

        Instead of an actor going to the Ballroom:

    it will catch the player first. Here's a timeline:

        1. Player types e.g. GO WEST.
        2. Player passes before, instead, and check stages.
        3. Player begins carry out stage.
            3.1 NPC(s) tries/try to go west.
                3.1.1 NPC passes before, instead, check, and carry out stages.
                3.1.2 NPC hits special report rule which captures ordinary report OR some other after rule prevents both the ordinary report and the capture.
            3.2 Player is moved to the west.
        4. Player begins after/report stage.
            4.1 Captured NPC reports are consolidated into a single report. Reports which were not captured are presumed to have been narrated elsewhere, and omitted.
            4.2 Player completes report stage (incl. e.g. VERBOSE room description printing).
    As you can see, although the NPC will technically arrive first, the player will hit before/instead rules before the NPC does, so this is mostly invisible.

    If you write after rules applying to NPCs, note that they will suppress an ordinary follow report in addition to the usual reporting rules.