# ❓ ¿What is CRAFTING CREATOR?

## ❓ What is Crafting Creator?

Crafting Creator is the in-game admin toolkit of Syntax Craft. It lets you build and manage crafting content without touching code: create tables, set positions, define recipes, configure job restrictions, and control per-table blips — all live, from a polished NUI.

***

### Who is it for?

* Server owners and admins who curate crafting locations and rules
* Content creators who design recipes, balance XP, and categorize items
* Developers who want a fast, no-restart workflow to iterate on crafting

***

### Key capabilities

* Create, edit, and delete crafting tables
* Reposition tables precisely with keyboard controls
* Choose prop models from a curated list (Available Props)
* Configure interaction distance and job/job-grade restrictions
* Fully control per-table blips (enabled, sprite, color, scale, display)
* Build recipes visually: item, display name, category, ingredients, amount, price, XP, required level, duration
* Inline validation and clear feedback
* Persistent storage via database — no manual file edits

***

### How it works (high-level)

1. You open the panel with the admin command:

```
/craftadmin
```

2. The NUI loads current tables and settings from the server.
3. You create or edit a table and its recipes using the forms.
4. Changes are validated and saved to the database (e.g., `syntax_crafting_tables` and related data).
5. Clients receive updates and see the new/updated tables instantly (no server restart required for in-UI edits).

> Note: Changes directly in `shared/config.lua` (e.g., categories or locale) do require a resource restart to apply.

***

### UI at a glance

* Tables List
  * Search and sort your crafting tables
  * Actions: Edit, Reposition, Delete
  * Quick stats: recipes count, distance, job requirements
* Create/Edit Table Modal
  * Name, distance, prop selection
  * Job and job-grade restrictions (optional)
  * Per-table blip settings: toggle, sprite, color, scale, display
  * Recipes section with add/edit/remove
* Recipe Builder
  * Item ID (internal name), Display Name
  * Category (from `Config.Categories`)
  * Ingredients (name + amount)
  * Amount to receive, Price
  * XP reward, Required level, Duration (seconds)

***

### Permissions

Access is restricted to configured admin groups.

```lua
-- shared/config.lua
Config.AdminCommand = 'craftadmin'
Config.AdminGroups = { 'admin', 'superadmin', 'mod', 'moderator', 'owner', 'developer' }
```

Only players in these groups can open the panel and make changes.

***

### Data and persistence

* Tables: stored with coordinates, heading, prop model, distance, job rules, and blip settings
* Recipes: stored per table with their full definition (category, ingredients, XP, etc.)
* Player progression: stored separately for XP/level tracking

This enables safe restarts and long-term persistence without manual exports.

***

### Best practices

* Naming conventions: use clear, searchable names (e.g., "Weapons Bench - Police HQ")
* Distance tuning: set interaction distance to fit the location (e.g., 2.0–2.5 indoors)
* Job restrictions: keep them minimal; prefer specific grades only when needed
* Categories: align with `Config.Categories` IDs to enable filtering in the UI
* Blips: avoid visual clutter; enable blips only for key locations
* Test as a non-admin to validate access and UX

***

### Troubleshooting

* I don't see categories in the Recipe Builder
  * Ensure `Config.Categories` is defined and the resource was restarted after edits
* My blip appears then disappears after restart
  * Confirm blip fields exist in the database and values are stored correctly
* The admin command doesn't open the panel
  * Verify your group is listed in `Config.AdminGroups` and check server console logs

***

### FAQ

* Does it require restarts?
  * UI changes via the panel do not. Config changes in `shared/config.lua` do.
* Can I manage blips from the config?
  * No. Blips are per-table and managed entirely from the admin UI to keep them flexible.
* Can players craft without a job?
  * Yes, if the table has no job restriction. Otherwise, they must meet the configured job/grade.

***

### See also

* Installation Guide: `docs/installation.md`
* Configuration reference: `shared/config.lua`
* SQL schema: `syntax_craft_complete.sql`
