Game Creator
  • Welcome to Game Creator!
  • Quickstart
    • Get Started
    • Setup
    • Tutorials
  • Game Creator
    • Game Creator
      • Actions
      • Conditions
      • Triggers
      • Hotspots
      • Characters
        • Player
        • Markers
        • Gestures
        • States
        • Advanced
          • IK in custom Animations
      • Camera
        • Camera Motors
      • Variables
        • Global Variables
        • Local Variables
        • List Variables
    • Systems
      • Localization
      • Event System
      • Timeline
      • UI
      • Module Manager
      • Game Creator Toolbar
      • Pool System
      • Game Creator API
        • Custom Actions
        • Custom Conditions
        • Custom Triggers
        • Custom Hooks
        • Custom Save & Load
        • Variables Access
        • Custom Module
  • Dialogue
    • Dialogue
      • Anatomy
      • Actors
      • Dialogue UI
      • API
  • Inventory
    • Inventory
      • Inventory Window
        • Catalogue
        • Recipes
        • Types
        • Settings
      • Merchants
      • Containers
      • Loot Tables
      • Equip Items
      • Actions
      • Conditions
      • Custom Inventory UI
  • Quests
    • Quests
      • Quests Overview
      • Create Quests
      • Quests UI
        • Custom UI
  • Stats
    • Stats
      • Stats Overview
        • Stat
        • Attributes
        • Status Effects
        • Formulas
        • Stat Modifiers
      • Stats UI
      • Common Use Cases
        • Simple Health Bar
        • Regenerative Mana
        • Poison Status Effect
        • Levels and XP
        • Strength and Armor
        • Lockpicking
  • Behavior
    • Behavior
      • Behavior Graph
        • Nodes
        • Blackboard
      • Perception
  • Shooter
    • Shooter
      • Weapons
      • Ammunition
      • Interaction
      • Examples
        • Example 1 - Get Started
        • Example 2 - Pick Weapons
        • Example 3 - Top Down
        • Example 4 - Side Scroll
        • Example 5 - First Person
        • Example 6 - Combat
      • Advanced
        • Custom Crosshairs
        • Shooter API
  • Melee
    • Melee
      • Weapons
        • Blade Component
      • Shields
      • Melee Clips
      • Combat
  • Traversal
    • Traversal
      • Obstacles
      • Climbables
      • Built-in Elements
  • Annex
    • Roadmap
    • FAQ
Powered by GitBook
On this page
  • Event System 101
  • Dispatch an Event
  • Receive an Event

Was this helpful?

  1. Game Creator
  2. Systems

Event System

Dispatch "MyEvent" - Receive "MyEvent"

PreviousLocalizationNextTimeline

Last updated 6 years ago

Was this helpful?

Since version 0.9.1 Game Creator comes with a fully fledge Event System that is built on top of Triggers and Actions for maximum flexibility.

Event System 101

When a game object (yellow) wants to communicate a state change to other game objects (blue ones) it normally has to iterate over all these objects and notify them one by one about the change.

This is okay for small scale and non-dynamic systems, but it can quickly become a mess. An Event System flips the system upside down, making objects subscribe to a proxy that observes the object with the state change, and communicates it when the change happens.

By doing so we translate the responsibility of keeping a list of objects that need to be notified from the yellow object to each individual blue object.

Dispatch an Event

To dispatch an Event all that is needed is to call the Dispatch Event Action. This Action needs a string field which is the name of the event.

The name of the Event dispatched can be whatever the developer wants.

Receive an Event

An object can listen to events dispatched using the On Receive Event Trigger. This Trigger will be called every time an event with a specific name is raised.

Optionally, the invoker of this event can be saved in a Variable to lately reference the caller from within an Action or a Condition.

(A Dispatch Event Action using "my-event" as the name of the Event)
(Trigger set to detect when a "my-event" Event is dispatched)