> For the complete documentation index, see [llms.txt](https://hiveminddocs.gitbook.io/hivemind/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hiveminddocs.gitbook.io/hivemind/code-systems/ultimate-building-system-framework-ubs/buildable/actions.md).

# Actions

An action is a modular system that lets you enhance your buildables by adding extra functionality, making them more dynamic and versatile. You can assign and combine multiple actions to any buildable, allowing for greater flexibility in how they behave and interact within the game world.

## Callable Functions

* **`GetOwnedGameplayTagsTags()`**\
  This allows you to get the tags which defines this Action. When you want to try and find a specific action.
* **`ExecuteAction()`**\
  This executes the logic of this action.
* **`IsActionAvailable()`**\
  This needs to return true for the action to be executed. This allows you to set up conditions for when this action can be executed.
* **`GetDisplayText()`**\
  Gets the text for this action.
* **`GetDisplayIcon()`**\
  Gets the icon for this action.

## Overridable Functions

* **`ExecuteAction()`**\
  This is where you will be putting your logic for this Action. Not overriding this will result in the action doing nothing.
* **`IsActionAvailable()`**\
  You can override this to make actions conditional. If this returns false then `GetAvailableActions()` in the Buildable won't return this action.
* **`GetDisplayIcon()`**\
  If you need more advanced behavior for getting the Action Icon, then override this.
* **`GetDisplayText()`**\
  If you need more advanced behavior for getting the action text, then override this.

***

## Example

With actions you can create interesting behavior for your buildables.

An example of this would be creating a door with multiple actions: a toggle door action, a move action, and a destroy action. In this case, we want the toggle door action to be the default, so the player can simply walk up and interact with the door to toggle its open state.

To achieve this:

1. **Add the Default Action Tag**

   * Create a Door `Buildable Definition`.
   * Add the tag `Action.Default` to the toggle action.
   * This allows the system to recognize the toggle as the default action.

   <figure><img src="/files/ljpUf0BMBptDdUGhGBVt" alt=""><figcaption><p>Buildable Definition Details Panel</p></figcaption></figure>
2. **Interact with the Door**

   * With the default action set, we can easily find and execute this action by doing a short interaction on the door itself.
   * We do this by opening the BP\_Openable class, in here we set the short interaction to query for the default action.

   <figure><img src="/files/K554I3dv6JNiZWmdKSGu" alt=""><figcaption><p>BP_Openable Buildable Example Actor <br>(TODO: Update image when Execute Action has been upated with new input parameters)</p></figcaption></figure>

{% hint style="info" %}
NOTE: You don't have to use the `Action.Default` tag—it can be any tag assigned to the action as long as you've assigned it to the aciton you're querying for. The `Action.Default` tag is just a generic way to mark an action as the default, so you don't need to update your code elsewhere to accommodate default actions.
{% endhint %}

1. **Access the Radial Menu**

   * The player can also open the radial menu through a long interact on the door and choose from the available actions, including the default toggle action.

   *!\[Image showing the radial menu with different door actions]*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hiveminddocs.gitbook.io/hivemind/code-systems/ultimate-building-system-framework-ubs/buildable/actions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
