Every logic event and chain must have an Event Trigger to set it off. Different logic events can be triggered via different event triggers.
Finding the logic page[]
- Click on the tool icon on the editor menu, and then click an object with it.
- Click the "Logic" page on the top right of the object menu.
- Click "+ Add Event Trigger"
Event Triggers[]
Different objects have different default event triggers, but the most common ones are listed as follows:
On Level Start[]
When the level starts, the logic events below will be triggered.
On Activate[]
When the object is currently deactivated, activate it will trigger the logic events below "On Activate".
On Deactivate[]
When the object is currently activated, deactivate it will trigger the logic events below "On Deactivate".
On Variable[]
When the value of a variable fits the "On Variable" 's setting, the logic events below this trigger event will be triggered.
Global mode variables won't trigger Local mode trigger events and vice versa.
Special Event Triggers[]
As well as the four common ones, there are other event triggers for different uses.
On Death[]
Only for anything that dies, especially the NPCs.
When NPC dies, the following events will start running.
Example: Knight.
On Ignite[]
Only for anything that can be set on fire.
When the object is lit, the following events will start running.
Exmple: Cottage.
On Destroy[]
Only for anything that can be destroyed.
When the object is destroyed, the following events will start running.
On Explode[]
Only for anything that can explode or be destroyed by an explosion, including sheep and chickens.
Example: Bomb.
On Enter & On Exit[]
Only for triggers and Insignias, when the set target(s) enters, the following events will start running.
Here's how to select the target:
There can be multiple ways of choosing the targets: