> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-gunsmith/configuration/style.md).

# Style Options

CAS Gunsmith style options — metal finish, wood tone, engraving and inlay, carving, and wrap, all defined in config.lua.

Every option in the Style tab comes from lists in `config.lua`. To remove an option, delete its line. To change its price, edit `price`.

## Common fields

| Field           | Description                                                                              |
| --------------- | ---------------------------------------------------------------------------------------- |
| `id`            | Unique id within the list. Do not change it on a live server, saved presets use this id. |
| `name`          | Name shown in the interface.                                                             |
| `price`         | Price in dollars.                                                                        |
| `stock`         | If `true`, this is the factory option and it is free.                                    |
| `swatch`, `img` | Image of the option. The file name in `web/dist/tex/swatch/` without `.png`.             |
| `lock`          | Optional rank lock, `{ rank = N }`.                                                      |

## Metal finish

```lua
{ id = 'nickel', name = 'Nickel', swatch = 'metal_swatch_nickle', price = 18, index = 2 },
```

`index` is the finish's in-game material number. The game's own item database names them the same way for every part and both weapon groups:

| Index | Finish          | Index | Finish         |
| ----- | --------------- | ----- | -------------- |
| 1     | Iron            | 6     | Brass          |
| 2     | Nickel          | 7     | Gold           |
| 3     | Blued Steel     | 8     | Silver         |
| 4     | Blackened Steel | 9     | Copper         |
| 5     | Browned Steel   | 10    | Tempered Steel |

Keep `name`, `swatch` and `index` describing the same finish, or the interface will show a different colour from the one applied. `factory` is the factory finish and adds no component to the weapon.

`Config.MetalParts` sets which metal parts can be finished separately for each weapon class:

| Field    | Description                                                                                                     |
| -------- | --------------------------------------------------------------------------------------------------------------- |
| `key`    | Part id.                                                                                                        |
| `label`  | Name shown in the interface.                                                                                    |
| `factor` | The finish price is multiplied by this factor. For example, with `0.8` an $18 finish costs $14.40 on this part. |
| `slots`  | Game parts painted when this row is selected: `FRAME`, `BARREL`, `SIGHT`, `CYLINDER`, `TRIGGER`, `HAMMER`.      |

Classes are `revolver`, `pistol` and `longarm`. Rifles, repeaters and shotguns use the `longarm` rows.

## Wood tone

```lua
{ id = 'maple', name = 'Maple', swatch = 'wood_tint_swatch_maple', price = 4, tint = 'B_2' },
```

`tint` is the game tint code applied to the grip and stock. The game names them:

| Tint  | Wood          | Tint  | Wood         |
| ----- | ------------- | ----- | ------------ |
| `A_1` | Birch         | `B_1` | Mahogany     |
| `A_2` | Black Walnut  | `B_2` | Maple        |
| `A_3` | Bocote        | `B_3` | Mesquite     |
| `A_4` | Dark Rosewood | `B_4` | Myrtle       |
| `A_5` | Bubinga       | `B_5` | Rosewood     |
| `A_6` | Cocobolo      | `B_6` | Wild Cherry  |
| `A_7` | Ebony         | `B_7` | Bright Maple |
| `A_8` | Walnut        | `B_8` | Dark Walnut  |

## Engraving and inlay

`Config.Engravings` holds the engraving patterns. `index` is the in-game pattern number: 1 Baroque, 2 Art Nouveau, 3 Victorian, 4 Ornamental. The engraving is applied to the frame and barrel, and also to the cylinder on revolvers.

`Config.EngravingMetals` holds the inlay metals. `index` is the in-game material number: 1 to 10 are the metal finishes above, then 11 Yellow Enamel, 12 Blue Enamel, 13 Green Enamel and 14 Red Enamel. The inlay choice only appears while an engraving is selected.

A bought engraving pattern is saved to the weapon. The player can go back to it later on the same weapon for free.

## Carving

`Config.Carvings` holds carvings for the grip or stock. `index` is the in-game pattern number (1 to 6). The game cuts a different picture for the same number on a handgun grip and on a long gun stock, so each carving has its own `long` name and image:

```lua
{ id = 'carv1', name = 'Rattlesnake', img = 'gunsmith_carving_7', price = 14, index = 1, long = { name = 'Buck Scene', img = 'gunsmith_carving_3' } },
```

| Index | Handgun grip | Long gun stock |
| ----- | ------------ | -------------- |
| 1     | Rattlesnake  | Buck Scene     |
| 2     | Scorpion     | Wolf Scene     |
| 3     | Puma         | Eagle Scene    |
| 4     | Deer         | Ram            |
| 5     | Eagle        | Flying Eagle   |
| 6     | Buck         | Bear           |

## Wrap

```lua
{ id = 'wrap1', name = 'Wrist Wrap', price = 6, slot = 1, material = 'LEATHER', desc = 'Rawhide wound around the wrist of the stock.' },
```

| Field      | Description                                                                                                           |
| ---------- | --------------------------------------------------------------------------------------------------------------------- |
| `slot`     | Which of the weapon's own wrap components is fitted. The components are in the `wraps` list of the weapon definition. |
| `material` | `LEATHER` or `CLOTH`.                                                                                                 |
| `desc`     | Short description shown in the interface.                                                                             |

The wrap section only appears for weapons that have a `wraps` list. If a weapon has no component for a given `slot`, that wrap cannot be selected on it.

Wrap colours are built from the `WRAP_TINTS`, `WRAP_NAMES` and `WRAP_SWATCHES` lists. The order of the three lists matches: the game tint, its in-game name and the number of the `wrap_tint_swatch_<n>` picture shown for it. Choosing a colour is free.
