Event Chains

version 1 by William S Martin

  • Home page
  • Beginning
  • Next



  • Documentation


    Event Chains is a small extrension that doesn't add any new functionality into the game. Instead, it provides an alternative way to order events through a table, as opposed to rules or lengthy IF...ELSE IF statements. It was especially made for conversations, but it can be applied to any set of complex events.

    Event Chains was intended for situations where one specific trigger could produce a variety of different effects, depending on a wide variety of conditions in a specific order. For example, talking to someone at different points in the game will produce different replies, perhaps triggering events under certain conditions, or when there's a timed event that triggers rules. Event Chains is a little complex to use casually. It will save a considerable amount of time and space, however for very complicated interactions, and very useful when you want things considered in a very specific order.

    Take this example:

        Instead of talking to Hugh while the player is not carrying the luggage and Hugh is not carrying luggage: say "'Sir, I need your luggage.'"

        After talking to Hugh when the player has the luggage:
            now Hugh is carrying the luggage;
            say "'Thank you, sir,' he says, taking your bag."

        After talking to Hugh when Hugh is carrying the luggage: say "'Thank you, sir.'"

        After talking to Hugh when Hugh is carrying the luggage for the fifth time:
            say "In a fit of rage, Hugh punches you in the face.";
            now the player is bruised.
            
    This would work, however, it uses many rules, and if we have a conversation-heavy game, our conditions are probably going to get ever more arcane, like "After talking to Hugh when Susie is in the parking lot and Hugh is carrying the luggage and the player carries the airplane ticket which is stamped for the fifth time during scene10".

    In response, our author might write the following:

        Counter is a number that varies.
        
        After talking to Hugh:
            if Hugh is not carrying the luggage and the player is not carrying the luggage:
                say "'Sir I need your luggage.'";
            else if the player is carrying the luggage:
                say "'Thank you, sir,' he says, taking your bag.";
                now Hugh is carrying the luggage;
            else:
                increment the counter;
                if the counter is not 5:
                    say "'Thank you, sir.'";
                else:
                    say "In a fit of rage, Hugh punches you in the face.";
                    now the player is bruised.

    Which would work also, but would be rather awkward, and it isn't modular.

    Event Chains provides an elegant, modular solution to situations like these.