Addon overview

This document aims to give you a brief overview over the basic principles of the Godot Event Manager.

Events

The very basic building block you should know about are events. Those are simple “When A happens do B” constructs where A is called trigger and B is called action. They might also contain conditions which apply additional constraints on the execution (e.g. “only execute if player is above 50% HP” etc.). Those three building blocks (trigger, condition and action) will be referred to as components (of an event) from now on.

Note that events are stored per map/scene in Godot. When showing the event manager interface only the events of the currently active scene will be displayed. Also the plugin will add an EventController node to your scene where all the events are stored. It may be renamed and moved freely but removing it will also delete all your events.

Triggers

A trigger describes under what circumstances an event should take place. Examples for triggers are “when area X is entered” or “when enemy Y dies”. Some general triggers are available by default, but the exact types of triggers depend on the project and are normally defined by the programmers.

There are three properties that are shared by all triggers:

  • oneshot - This trigger will only fire once and after that will be disabled.
  • deferred - The trigger will not be executed immediately but during the next idle frame. This might be useful in some specific situations.
  • disabled - The trigger is initially disabled and has to be enabled by another event or script before it can be activated.

An event may also have multiple triggers, each with their own state. Note that this also includes the oneshot and disabled flags. That means if an event has multiple triggers with those flags it might trigger multiple times by different triggers.

Conditions

A condition defines additional constraints which have to be met before the event is executed, regardless of the trigger that started the event. Examples for conditions are “player is inside area X” or “player has item Y in his inventory”. When multiple conditions are present, all of them have to be fullfilled in order for the actions to be executed.

Conditions have one default property:

  • disabled - The condition is disabled and does not have to be fullfilled.

Actions

An action defines what should happen if the event takes place. Examples are “spawn enemy X at position Y” or “give player item Z”. Multiple actions are executed in the order they appear in the list. You can use the arrows in the list to reorder them. Deferred actions will obviously be executed after any non-deferred action.

Actions have two default properties:

  • deferred - The actions execution will be deferred until the next frame.
  • disabled - The action is disabled and will not be executed.

Also note that some actions might take multiple frames to be executed, but all will be started during the same frame. Depending on the actions implementation, it might not finish execution when the next action is run.