Events in GDevelop allow you to create the logic that is running your game. Events are readable by anyone and can be authored without advanced programming knowledge.

Even for experienced programmers, events are fast to write and read. They allow artists, designers, level designers and anyone working on the game to understand and update the rules of the game.

Event types

There are different types of events in GDevelop:

  • Standard event: this event is the default one and is triggered every single frame. It executes the actions once the conditions are true, then moves on to the next event.
  • For Each event: this event is triggered for each and every instance of the selected object, checks the conditions, and then executes the actions for each individually before moving to the next event.
  • Repeat event: this event is repeated the specified number of times before moving on to the next event.
  • While event: this event is repeated continuously while the specified conditions are met and moves on to the next event only after the conditions of this event are no longer true.
  • Comments: these events are used to add comments or explanations into an event sheet - they won't change anything during the game.
  • Link: This event allows you to call the specified external event. External events are events that are not linked to a specified scene. You can call and execute them from one or more scenes using Link events.
  • Group: A group contains one or more events. It's an easy way to organize your events into sections. You can collapse the content of the group to hide the events you're not interested in when working.
  • JavaScript event: this event allows you to use JavaScript code along with other events

Events can have sub-events (except for Links, Comments and JavaScript code). Sub-events are triggered only after the parent event's actions have been executed. If the conditions of the parent event are false, then no sub-event is executed.

Finally, advanced users can create their own actions and conditions using functions. It's a way to make your events even more modular and adapted to your game.

Add events

In order to add events to our game, first, we need to switch to the event editor. We can do that using the event tab next to our scene tab.

After that, we can find the tools on the top to add events. As the standard and sub-events are the most often used type of events, we have a quick button to use on the top. To add standard event we can use the add event button To add sub-events, first, we need to select an event in the editor and later, click the add sub-event button. You can find all the available options by clicking the plus icon.

Add conditions and actions

An event comprises of conditions and actions. When the specified condition(s) are met, the corresponding action(s) take place. When an event is added in the editor, it is blank (no conditions and no actions):

We can add any number of conditions and actions to each event.

To add conditions and actions, we need to click add condition and add action inside the event respectively, then we can choose from a number of options, sorted in different categories.

In order to learn more about how to use the different conditions and actions, we recommend reading the tutorials and guides available on the wiki.

You can also create your own conditions and actions using functions.

Move events

Unlike copying, when you move an event, its position is changed rather than being duplicated to a new position. This can be done by right-clicking on the event to be moved and selecting the “Cut” option. This will remove the event from the events sheet.

To paste the event, right-click on the event above which your event should be pasted and select the “Paste” option.

Another way to move an event is by simply drag-and-dropping the blue bar on the left side of the event in the vertical direction.

This method also allows you to move a standard event as a sub-event. For this, drag-and-drop the event below the desired parent event of your sub-event and move the event to the right side.

Move conditions/actions

You can move conditions/actions such that they are removed from the event they were originally in, and moved to the event they are desired to be in.

You can move a condition/action by right-clicking on it, and then choosing the “Cut” option. To paste it, right click on the “Add condition” or “Add action” option in the desired event and choose the “Paste” option.

Some features might be supported both, as a condition as well as an action. For example, “Pick a random object” or “Pick all objects” are present as a condition as well as an action.

You can also move the condition/action by drag-and-dropping it from the current event to the desired event. While drag-and-dropping, the new position of the condition/action will be denoted using a black bar in the events editor.

Search/Replace in the event editor

Sometimes, searching for an event in the event sheet can be cumbersome. For this, you can use the search feature. To search within the event sheet, you can either click on the “Search in events” button or press Ctrl + F.

To search for a keyword, enter the keyword in the search bar at the bottom of the window and click on “Search”.

You will see the total number of matches at the bottom of the bar. To switch between the results, use the arrow keys beside the number of results.

If you want the search to be case sensitive, untick the “Case insensitive” option.

You can also filter the search results to either search only within actions or conditions or both.

To replace the instances of a text with another text, enter the text to be replaced in the “Text to search” field and in the “Text to replace” field, enter the new text. Clicking on the “Replace” button will replace all the instances of the text in the search field.