External events

External events are events that are not directly linked to a scene. They can be included in one or more scene using Link events. They can be used to separate and organize large events sheets into smaller ones: Typically, a scene can contain some events and a bunch of Link events linking to one or more external events sheets.

For example, you can have a scene called GameEngine with links to external events called EnemyManagement, PlayerManagement , UserInterfaceManagement, EnvironmentManagement.

Basic usage

You can create a new external event using the project manager. Double click then on the newly added external events to open the editor.
Before using it, you just need to choose, using the list located at the top of the editor, the scene to use to edit the events. When you choose a scene, the events can be edited as if they were included in the scene: You can use the objects, variables and everything offered by the scene.
The editor can be used as a classical events editor.

Advanced use: Enable separate compilation

The events of a scene are automatically compiled into machine code. Even if it is quite fast most of the time, you can make the compilation of the external events separated from the compilation of the events of the scene in which it is included. To enable this, you have to:

  • Include the external events using a Link event which is located at the root of the events of the scene. That is to say, the Link events which are used to include the external events must not have any parent event.
  • Make sure that the external events are included in only one scene.
  • Activate the separate compilation in the properties of the external events sheet.

When these requirements are met, GDevelop will compile the external events separately from the scene: Any change in the external events will only trigger the internal compilation of the external events. And similarly, a change in the events of the scene won't require the external events to be recompiled.

This can be useful when you have a very large amount of events which require a lot of time to be compiled.
If you do not need any speed boost, you can still use external events: They provide a nice way of structuring the events of your scene by putting together the events related to a specific task.