Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gdevelop5:events [2020/12/19 23:15]
yu-tang [TimeDelta] 1800->18000
gdevelop5:events [2022/01/18 03:26] (current)
raineater
Line 1: Line 1:
 # Events # Events
  
-In GDevelop, _events_ define the logic of a game. You can use events to create cause and effect. For example, an event might detect when the player has collided with a collectible item and, as a result, increment the player's score. You can create and manage events via the [[gdevelop5:interface:events-editor|Events editor]].+In GDevelop, **events** define the logic of a game. You can use events to create cause and effect. For example, an event might detect when the player has collided with a collectable item and, as a result, increment the player's score. You can create and manage events via the [[gdevelop5:interface:events-editor|Events editor]].
  
 {{ :gdevelop5:event-screenshot.png?nolink |}} {{ :gdevelop5:event-screenshot.png?nolink |}}
  
 <note>You don't have to be familiar with programming to create events. If you are familiar with programming though, some of the concepts will feel familiar.</note> <note>You don't have to be familiar with programming to create events. If you are familiar with programming though, some of the concepts will feel familiar.</note>
 +
 +{{ youtube>rBZ3kuvr9G0?medium }}
  
 ## List of event types ## List of event types
Line 21: Line 23:
 Refer to the linked pages to learn more about each type of event. Refer to the linked pages to learn more about each type of event.
  
-<note>The most commonly used types of events are _Standard events_.</note>+<note>The most commonly used types of events are **[[https://wiki.gdevelop.io/gdevelop5/events/standard|Standard events]]**.</note>
  
 ## Conditions and actions ## Conditions and actions
  
-Events are made up of _conditions_ and _actions_.+Events are made up of **conditions** and **actions**.
  
-Conditions are what cause something to happen. Some examples of conditions include the player colliding with another object or a variable equalling a certain value. If an event doesn'have a condition, the associated actions run in every frame of the game.+**Conditions** are used to trigger when an action should happen and also select which objects or instances of an object are affected by the **actions** of the event. For instance, a **condition** can check when the player is colliding with another object.  In this case, the **actions** in the event will only take place when the objects are touching each other and they will only affect the objects that are colliding. 
 +  
 + <note>If an event does not have any **conditions**, the associated actions will run every frame of the game (usually 60 times per second).</note>
  
-Actions are the things that happen when a condition is true. Some examples of actions include deleting an object or incrementing the value of a variable. Without actions, events don't do anything.+**Actions** are the things that happen when all **conditions** are true. Some examples of **actions** include deleting an object or incrementing the value of a variable. Without **actions**, events don't do anything.
  
-Events can have multiple conditions and multiple actions. For example, an event might have a condition that checks if the player is jumping _and_ is colliding with an enemy objectand an action that deletes the enemy object _and_ increments the player's score.+**Events** can have multiple **conditions** and multiple actions. For example, an **event** might have a **condition** that checks if the player is jumping and is colliding with an enemy object and an action that deletes the enemy object and increments the player's score.
  
-<note>You can use events to create custom conditions, actions, and [[gdevelop5:all-features:expressions|expressions]]. For more information, refer to [[gdevelop5:events:functions|Functions]].</note>+<note>You can use events to create custom **conditions****actions**, and **[[gdevelop5:all-features:expressions|expressions]]**. For more information, refer to **[[gdevelop5:events:functions|Functions]]**.</note>
  
 ## Execution order ## Execution order
  
-Events run in the order they're definedThis can have a significant effect on what happens when an event is executed.+Events run in the order they are listed from top to bottomThe order of events can have a significant effect on what happens when an event is executed
 + 
 +If an event is causing an unintended side-effect, verify that events listed higher in the event sheet aren't impacting events defined later in the frame.
  
-For example, the following events create a "Square" object and then immediately deletes the object:+## Object Picking
  
-{{ :gdevelop5:tutorials:delete-square.png?nolink |}}+When an event or condition which refers to objects is executed, it will have to make a decision about which objects are selected. This process is called [[gdevelop5:events:object-picking|]]. 
  
-As a result, the "Squareobject is never displayed displayed on the screen.+The essential idea is that an action or condition willby default, apply to all instances of the object in the scene. Conditions (as well as certain actions) can then be used to "filter(or "pick") which objects the next actions or condition will apply to.
  
-If an event is causing an unintended side-effectverify that events defined earlier in the frame aren't impacting events defined later in the frame.+<note>Object pickingwhen not understood, can become a source of confusion. Make sure to read the [[gdevelop5:events:object-picking|page on it]] for a full understanding of the topic!</note>
  
 ## TimeDelta ## TimeDelta
Line 73: Line 79:
 ## Creating an event ## Creating an event
  
-1. Open the **Events** editor.+1. Open the **Event Sheet**.
 2. Select the **Choose and add an event** icon. 2. Select the **Choose and add an event** icon.
 3. Select the type of event. 3. Select the type of event.
Line 83: Line 89:
 ## Adding conditions to an event ## Adding conditions to an event
  
-1. Open the **Events** editor.+1. Open the **Events Editor**.
 2. Find an existing event or create a new one. 2. Find an existing event or create a new one.
 3. Select **Add condition**. 3. Select **Add condition**.
Line 91: Line 97:
 ## Adding actions to an event ## Adding actions to an event
  
-1. Open the **Events** editor.+1. Open the **Events Editor**.
 2. Find an existing event or create a new one. 2. Find an existing event or create a new one.
 3. Select **Add action**. 3. Select **Add action**.
Line 100: Line 106:
  
 - The conditions of the parent event are true. - The conditions of the parent event are true.
-- The actions of the parent event have finished running.+- The actions of the parent event have been processed.
  
 To add a sub-event to an event: To add a sub-event to an event: