> For the complete documentation index, see [llms.txt](https://luffyyy.gitbook.io/beardlib/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://luffyyy.gitbook.io/beardlib/modules/interactionsmodule.md).

# Interactions

Updated for version 3.38.

## Module Definition

The module is inherited from [ItemModuleBase](https://luffyyy.gitbook.io/beardlib/modules/modulebase#itemmodulebase). So base parameters can be found there.

This modules allows you to add custom interactions to be used by custom maps for example.

### Module name

The name of the module you use as the meta of the module definition is 'HeistMusic' or 'HeistMusicModule' if `_force_search` is set to true in the module definition.

If you're writing them in level modules the name of the module is 'interactions'.

### XML Structure

```markup
<Interactions>
    <interaction id interact_distance/>
</Interactions>
```

#### `<interaction ...>`

| Parameter          | Type   | Description                                                                                                                 |
| ------------------ | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| id                 | String | The ID of the interaction. This has to be unique                                                                            |
| interact\_distance | Number | The distance (in centimeters?) the interaction can be interacted from. For example for buttons you'd use something like 100 |

**Additional parameters**

| Parameter               | Type    | Description                                                                                                          |
| ----------------------- | ------- | -------------------------------------------------------------------------------------------------------------------- |
| based\_on               | String  | Base your interaction on already existing ineraction data                                                            |
| text\_id                | String  | Optional text localization id defaults to hud\_+`id`                                                                 |
| special\_equipment      | String  | Optional ID of some pickup/special equipment that you need to have in order to interact                              |
| equipment\_consume      | Boolean | Should the equipment be "consumed" after interaction? Like imagine some key that can only be used once               |
| equipment\_text\_id     | String  | Optional text localization id of the equipment that is needed. This will need to be localized if it isn't already    |
| sound\_start            | String  | Optional sound ID of the sound that should play when starting interaction                                            |
| sound\_interupt         | String  | Optional sound ID of the sound that should play when the interaction is interrupted                                  |
| sound\_done             | String  | Optional sound ID of the sound that should play when the interaction is done                                         |
| required\_deployable    | String  | Like `special_equipment` but requires a deployable instead                                                           |
| deployable\_consume     | Boolean | Like `equipment_consume` but for deployables                                                                         |
| requires\_upgrade       | Table   | Table that looks like this . Checks for required perks/skills                                                        |
| force\_update\_position | Boolean | Determines if the interaction should constantly check for position to update. Useful if the interaction moves around |

And any other interaction tweakdata value. There are more that are not listed here yet.

### Example

This example is what you would put inside your main node within your [mod config](https://github.com/GreatBigBushyBeard/PAYDAY-2-BeardLib/wiki/Module-Config)

```markup
<Interactions>
    <interaction id="my_interaction"/>
</Interactions>
```

This will add the interaction `my_interaction`. You will still need to localize the name of the track. In this case `hud_my_interaction` will need to be localized ([LocalizationModule](https://luffyyy.gitbook.io/beardlib/modules/localizationmodule)).

### Functions

| Function                                  | Description                                                                                                                                                 |
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AddInteractionsDataToTweak(Table i\_self) | Inserts the interaction data to the tweak\_data. Called by the PostHook inside RegisterHook or by RegisterHook itself if interaction tweakdata is available |


---

# 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, and the optional `goal` query parameter:

```
GET https://luffyyy.gitbook.io/beardlib/modules/interactionsmodule.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
