1: Getting Started
2: Building Logic
5: Game Mechanics
6: Advanced Topics
7: Testing & Tuning
8: The Last 10%
M1: Mobile - Intro
M2: Mobile - Basics
M3: Mobile - Services
M4: Mobile - Publishing
B: How-To Guides
3.0 Drafts (In Progress)
Note: In past versions, Custom Events were known as "Messaging." We changed the name to make its intent clearer and easier to undestand. Functionality-wise, nothing has changed.
What are Custom Events?
Custom Events are special kinds of events that happen only when you tell them to happen.
Why would you want to do this?
Aside: In programming terms, Custom Events are equivalent to the concept of "messaging" or "indirect invocation" - they aren't quite the same as function calls since you aren't always specifying a receiver. There can be as few as 0 receivers or infinitely many.
Defining Custom Events
1) Inside the Behavior Designer, go to Add Event > Advanced > Custom Event
2) Type something into the blank. This is the text that will cause this Custom Event to trigger.
That's it! Now fill out what you want to happen inside the event.
Triggering Custom Events
Custom Events are triggered by any one of the blocks under Behavior > Triggers. The act of telling a Custom Event to happen is called triggering.
To trigger an event, put in the text you stuck into the blank when defining the event.
That's all there is to triggering Custom Events.
You might be curious about what the difference is between the "all behaviors" vs. "(one) behavior" variants though...
One Recipient vs. All
As you have may noticed, triggering Custom Events can be done directly (one behavior) or indirectly (all behaviors). This to say:
Note: If a behavior doesn't have a Custom Event, and you try to trigger it, nothing happens. It's safely ignored.