# Mask

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 let's you add masks.

### Module name

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

### XML Structure

```xml
<Mask id global_value unit type .../>
```

#### `<Mask ...>`

| Parameter               | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                     |
| ----------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                      | String | The ID of the material                                                                                                                                                                                                                                                                                                                                                                                          |
| type                    | String | The type of the mask. Can be helmet, beard, glasses and mask. Defaults to mask.                                                                                                                                                                                                                                                                                                                                 |
| global\_value           | String | For packs of mods, a global id assigned to all. A nice way to label your mods. You'll still have to create the global value through [GlobalValueModule](https://luffyyy.gitbook.io/beardlib/modules/globalvaluemodule)                                                                                                                                                                                          |
| unit                    | String | Optional path to the unit of the mask. Defaults to units/mods/masks/msk\_`id`/msk\_`id` You still need to add it through [AddFiles](https://luffyyy.gitbook.io/beardlib/modules/addfilesmodule) and all its dependencies such as object and material config.                                                                                                                                                    |
| offsets                 | Table  | <p>Optional table of offsets for each character. Should look something like this:<br><code>\<offsets></code><br><code>\<old\_hoxton></code><br><code>\<value\_node value="0 0 0"></code><br><code>\<value\_node value="Rotation(0,0,0)"></code><br><code>\</old\_hoxton></code><br><code>\</offsets></code><br>Each character needs position and rotation offset. First is position and second is rotation.</p> |
| name\_id                | String | Localization ID for the title of the mask (Defaults to bm\_msk\_ + `id`)                                                                                                                                                                                                                                                                                                                                        |
| desc\_id                | String | Localization ID for the description of the mask (Defaults to bm\_msk\_ + `id`)                                                                                                                                                                                                                                                                                                                                  |
| texture\_bundle\_folder | String | Optional folder to contain the icon. The path will be guis/dlcs/`texture_bundle_folder`/textures/pd2/blackmarket/icons/masks/`id`. Defaults to `mods`                                                                                                                                                                                                                                                           |
| characters              | Table  | Optional table that contains characters and the mask for them. This allows you to have a unique mask for each character (See bm\_msk\_balaclava in masks tweakdata)                                                                                                                                                                                                                                             |

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

#### The icon

The icon will be stored in guis/dlcs/mods/textures/pd2/blackmarket/icons/masks and will be named `id`.texture then add it using [AddFiles](https://luffyyy.gitbook.io/beardlib/modules/addfilesmodule).

### Example

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

```xml
<Mask id="my_cool_mask" type="helmet"/>
```

This will add the mask `my_cool_mask`. You will still need to localize the title and description of the mask. In this case `bm_msk_my_cool_mask` and `bm_msk_my_cool_mask_desc` will need to be localized using [LocalizationModule](https://luffyyy.gitbook.io/beardlib/modules/localizationmodule). And add unit, object, material\_config, textures and icon through [AddFiles](https://luffyyy.gitbook.io/beardlib/modules/addfilesmodule)

#### Template

Download template here: [here](https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/Luffyyy/BeardLib-Templates/tree/master/Mask-Template)
