> 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-crafting/install.md).

# Installation

Install CAS Crafting on VORP or RSG: the folder, server.cfg order, the VORP item SQL, the admin ace, item pictures and how ammunition works per framework.

1. Put the `cas-crafting` folder in your resources.
2. Make sure `oxmysql` and your framework start before it.
3. Turn off the crafting script it replaces, so two scripts do not make the same items:
   * VORP: `vorp_crafting`
   * RSG: `rsg-crafting` (and any other crafting or campfire script)
4. Add it to your `server.cfg` after your framework:

   ```
   ensure cas-crafting
   ```
5. VORP only: run `install/items_vorp.sql` once. It adds the script's items under the game's own item names (`consumable_potent_tonic`, `provision_game_meat`, `kit_camp` and the rest), with the game's label, description and satchel stack as the limit. Items you already have are left as they are. On RSG the script adds its items to rsg-core by itself.

   The forge uses more coal, scrap metal and gold nuggets than the game lets you carry (coal 1, scrap metal 5, gold nuggets 5, while a gold bar takes 10), so the file gives them 20, 20 and 30. If your server already has these items, raise their limits yourself:

   ```sql
   UPDATE `items` SET `limit` = 20 WHERE `item` IN ('provision_coal', 'provision_scrap_metal');
   UPDATE `items` SET `limit` = 30 WHERE `item` = 'provision_gold_nugget';
   ```
6. Admins (optional):

   ```
   add_ace group.admin cas.crafting allow
   ```
7. Restart the server (vorp\_inventory reads its item list when it starts).

The work stations (see [Work stations](/script-documentation/cas-crafting/stations.md)) add their own items to the same SQL and to rsg-core: scrap metal, coal, gold nuggets and ingots, cigarettes, and two CAS items, `leather` (the forge's knife grips) and `horseshoe`. The forge's weapons are not items on VORP (it makes them with `createWeapon`, from VORP's own weapon list); on RSG they are rsg-core's own weapon items, which the script never adds.

Item pictures: the script ships the game's own engraving of every item it makes in `html/icons/` (named by item). Copy the ones your inventory lacks (`leather.png`, `horseshoe.png`) into `vorp_inventory/html/img/items/` or `rsg-inventory/html/images/`.

The script makes its one table (`cas_crafting_known`, the recipes each character learned) on the first start.

## Item names

The script uses the game's item keys in lower case. If your server already uses other names for the same things (for example `Wild_Mint` instead of `consumable_herb_wild_mint`), give your players the game's items, or rename them in `config/catalog.lua` (search and replace the name).

## Ammunition

* VORP: the script reads and fills the gunbelt (`getUserAmmo`, `addBullets`). vorp\_inventory has no export that takes rounds off the belt, so for a craft that uses rounds the script rebuilds the belt (`removeAllUserAmmo`, then `addBullets` with everything but the rounds used). Loaded guns are unloaded by it; their rounds go on the belt.
* RSG: rounds are items, one item per round. The names default to the game's ammo type in lower case (`ammo_revolver_split_point`); map them to yours in `Config.Ammo.items`.
