Events
Events define when a Behavior Asset is allowed to react. Every Behavior Asset is configured with a specific event, and that event becomes the trigger that starts the behavior evaluation flow.
Without an event, a Behavior Asset has no entry point into the system.
For a broader explanation of the overall behavior flow, see Overview.
How Events Work
When the selected event occurs, the J2 Behavior Subsystem forwards that trigger into the Behavior System. From there, the relevant Behavior Asset is evaluated.
This means that an event does not directly execute the final behavior by itself. Instead, it starts the process that may eventually lead to rules being checked, operators being evaluated, and actions being triggered.
The event defines the trigger point. The rest of the system defines what happens next.
Event Scope
Events are part of the Behavior System and are used by Behavior Assets referenced from the structured TagSet hierarchy.
Because Behavior Assets can be assigned to:
TagSets
Groups
TagSet Tags
the selected event can become relevant at multiple levels, depending on where the Behavior Asset is referenced.
This allows the same type of event to drive behavior at different levels of the managed tag structure.
Available Events
The following events are currently available:
Event | Description |
|---|---|
| Triggered when a tag is added |
| Triggered when a tag is removed |
| Triggered when a tag is renamed |
| Triggered when an actor is added to the level |
| Triggered when an actor is removed from the level |
| Triggered when an actor is renamed |
| Triggered when the actor class changes |
| Triggered when a component is added to an actor |
| Triggered when an asset is opened |
| Triggered when an asset is saved |
Choosing the Right Event
The selected event should match the kind of automation the Behavior Asset is meant to perform.
For example:
On Tag Added is useful when logic should react to new tag assignments
On Tag Removed is useful when automation should respond to tag cleanup or removal
On Asset Saved is useful when validation or processing should happen during saving
On Actor Added to Level is useful when logic should react to newly placed actors
On Component Added to Actor is useful when automation depends on actor composition changes
The event should be chosen based on the earliest meaningful point at which the behavior should begin.
Events and Execution Context
An event alone is not enough to guarantee execution. A Behavior Asset also defines the context in which it is allowed to run.
A Behavior Asset can be configured for:
the Editor
Runtime
or Both
This means that even if an event occurs, the Behavior Asset may still not run if the current environment does not match its configured context.
Events in the Full Execution Flow
Events are the first step in the Behavior System, but they are only one part of the full process.
A typical flow looks like this:
An event occurs
The J2 Behavior Subsystem forwards the event
the Behavior Asset checks whether it is enabled and allowed to run
rules are evaluated
operators process the rule results
actions may be triggered
To understand what happens after the event, continue with: