Events and Listeners

The other two buttons on the left hand side are for the Events and Listeners on the object. These allow you to make specific actions happen as a result of things in-game.

For example, you could make a lever you need to pull or a set of enemies you need to kill in order to open a gate to enter the next room.

Event Broadcasters

To create a set of actions like this, you first need to set up an Event Broadcaster.

Start by clicking the Events button on the object you want to trigger something else (for example, if you want a lever to open a gate, select the lever then choose "Events")

First you need to choose the Event Type - you can see a list of event types for each object here.

This example will use the "OnPull" event for a lever - the event that is broadcast when the lever is pulled - to make the lever open a gate.

Next, you need to specify a Name for the event - this is what your Listener will 'receive' later. This can be any piece of text, so it's recommended you name it something descriptive but not too long.

Finally, click the + button to add the event to your object, then place it down. You can use the - button to remove an event if you made a mistake.

Just like configuration options, make sure to set up all events on your objects before you place them down.

Listener Actions

Once your broadcaster is set up, you need to create the object that will receive the event, and do something as a result.

First, select the object you want to attach a listener to, then select the "Listeners" tab on the right hand side. Continuing with the example of a lever that opens a gate, we'll use a gate that receives our broadcast and then opens.

Set the "Name" to the same name you specified in the broadcaster (in this example that was "Door1"), then set "Trigger" to the action you want the object to do.

For this example the action is "open", but you can see a full list of actions here.

You can also change the "Times" option to a different number, which will require the event to be broadcast a set number of times in order to perform the specified action.

This is good for arenas where you want the player to defeat more than just one enemy, or if you want to make a level that requires multiple levers being pulled in order to proceed.

Once your listener is ready, you can once again press the + button to add it to your object, then place down the object wherever you want it.

Event Types

Levers:

  • OnPull - When you pull the lever

  • LoadedPulled - Room loaded and the lever was already pulled

    • When using OnPull to open a gate, you should generally use LoadedPulled to broadcast another event to disable that gate if the lever has already been pulled, or else the gate will be closed next time you enter the room.

Enemies:

  • OnDeath - When the enemy dies

  • LoadedDead - Room loaded and the enemy was already dead

    • Just like with LoadedPulled, you should use this event to deactivate a gate if you want to open one when running OnDeath.

Trigger Zones:

  • ZoneEnter - When the player enters the zone

  • ZoneExit - When the player leaves the zone

    • If you're using a trigger zone for things like arenas, make sure to disable them once they've been triggered, or else you'll encounter issues with them calling the event again when the arena has already begun.

Bindings:

  • OnBind - When the binding is activated by the player touching it

  • OnUnbind - When the binding is deactivated by the player touching it

Action Types

General:

  • Enable - Enables the object (makes it appear if it is disabled)

  • Disable - Disables the object (makes it disappear if it is enabled)

Gates:

  • Open - Opens the gate

Battle Gate:

  • Close - Closes the gate

Enemies:

  • Die - Kills the enemy

Teleport Point:

  • Teleport - Teleports the player to this point

Hazard Respawn Point:

  • SetSpawn - Sets the player's Hazard Respawn Point to this object

Further Support

If you are unsure about anything, you can ask for help in the Starshooter discord server.

Last updated