Category:Story Manager

Revision as of 16:06, 28 November 2011 by imported>Scornett (→‎Overview)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Overview

The Story Manager starts quests based on game events, such as when an Actor dies, when the player enters a new Location, or when the player increases in level. These events are automatically generated by the game, and received by Story Manager Event Nodes (SM Event Node, under Character in the Object Window), which can then respond by starting quests or taking other actions.

Every event the Story Manager handles has an SM Event Node that is made up of a series of decision nodes all organized in a decision tree. The Story Manager works through the decision tree in order to choose a single quest to start (the decision tree can optionally be setup in order to start multiple quests).

Each node in the tree has its own properties and node conditions that tell the Story Manager how and whether to process the node and continue along that path of the tree. There are four types of nodes:

  • Event Nodes
  • Branch Nodes
  • Quest Nodes
  • Quests

See the SM Event Node page for a detailed reference on how to edit nodes in the event tree.

Quests in the Story Manager

In order to start a quest from the Story Manager, that quest must be tagged to a specific game event. You can choose an event to tag a quest to in the Quest Data Tab of that quest.

Once a quest is tagged, any Quest Aliases used by the quest can access the Event Data for that event, such as the Location the event occurred in, or one or more of the Actors involved in the event.

Finally, a quest that is tagged to an event must be added to the SM Event Node for that event and can only be started through the Story Manager.

How the Story Manager Works

Triggering an Event

An Event is always triggered in the same way for its type. For example, the Kill Actor Event always occurs when an Actor dies, while the Craft Item event is always triggered when the Player makes an item.

A triggered event passes all its Event Data to the Story Manager, and this data is used primarily to fill Quest Aliases in quests that the Story Manager starts, and to condition the Story Manager itself to only start quests based on specific criteria.

Starting a Quest

When the Story Manager receives an Event, it processes the SM Event Node associated with that event and decides which quest to start:

  1. The Event Node is processed first and its Node Conditions are checked. If the conditions are valid or there are no conditions, the Story Manager will then process a node directly connected to it (i.e., any of its child nodes). Which node it picks depends on whether the Event Node is selected to be Stacked or Random. Stacked Event Nodes always pick nodes in order from top to bottom, while Random Event Nodes pick randomly from any of its child nodes.
  2. The child node that is chosen then has its Node Conditions checked. If these conditions fail, the Story Manager then picks another child node, and so on until it either finds a valid node or there are no more child nodes to check.
  3. A valid child node can either be a Branch Node or a Quest Node and each is processed differently:
    1. Branch Nodes contain quest nodes or other branch nodes, creating an additional set of child nodes that the Story Manager then processes. This allows you to create more complex logic structures to start different groups of quests based on shared sets of conditions.
    2. Quest Nodes contain Quests, and once the Story Manager processes a Quest Node, it will attempt to start a single quest inside that node. It chooses which quest to start based on whether the node is Stacked or Random and based on the conditions placed on that quest within the Story Manager.
  4. Once a quest is selected by the Story Manager, it will attempt to start that quest and fill all its quest aliases. If the quest aliases cannot be filled, the quest fails to start and the Story Manager attempts to start another quest.

Starting Multiple Quests

Typically, once the Story Manager starts a quest from an event, the event is "consumed" and no more quests are started. However, there are two ways to make the Story Manager start multiple quests from a single event:

  1. If a Quest Node is marked as "Shares Event", the Story Manager will process another node in its list until it gets to a node that isn't marked as "Shares Event." Be careful how your node tree is structured as you don't want the Story Manager to accidentally process a non-"Shares Event" node before you wanted it to process a "Shares Event" node.
  2. If a Quest Node has the "Num quests to start" checked, the Story Manager will attempt to start every quest in the Quest Node up to the number given. The Story Manager will start each valid quest until it either reaches the maximum number of quests to start or runs out of valid quests in the node.