> For the complete documentation index, see [llms.txt](https://docs.hyper-code.eu/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hyper-code.eu/documentation/farming-system/config.md).

# Farming System – Configuration

All options of Farming System: notifications, farm zones, crafting stations, sellers, economy board, skills, EXP boosts, translations and colours.

The settings are split into five files in `shared/`. None of them is escrowed.

| File                  | Content                                                        |
| --------------------- | -------------------------------------------------------------- |
| `config.lua`          | Notifications, progress bar, image path, colours, translations |
| `farm_config.lua`     | Farm zones                                                     |
| `crafting_config.lua` | Crafting stations and recipes                                  |
| `seller_config.lua`   | Sellers, prices and economy board                              |
| `skills_config.lua`   | Skills, skill menu and EXP boosts                              |

## General

`shared/config.lua`

| Option                              | Default                                 | Description                                                                                                                             |
| ----------------------------------- | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.General.ItemPath`           | `"nui://hc_inventory/html/dist/items/"` | Folder with your item images, as `nui://<resource>/<path>/`. Change it to your inventory, for example `nui://ox_inventory/web/images/`. |
| `Config.General.MarkerDrawDistance` | `5.0`                                   | Extra distance (on top of the marker size) at which markers are drawn                                                                   |

{% hint style="warning" %}
Do not edit the `rgb()` and `rgba()` helpers at the end of `config.lua`. They are used by the other config files.
{% endhint %}

## Notifications and progress bar

```lua
Config.ShowNotification = function(source, message, title, type)
    if IsDuplicityVersion() then -- server side
        TriggerClientEvent("hc_notify:notify", source, message, title, type, 3000)
    else -- client side
        exports["hc_notify"]:notify(message, title, type, 3000)
    end
end

Config.ShowHelpNotification = function(message)
    exports["hc_notify"]:helpNotify(message, 'E', -1)
end

Config.CallProgressBar = function(source, message, duration)
    Citizen.CreateThread(function()
        exports["hc_notify"]:progressbar(message, duration)
    end)
end
```

Replace the calls with your own notification and progress bar resource if you do not use [Premium Notify](https://shop.hyper-code.eu/package/6496308). `Config.CallProgressBar` is only called on the client; `duration` is in milliseconds.

## Farm zones

`shared/farm_config.lua`

### General

| Option                                 | Default | Description                                                                                                                                  |
| -------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Farm.General.Key`              | `38`    | Control to start and stop farming (`38` = E)                                                                                                 |
| `Config.Farm.General.AutomaticFarming` | `true`  | `true`: the player keeps farming until they press the key again, leave the zone or the inventory is full. `false`: one action per key press. |
| `Config.Farm.General.ShowHelpNotify`   | `true`  | Show the help notification in a farm zone                                                                                                    |
| `Config.Farm.General.MarkerConfig`     | on      | `SpawnMarker`, `Color` (`rgba()`), `Type`, `Height` of the farm markers                                                                      |
| `Config.Farm.General.ShowProgressbar`  | `true`  | Show the progress bar while farming                                                                                                          |

### Zones

```lua
{
    Name = "Fishing",
    SkillName = "fish",
    ProgressBarText = "You are fishing ...",
    CenterCoords = vector3(1304.3112, 4254.0049, 33.9087),
    Radius = 1.0,
    GatheringTime = 10,
    ExpPerAction = 6000,
    SingleFarmingCoords = {
        vector3(1302.9850, 4248.7925, 33.9087),
        vector3(1302.3719, 4245.2461, 33.9087),
    },
    BlipConfig = { SpawnBlip = true, Sprite = 317, Color = 0, Size = 1.0 },
    Animation = {
        -- Library = "amb@world_human_stand_fishing@idle_a",
        -- Anim = "idle_c",
        Scenario = "WORLD_HUMAN_STAND_FISHING",
    },
    RequiredItem = "fishingrod",
    Items = {
        { Name = "giantseabass", Probability = 15, Min = 1, Max = 1 },
        { Name = "grouper", Probability = 20, Min = 1, Max = 1 },
    }
},
```

| Field                 | Description                                                                                                                                                                                      |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Name`                | Zone name (blip and notification title)                                                                                                                                                          |
| `SkillName`           | Collecting skill this zone levels (must match a `Name` in `Config.Skill.Skills.Collecting`), or `""`                                                                                             |
| `ProgressBarText`     | Progress bar text                                                                                                                                                                                |
| `CenterCoords`        | Centre of the zone. Also the blip position.                                                                                                                                                      |
| `Radius`              | Size of the zone. Without single points, the player starts within `Radius / 2` of the centre and must stay within `Radius`. With single points, the player must be within `Radius` of one point. |
| `GatheringTime`       | Seconds per farming action (before the skill bonus)                                                                                                                                              |
| `ExpPerAction`        | Skill EXP per successful action                                                                                                                                                                  |
| `SingleFarmingCoords` | Optional list of single farming points. Leave `{}` to use the centre and radius.                                                                                                                 |
| `BlipConfig`          | `SpawnBlip`, `Sprite`, `Color`, `Size`                                                                                                                                                           |
| `Animation`           | Either `Library` + `Anim` (animation) or `Scenario`                                                                                                                                              |
| `RequiredItem`        | Tool the player must have, or `""` / `false`                                                                                                                                                     |
| `Items`               | Loot table, see below                                                                                                                                                                            |

**Loot table:** each action rolls a number from 0 to 100 and goes through `Items` in order, adding up `Probability`. The first item whose running total reaches the roll is given, with a random amount between `Min` and `Max`. If the probabilities add up to less than 100, the rest is "nothing found".

{% hint style="info" %}
The default fishing zone uses `ExpPerAction = 6000` while the fishing skill needs `BaseEXP = 2000` for the first level. Lower it (the other zones use 25–35) if levels should take longer.
{% endhint %}

## Crafting stations

`shared/crafting_config.lua`

### General

| Option                                   | Default | Description                       |
| ---------------------------------------- | ------- | --------------------------------- |
| `Config.Crafting.General.Key`            | `38`    | Control to open the crafting menu |
| `Config.Crafting.General.SpawnMarkers`   | `true`  | Draw a marker at every crafter    |
| `Config.Crafting.General.ShowHelpNotify` | `true`  | Show the help notification        |

### Crafters

```lua
{
    Name = "Ore Crafter",
    SkillName = "ores",
    Position = vector3(1106.2418, -2012.3090, 30.8859),
    Recipes = {
        {
            Ingredients = { { ItemName = "ironore", Amount = 10 } },
            Output = { ItemName = "ironingot", Amount = 1 },
            TimePerItem = 10,
            ExpPerAction = 30,
        },
    },
    BlipConfig = { SpawnBlip = true, Sprite = 728, Color = 0, Size = 1.0 },
    MarkerConfig = { Type = 1, Color = rgba(254, 9, 67, 100), Size = vector3(1.0, 1.0, 0.5) },
    PedConfig = {
        Model = "s_m_y_construct_01", -- "" = no ped
        Heading = 51.0030,
        Animation = { Library = "mp_common", Anim = "givetake1_a" }
    },
    Animation = { Library = "mp_common", Anim = "givetake1_b" }
},
```

| Field          | Description                                                                                                                                       |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Name`         | Crafter name (UI and blip)                                                                                                                        |
| `SkillName`    | Crafting skill this station levels (must match a `Name` in `Config.Skill.Skills.Crafting`), or `""`                                               |
| `Position`     | Position of the crafter                                                                                                                           |
| `Recipes`      | List of recipes: `Ingredients` (`ItemName`, `Amount`), `Output` (`ItemName`, `Amount`), `TimePerItem` in seconds, `ExpPerAction` per crafted item |
| `BlipConfig`   | `SpawnBlip`, `Sprite`, `Color`, `Size`                                                                                                            |
| `MarkerConfig` | `Type`, `Color`, `Size`. The menu opens within `Size.x`.                                                                                          |
| `PedConfig`    | Ped `Model`, `Heading` and an optional ped `Animation` during crafting (`Library = ""` = none)                                                    |
| `Animation`    | Player animation during crafting (`Library = ""` = none)                                                                                          |

Players choose a recipe and an amount. The ingredients are removed at the start, the player is frozen for the crafting time, then the output and the EXP are given.

{% hint style="warning" %}
`SkillName` of a crafter must be a **crafting** skill. In the default config the "Ore Crafter" uses `ores`, which is a collecting skill, so it gives no EXP and no speed bonus. Add an `ores` entry to `Config.Skill.Skills.Crafting` or change the name.
{% endhint %}

## Sellers

`shared/seller_config.lua`

### General

| Option                                  | Default   | Description                                                |
| --------------------------------------- | --------- | ---------------------------------------------------------- |
| `Config.Seller.General.SellTimePerItem` | `2.0`     | Present in the config, but not used by the current version |
| `Config.Seller.General.Key`             | `38`      | Control to open the sell menu and the economy board        |
| `Config.Seller.General.SpawnMarkers`    | `true`    | Draw a marker at every seller                              |
| `Config.Seller.General.ShowHelpNotify`  | `true`    | Show the help notification at sellers and the board        |
| `Config.Seller.General.MoneyAccount`    | `"money"` | Default account for payouts (`"money"` = cash or `"bank"`) |

### Seller entries

```lua
{
    Name = "Jewel Seller",
    Position = vector3(-603.9186, -279.9616, 38.7594),
    -- Positions = {
    --     vector4(-603.9186, -279.9616, 38.7594, 121.3729),
    --     vector4(-610.0000, -280.0000, 38.7594, 90.0000),
    -- },
    BlipConfig = { SpawnBlip = true, Sprite = 500, Color = 3, Size = 0.8 },
    MarkerConfig = { Type = 1, Color = rgba(254, 9, 67, 100), Size = vector3(1.0, 1.0, 0.5) },
    Items = {
        { Name = "sapphire", MinPrice = 50, MaxPrice = 150 },
        { Name = "diamond", MinPrice = 350, MaxPrice = 500 },
    },
    MoneyAccount = "bank",
    PedConfig = { Model = "a_f_y_business_02", Heading = 121.3729 },
    Animation = { Library = "amb@prop_human_parking_meter@female@idle_a", Anim = "idle_a" }
},
```

| Field          | Description                                                                                                                                                           |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Name`         | Seller name (UI and blip)                                                                                                                                             |
| `Position`     | Seller position. The ped uses `PedConfig.Heading`.                                                                                                                    |
| `Positions`    | Optional list of `vector4`. If set, one of them is picked at random on every server start (position and heading).                                                     |
| `BlipConfig`   | `SpawnBlip`, `Sprite`, `Color`, `Size`                                                                                                                                |
| `MarkerConfig` | `Type`, `Color`, `Size`. The menu opens within `Size.x`.                                                                                                              |
| `Items`        | Items the seller buys. The price is rolled between `MinPrice` and `MaxPrice` on every server start (whole numbers if both are whole numbers, otherwise two decimals). |
| `MoneyAccount` | Overrides `General.MoneyAccount` for this seller                                                                                                                      |
| `PedConfig`    | Ped `Model` and `Heading`                                                                                                                                             |

### Economy board

`Config.Seller.Boards` shows today's prices.

| Option             | Default             | Description                                                                                                                                                                                |
| ------------------ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `DisableBoard`     | `false`             | `true` turns the board off completely                                                                                                                                                      |
| `SpawnBoardObject` | `false`             | `true`: spawns the streamed billboard prop `hc_farmbillboard` at every position and shows the prices on it. `false`: spawns a ped with a marker; players open the price list with the key. |
| `Items`            | 8 items             | Item names that are shown on the board. Prices are taken from the sellers that buy these items.                                                                                            |
| `Positions`        | 1 position          | `vector4` positions of the board or ped                                                                                                                                                    |
| `BlipConfig`       | on                  | `SpawnBlip`, `Sprite`, `Color`, `Size`, `Name`                                                                                                                                             |
| `MarkerConfig`     | on                  | `SpawnMarker`, `Type`, `Color`, `Size` (only without board prop)                                                                                                                           |
| `PedConfig.Model`  | `"a_m_m_farmer_01"` | Ped model (only without board prop)                                                                                                                                                        |

## Skills

`shared/skills_config.lua`

| Option                                 | Default    | Description                                                                                                            |
| -------------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------- |
| `Config.Skill.General.AllowKeyMapping` | `true`     | Register a key for the skill menu that players can change in the FiveM key bindings                                    |
| `Config.Skill.General.DefaultKey`      | `"F9"`     | Default key for the skill menu                                                                                         |
| `Config.Skill.General.Command`         | `"skills"` | Command that opens the skill menu, see [Commands](https://docs.hyper-code.eu/documentation/farming-system/commands.md) |
| `Config.Skill.General.MaxLevel`        | `20`       | Highest level of every skill                                                                                           |

`Config.Skill.Skills.Collecting` and `Config.Skill.Skills.Crafting` hold the skills:

```lua
{
    Name = "fish",            -- must match SkillName in the farm / crafting config
    Label = "Fishing",        -- label in the skill menu
    BaseEXP = 2000,           -- EXP for the first level
    AdditionalExpPerLevel = 25, -- every level needs this many percent more EXP
    AdvantagePerLevel = 2.00  -- time bonus per level in percent
},
```

| Field                   | Description                                                                                                                  |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `Name`                  | Skill ID. Must be the same as `SkillName` in the farm or crafter config.                                                     |
| `Label`                 | Name in the skill menu                                                                                                       |
| `BaseEXP`               | EXP needed from level 0 to 1                                                                                                 |
| `AdditionalExpPerLevel` | EXP for the next level = `BaseEXP × (1 + AdditionalExpPerLevel / 100) ^ level`                                               |
| `AdvantagePerLevel`     | Farming or crafting time is reduced by `level × AdvantagePerLevel` percent. With `2.00` and level 20 farming is 40 % faster. |

Skills are saved in `hc_farming_skills` every 5 minutes and when the player leaves. Skills that you remove from the config are removed from the player on the next load.

## EXP boosts

```lua
Config.Boost = {
    InfoCommand = "boost",
    Items = {
        ["farmboost"] = {
            SkillType = "Collecting", -- "Collecting" or "Crafting"
            EXPMultiplier = 1.5,      -- 50 % more EXP
            Duration = 600            -- seconds
        },
        ["craftboost"] = {
            SkillType = "Crafting",
            EXPMultiplier = 1.5,
            Duration = 900
        }
    }
}
```

| Option          | Description                                                                                                                                              |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `InfoCommand`   | Command that shows the active boosts, see [Commands](https://docs.hyper-code.eu/documentation/farming-system/commands.md). `""` or `false` turns it off. |
| `Items`         | Usable boost items, keyed by item name                                                                                                                   |
| `SkillType`     | Skill group the boost applies to                                                                                                                         |
| `EXPMultiplier` | Multiplier for every EXP gain of that group                                                                                                              |
| `Duration`      | Duration in seconds                                                                                                                                      |

Using a boost item removes it and starts the boost. Only one boost per skill group can be active. The remaining time only counts down while the player is online and is saved with the skills.

## Translations and colours

`shared/config.lua`

* `Config.Translation` contains every text of the UIs, notifications, help notifications, skill menu, economy board and boosts.
* `Config.Style` sets the two accent colours of the UI (`LightColor`, `DarkColor`).
