> 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-weapon-studio/cas-weapon-studio.md).

# CAS Weapon Studio

CAS Weapon Studio for RedM. Staff design weapon skins in game for every weapon of the game, put custom guns together and sell both at the gunsmiths. VORP, RSG or standalone.

CAS Weapon Studio is an in-game weapon skin studio for RedM. Staff design skins for every weapon model of the game (73: firearms, bows, knives, hatchets, machetes and throwing weapons), the server builds each skin into real game files, and players buy them at the gunsmiths.

Staff open the studio with `/weaponstudio`, pick a weapon and build its skin in layers: base colour, patterns, lettering, emblems, pictures, paint, a ready look or AI Design. Export builds the files inside the resource. The skin is live after the next server restart.

Players open the skin book with `/weaponskins`. At a gunsmith they buy skins and custom guns, try a skin on the weapon in their hand before they pay, and put it on. A skin sits on every weapon of that model the character carries. With CAS Gunsmith on the server, the skins are also at the gunsmith bench, in its own Skins tab.

{% hint style="info" %}
New weapon models are not possible on RedM. A custom gun is always one of the game's own weapons with its own name, skin and damage tune.
{% endhint %}

## Highlights

* **Design in game.** A 3D preview of the real weapon next to its texture sheet. The sheet shows the gun four times: Left side, Right side, Top and Bottom. See [Designing skins](/script-documentation/cas-weapon-studio/designing.md).
* **Every weapon of the game: 73 models.** 13 revolvers, 5 pistols, 4 repeaters, 6 rifles, 5 shotguns, 3 bows, 18 knives, 7 hatchets, 3 machetes, 2 other melee weapons and 7 throwing weapons.
* **Layers.** Base colour, Pattern, Lettering, Emblem, Picture and Paint. A layer can cover the Whole gun, only the Metal or only the Wood.
* **12 ready looks.** Gold Engraved, Nickel and Pearl, Blued Scroll, Case Hardened, Damascus, Lawman, Outlaw, Rattlesnake, Frontier, Cavalry, Royal, Bone and Brass. One click builds the layers; you can change them after.
* **AI Design** with your own key (fal, Google or OpenAI). It is optional.
* **Real game files.** Export writes the skin into one of 60 slots inside the resource. No CodeWalker, no OpenIV, no outside tools.
* **Finishes for metal and wood.** The metal parts and the wood parts of a skin each get their own finish: Painted, Blued, Brushed or Polished metal; Matte, Oiled or Lacquered wood. Gold shines like metal while an ivory grip stays ivory.
* **Hand out three ways.** Sold at the gunsmiths of the towns you pick, free for a job from a grade, or given to chosen players. See [Exporting and handing out](/script-documentation/cas-weapon-studio/exporting.md).
* **Custom weapons.** A base weapon, one of its skins, a damage tune, a name and a price, sold in an open run or a numbered limited run. See [Custom weapons](/script-documentation/cas-weapon-studio/custom-weapons.md).
* **The skin book.** Players buy, try on, put on and take off skins. See [The skin book](/script-documentation/cas-weapon-studio/skin-book.md).
* **Kill notches.** Kills cut tally marks into the grip or stock, up to 30. See [Kill notches](/script-documentation/cas-weapon-studio/kill-notches.md).
* **8 languages.** English, Turkish, German, French, Spanish, Portuguese (Brazil), Russian, Polish. See [Languages](/script-documentation/cas-weapon-studio/languages.md).

## At a glance

|                        |                                                                                     |
| ---------------------- | ----------------------------------------------------------------------------------- |
| Version                | 1.0.0                                                                               |
| Frameworks             | VORP Core, RSG Core or standalone                                                   |
| Needs                  | oxmysql                                                                             |
| Weapons                | 73 weapon models: firearms, bows, knives, hatchets, machetes, throwing weapons      |
| Texture sheet          | 1024 x 1024 for short arms, 2048 x 1024 for long arms                               |
| Skins live at once     | 60 (the skin slots)                                                                 |
| Skins per player       | One skin per weapon model and character                                             |
| Finishes               | Metal parts: Painted, Blued, Brushed, Polished. Wood parts: Matte, Oiled, Lacquered |
| Kill notches           | Up to 30 per weapon model and character                                             |
| Custom gun damage      | 75 % to 125 % of the game's own by default                                          |
| AI Design              | Optional, your own key: fal, Google or OpenAI                                       |
| Staff command          | `/weaponstudio`                                                                     |
| Player command         | `/weaponskins`                                                                      |
| Download per live skin | About 0.3 to 0.9 MB for each player                                                 |
| Database               | 8 tables, made on the first start                                                   |
| Tools needed           | None                                                                                |

{% hint style="warning" %}
After an export, restart the server. Do not restart only this resource while players are online: streamed files that change under a running game can crash clients.
{% endhint %}

## What is verified in game

Verified in game on a VORP test server:

* A skin sits exactly on the weapon in the hand, while aiming and slung on the back. Hammer and cylinder follow the weapon's moving parts.
* A weapon the game hides (holstered with no gun belt) hides its skin too.
* The built files load: the Cattleman Revolver (short arm sheet) and the Lancaster Repeater (long arm sheet) show the whole sheet in the right place.

Code only, not verified in game yet:

* Another player seeing your skin (it needs a second client).
* Kill notches and the skin book's showcase camera.
* Gunsmith parts that hang on a moving part, such as a pump-action forend: the skin on them stays still while the part moves during a reload.
* Handing a bought custom gun over on RSG and on standalone servers.

Try a skin on each weapon you plan to sell on a test server first.

## Where to start

| Page                                                                              | What it covers                                                         |
| --------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| [Installation](/script-documentation/cas-weapon-studio/installation.md)           | Requirements, `server.cfg`, permissions, the database, the first start |
| [Configuration](/script-documentation/cas-weapon-studio/configuration.md)         | Every `Config` key with its default                                    |
| [Designing skins](/script-documentation/cas-weapon-studio/designing.md)           | The studio: weapons, the sheet, layers, looks, AI Design, saving       |
| [Exporting and handing out](/script-documentation/cas-weapon-studio/exporting.md) | Finishes, slots, gunsmith towns, jobs, players, updating a live skin   |
| [Custom weapons](/script-documentation/cas-weapon-studio/custom-weapons.md)       | What a custom gun is, the form, limited runs, what the buyer gets      |
| [The skin book](/script-documentation/cas-weapon-studio/skin-book.md)             | How players buy, try on and wear skins                                 |
| [Kill notches](/script-documentation/cas-weapon-studio/kill-notches.md)           | How kills are counted and shown                                        |
| [Languages](/script-documentation/cas-weapon-studio/languages.md)                 | The shipped languages and how to add your own                          |
| [Commands](/script-documentation/cas-weapon-studio/commands.md)                   | Staff, player, test and console commands                               |
| [For developers](/script-documentation/cas-weapon-studio/developers.md)           | The `wsSkins` state bag and the database tables                        |
| [Troubleshooting](/script-documentation/cas-weapon-studio/troubleshooting.md)     | Restarts, slots, uncovered parts, AI, the database                     |
| [Changelog](/script-documentation/cas-weapon-studio/changelog.md)                 | The release history                                                    |
