Loading Leap…

Events

Create events — named signals that move systems forward — and fire them from operations or your game.

Events

An event is a named signal — round ended, boss defeated, chest opened. Firing an event changes nothing on its own, but any system whose current state has an exit waiting for that event takes it, as long as the exit's conditions also pass. You manage events from the Events tab of the Element Explorer on the Design tab.

Creating an Event

In a workspace, click New Event, name it in the Inspector — e.g. "Boss defeated", with the slug boss_defeated — and click Save. The fields every element shares are covered in Navigating Leap Studio. An event can't use the same slug as a custom operation; Leap explains that "both compile to an action of that name". The slugs reserved for custom operations are reserved for events too.

Who Can Fire It

New events are internal: only your design can fire them until you make them callable. Callable by game clients decides whether your game can fire the event directly:

  • Ticked — your game can fire it to move systems forward, and the Inspector shows the call, e.g. boss_defeated(). An event has no conditions of its own, so this call always succeeds — even when nothing is listening. For an action that should be able to say no, make a custom operation with conditions that fires the event, and let your game call that instead.
  • Unticked — "Internal — only other operations can fire it."

Either way, firing the event moves every system waiting for it.

Firing an Event from Your Design

Add an Event effect to any operation — in a system, a custom operation, or an achievement's or entitlement's Unlocks. The event "fires after": it fires once the operation has applied all of its other effects.

Reacting to an Event

A system reacts to an event through an exit set to be taken "on event fired" with that event: when the event fires and the player's current state has that exit, the exit is taken if its conditions pass. See Exits and Transitions.

Fired By and Listened For By

The bottom of the Inspector shows where the event is used:

  • Fired by — operations whose effects fire the event. When nothing does, it reads "Nothing fires this event yet."
  • Listened for by — states that take an exit when it fires. When nothing does, it reads "No state transition listens for this event, so firing it does nothing."

If you delete an event, Leap tells you how many effects fire it and how many state transitions listen for it before you confirm: they're left pointing at nothing, and the next merge fails until you remove them.

Next Steps

Continue to Conditions to learn the condition editor used across Leap Studio.