Events and Listeners

The other two options on the left hand side of the screen are Events and Listeners. These allow you to make specific things happen in response to in-game events.

To help explain how to use Architect's event system, this guide will use the simple example of a lever that opens a door when pulled.

Event Broadcasters

To create an event setup, you need to start with an Event Broadcaster on the object you want to detect an event on.

First, select the object that will detect an event (in this example we'll be using a lever), and click the "Events" button on the left hand side of the UI.

You'll see a row of options like this:

Event broadcasters have 2 options - the event and the message name.

The event is the action that will trigger the message being broadcast, (e.g. "OnPull"). To cycle through events, click the button containing the name of the event.

The message name is what the receiver will pick up on later. This can be any piece of text - try to pick something simple and easy to remember.

If you forget what you set the message as later, you can use the Pick tool to check the events on the object.

After entering a valid message name, the Add button will light up, and you can click it to add the broadcaster to the object. You can click the Remove button if you want to remove the broadcaster later.

And that's the event set up! Make sure to place the object in the level after setting up your broadcasters.

Now we need to set up a door that opens when it receives the "Lever1" message that this lever broadcasts.

Listeners

Now that the broadcaster is set up, we need a listener to do something in response.

Choose the object you want to apply the listener on (we're using a gate for this example), and click the "Listeners" button.

You'll see a set of options like this:

Listeners have 3 options - the message name, the action that will be triggered, and the number of times the message should be received before the action is triggered.

Set the name to the one you set on the broadcaster ("Lever1" in this example), and cycle through the triggers to find the right one in the same way as the events.

Since we're making a single lever open a door here we'll leave the "Times" option as 1, but if you wanted to make something like an arena where the gate only opens after killing all enemies, you could set this to the number of enemies, and have each one broadcast the same message upon being killed.

After entering a valid name, the "Add" button will light up, and you can add the listener to the object in the same way as the broadcaster.

Place the object in the game and the setup is complete!

You can now exit editor mode and test your event setup. If you followed the example shown here, you should see the gate open when you pull the lever.

Useful Information

  • All objects have "Enable" and "Disable" triggers, that will make the object active or inactive.

    • If you set the "Active" configuration option to false you can use the "Enable" trigger later to activate the object.

  • Levers have 3 events - OnPull, FirstPull and LoadedPulled

    • OnPull is called when the lever is pulled, and when the room loads with the lever already pulled. This is useful for if you want a gate to stay open forever after pulling the lever.

    • FirstPull is called when the lever is pulled, but not when the room loads with it pulled.

    • LoadedPulled is only called when the room loads with the lever pulled.

  • Enemies have a similar set of events, OnDeath, FirstDeath and LoadedDead

  • Many objects in the Utilities category have events tied to them, such as the Trigger Zone. Information about these events is included in the object's description.

An example of an object's description

Further Support

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

Last updated