Skip to main content

Actions

Actions are a crucial part of how All On Board! handles the hundreds of interactions games have. Through Smart Glance or the press of a button, you can execute actions that implement custom logic to automate any aspect of your game.

Some Blueprint Classes have actions already setup, but you can change them, remove them, or add your own on top of the existing ones.

This guide covers how to create a basic action, and how to set it as a Quick Action. We will make an action that destroys the game element that called it as an example.

Step 1 - Creating the Action​

Create a Blueprint of class “ActionBase” and give it a descriptive name.

Create an ActionBase Blueprint

Then, click on the Override dropdown and select to override the BP Start Action function. By doing so, a new event is created on the Event Graph, which will be where we insert the logic of the action.

Override the BP Start Action function

The class ActionBase contains a variable called “Target Game Element”, which holds a reference to the instigator of the action.

For this example, we will reference it to find out which Game Element ID is assigned to the instigator and then use the Factory Subsystem to destroy it.

Use the Factory Subsystem to destroy the element

Step 2 - Add the action to the Game Element​

Open the Game Element Blueprint that you want to execute the action and add an Actions Component.

Add an Actions Component to the Game Element

Then, head to the inspector and add a new entry on the list “Actions”. There, look for “Action Class Field” and select the one you created.

Select the Action Class in the Actions list

Additionally, you can give it a proper name by changing the parameter “Action Name Field”.

Set the Action Name Field


With these two steps, the action is already set up and can be triggered through Smart Glance.

Making it a Quick Action​

In case you want the action to be triggerable without using Smart Glance, you can do so by setting it as a Quick Action.

To do so, set the parameter “Quick Action” to true.

Set the Quick Action parameter to true

Add a new component called “ActivableBase”. This component lets you trigger an event when the button you set up is pressed or released. For making use of the Quick Action button, set the parameter “Activable Type” to “Tertiary”.

Add an ActivableBase component set to Tertiary

On the same Details window, look for the event “On Activate Delegate” and press the button next to it. This will create an event on the Event Graph, which is where we will call the Quick Action.

Create the On Activate Delegate event

Connect to the event the following logic:

  • A branch that checks if the event is being executed on the server, which is not mandatory but s usually recommended unless your logic must be executed locally for each player.
  • A call to the Actions Component’s function “Execute Quick Action”

Connect the Execute Quick Action logic

And with that, once the player points at the Game Element and presses the Quick Action button, the element will be destroyed for all players.