Narrative Event

Narrative Event are what triggers dialogue, or effects such as starting or ending a quest.

The way the system works, is by creating a hierarchy of objects for your dialogues.

When an Event is triggered, each child object contained in it will be executed 1 by 1, in the order they appear. Child objects can contain dialogues, conditions or effects.

This is an example of dialogue hierarchy. In this example, DialogueRoot is an empty game object with no component attached. The NarrativeEvent component is attached to the 3 objects called Event.

This is another example of a NarrativeEvent. Test event has the NarrativeEvent component. And the two Msg objects have the DialogueMessage component. (See next section).

Event ID: is an optional ID reference to the event if you want its state (such as number of times triggered) saved to file.

Trigger Target: Reference to object in your scene that will trigger this event (ex: region)

Trigger Actor: Reference to the actor triggering this event (if set to Actor Interact or Actor Near)

Trigger limit: will determine how many times that event can be triggered, with 0 meaning infinite. If the event has an event_id the trigger count will be saved into the data file.

Dialogue Type: Defines which dialogue panel will appear if the event contains dialogues.

Important: Important dialogues cannot be skipped, and the user must go through all the messages. Also an Important dialogue will display an Icon on top of the Actor when the player is nearby. Non-Important Dialogue can be skipped (right click by default).

Pause Gameplay: Will pause the game while this event is running. If you want this to work you need to link to the UnityAction onPause and onUnpause and pause your game. (NarrativeManager).

Trigger Types

Defines how the event is triggered, there are different types available:

Manual: Needs to be Triggered by script

Auto Trigger: Will trigger automatically whenever the conditions are true. Make sure to add conditions for this type of event because the game will try to trigger it every frame.

Interval: Trigger every X seconds

Near Actor: Triggers when the player is near the specified actor.

Interact Actor: Triggers when the player interacts with the specified actor. In the demo a simple mouse click near the actor will trigger the interaction.

Enter/Exit Regions: Triggers when the player enters or exit the specified region. Regions are prefabs you can add to your scene.

After Event: Trigger after another speficied Event finishes.

Narrative Groups

Groups are optional, but if you decide to use them, they can be a way to organize the event. In that case, the object hierarchy of your dialogues should be like this.

Groups have the NarrativeGroup component attached. Events have the NarrativeEvent attached. Msg and Effect can have DialogueMessage, NarrativeEffect and/or NarrativeCondition. And the DialoguesRoot is just an empty gameobject to put all your dialogues into.

When events are part of a group, they may not trigger at the same time. The first event in a group will be the one triggered if the conditions to trigger it are valid. If not, then the second event is considered, until all the events in the group have be considered. When events are not in the same group, there is no such "sequential" check and events can trigger in any order.

Last updated