# General Settings

***

## 🔧 Configuration Options

All general settings are located in `shared/config.lua` under the **GENERAL SETTINGS** section.

```lua
-- ════════════════════════════════════════════════════════════════════════════════════
--  GENERAL SETTINGS
-- ════════════════════════════════════════════════════════════════════════════════════

Config.Debug = false
Config.Locale = 'en'
Config.LetPlayerMoveAwayFromTable = false
Config.DuiQueue = false
```

***

## 📝 Setting Descriptions

### Debug Mode

```lua
Config.Debug = false
```

Purpose: Enable or disable debug console logs for troubleshooting.

Options:

* `true` - Shows detailed console logs for debugging (player actions, crafting events, etc.)
* `false` - Normal operation without debug messages (recommended for production)

When to use:

* ✅ Set to `true` when troubleshooting issues
* ✅ During initial setup to verify everything works
* ❌ Set to `false` on live servers to reduce console spam

Example output when enabled:

```
[KOJA-CRAFTING] Player 1 opened crafting menu: weapon_crafting
[KOJA-CRAFTING] Crafting started: bandage (x3)
[KOJA-CRAFTING] Player 1 has level 2, exp: 150/200
```

***

### Language / Locale

```lua
Config.Locale = 'en'
```

Purpose: Set the language for all UI text, notifications, and messages.

Available Languages:

| Code   | Language | File              |
| ------ | -------- | ----------------- |
| `'en'` | English  | `locales/en.json` |
| `'pl'` | Polish   | `locales/pl.json` |
| `'de'` | German   | `locales/de.json` |
| `'es'` | Spanish  | `locales/es.json` |
| `'fr'` | French   | `locales/fr.json` |
| `'hi'` | Hindi    | `locales/hi.json` |
| `'ja'` | Japanese | `locales/ja.json` |
| `'ru'` | Russian  | `locales/ru.json` |
| `'zh'` | Chinese  | `locales/zh.json` |

How to add custom translations:

{% stepper %}
{% step %}

### Copy a locale file

Copy an existing locale file from the `locales/` folder.
{% endstep %}

{% step %}

### Rename the file

Rename it (e.g., `locales/custom.json`).
{% endstep %}

{% step %}

### Translate strings

Translate all text strings in the new file.
{% endstep %}

{% step %}

### Set the locale

Set `Config.Locale = 'custom'`.
{% endstep %}
{% endstepper %}

Example locale structure (`locales/en.json`):

```json
{
  "crafting_menu_title": "Crafting Menu",
  "not_enough_resources": "You don't have enough resources",
  "crafting_started": "Crafting started",
  "item_claimed": "Item claimed successfully"
}
```

{% hint style="info" %}
Not a whole locale file!
{% endhint %}

***

### Player Movement During Crafting

```lua
Config.LetPlayerMoveAwayFromTable = false
```

Purpose: Control whether players can walk away from the crafting station while items are being crafted.

Options:

* `false` - Players must stay near the crafting table (default)
* `true` - Players can freely move away while crafting

How it works:

When `false` (Recommended):

* Player must stay within `Config.CraftingQueue.maxDistance` (default 5m)
* If player moves too far, they get a warning
* After `Config.CraftingQueue.warningTime` seconds (default 15s), crafting is cancelled
* More realistic and prevents abuse

When `true`:

* Player can move anywhere on the map
* Crafting continues in the background
* More convenient but less realistic

Recommendation: Keep this `false` for balanced gameplay. Use `true` only if your server prefers convenience over realism.

***

### DUI Queue Display

```lua
Config.DuiQueue = false
```

Purpose: Enable or disable 3D visual crafting queue display above crafting tables.

Options:

* `false` - No 3D display (lighter on performance)
* `true` - Shows crafting progress on a 3D screen above the table

What is DUI? DUI (Draw User Interface) renders the crafting queue as a 3D object in the game world. Players can see what's being crafted without opening the menu.

Visual Example:

```
┌─────────────────────┐
│  • Bandage (====)   │
│  • Lockpick (====)  │
└─────────────────────┘
           ↓ 
(Floating above table)
   [Crafting Table]
```

Performance Impact:

* ⚠️ Enabling DUI uses more client resources
* Recommended only for servers with good performance
* Test with multiple players before enabling on live server

When to use:

* ✅ High-performance servers
* ✅ Want visual feedback for shared tables
* ❌ Low-end servers or many crafting stations
* ❌ If players experience FPS drops

***

## 💡 Tips & Best Practices

* Always test in dev environment first before changing settings on live server
* Monitor server performance when enabling DUI on multiple stations
* Keep Debug disabled on production to avoid console spam

***

## 🔍 Troubleshooting

<details>

<summary>Locale not loading</summary>

* Check if the locale file exists in the `locales/` folder
* Verify `Config.Locale` matches the filename (without .json)
* Restart the resource after changing locale

</details>

<details>

<summary>DUI not showing</summary>

* Ensure `Config.DuiQueue = true`
* Check if crafting table has items in queue
* Try relogging or restarting the resource

</details>

<details>

<summary>Debug logs not appearing</summary>

* Verify `Config.Debug = true`
* Check server console (not F8 client console)
* Ensure resource is running (`ensure koja-crafting` in server.cfg)

</details>

***

## 📚 Related Settings

* For distance checking configuration, see [Crafting Queue Settings](https://docs.kojascripts.eu/new/crafting/configuration/broken-reference)
* For interaction configuration, see [Interaction Settings](https://docs.kojascripts.eu/new/crafting/configuration/broken-reference)
* For database options, see [Server Settings](https://docs.kojascripts.eu/new/crafting/configuration/broken-reference)
