> For the complete documentation index, see [llms.txt](https://rickys-organization-6.gitbook.io/hwc-documentions/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rickys-organization-6.gitbook.io/hwc-documentions/hwc-map-editor.md).

# HWC Map Editor

## 📥 Installation Guide

### HWC Map Editor & Map Loader

This guide will walk you through installing both the **Map Editor** and **Map Loader** correctly on your FiveM server.

***

### ⚙️ Requirements

Before installing, make sure your server meets the following:

* ✅ FiveM server (build **b2802+**)
* ✅ `lua54 'yes'` enabled in your server
* ⚠️ Optional frameworks:
  * QBCore / ESX / QBox (for notifications only)
* ⚠️ Optional:
  * `qb-vehiclekeys` (for automatic vehicle key support)

***

## 🧩 Part 1 — Installing HWC Map Editor

The Map Editor is used to **create and save maps**.

***

### 📁 Step 1 — Upload Resource

1. Download the resource
2. Place the folder:

```
HWC_Map_Editor
```

into your server:

```
resources/[standalone]/
```

***

### ⚙️ Step 2 — Add to server.cfg

Add this to your `server.cfg`:

```
ensure HWC_Map_Editor
```

***

### 🔒 Step 3 — Set Permissions (REQUIRED)

The editor **WILL NOT OPEN** without ACE permissions.

#### Basic Admin Group Permission:

```
add_ace group.admin "hwc.mapeditor.use" allow
```

#### Optional: Grant Specific User Access

```
add_ace identifier.license:YOUR_LICENSE "hwc.mapeditor.use" allow
```

👉 Replace:

* `YOUR_LICENSE` with the player's license identifier

***

### ✅ Step 4 — Restart Server

Restart your server or run:

```
refresh
ensure HWC_Map_Editor
```

***

### 🎮 Step 5 — Open the Editor

In-game command:

```
/hwc_mapeditor
```

***

## 🌍 Part 2 — Installing HWC Map Loader

The Map Loader is used to **load maps for all players**.

***

### 📁 Step 1 — Upload Resource

Place:

```
HWC_Map_Loader
```

into:

```
resources/[standalone]/
```

***

### 📂 Step 2 — Add Your Maps

Copy saved maps from:

```
HWC_Map_Editor/maps/
```

➡️ Into:

```
HWC_Map_Loader/maps/
```

***

### ⚙️ Step 3 — Add to server.cfg

```
ensure HWC_Map_Loader
```

***

### 🔒 Step 4 — Admin Permissions

Required for reload command:

```
add_ace group.admin "hwc.maploader.admin" allow
```

***

### ⚠️ Step 5 — Load Order (IMPORTANT)

If running both:

```
ensure HWC_Map_Editor
ensure HWC_Map_Loader
```

👉 **Editor MUST start before Loader**

***

### 🔄 Step 6 — Restart Server

```
refresh
ensure HWC_Map_Loader
```

***

## 🔁 Loading & Updating Maps

After adding new maps:

#### In-game command:

```
/hwc_reloadmaps
```

This will:

* Reload all `.json` maps
* Apply changes instantly
* No restart required

***

## ⚙️ Optional Configuration (Map Loader)

Edit:

```
HWC_Map_Loader/shared/config.lua
```

Key settings:

```
Config.LOD = {
    enabled        = true,
    spawnDistance   = 2500.0,
    despawnDistance = 5000.0,
    checkInterval  = 2000,
    defaultPropLod = 3000,
}
```

👉 Controls:

* Performance
* Streaming distance
* Spawn behavior

***

## 🧪 Quick Installation Checklist

✅ Resource in correct folder\
✅ `ensure HWC_Map_Editor` added\
✅ `ensure HWC_Map_Loader` added\
✅ ACE permissions set\
✅ Maps copied to loader\
✅ Server restarted

***

## ❗ Common Issues

#### ❌ Editor not opening

✔ Check ACE permission:

```
add_ace group.admin "hwc.mapeditor.use" allow
```

***

#### ❌ Maps not loading

✔ Ensure maps are in:

```
HWC_Map_Loader/maps/
```

✔ Run:

```
/hwc_reloadmaps
```

***

#### ❌ Nothing spawning

✔ Check:

* Resource started
* JSON format valid
* LOD settings not too low

***

#### ❌ Duplicate props

✔ Use:

```
/hwc_refreshmaps
```

***

## 💬 Support

Need help?

👉 Join our Discord:\
<https://discord.gg/muw855d3js>

***

## 🧠 Pro Tip

💡 Use the **Map Editor on a dev server only**, then export maps to your main server using the Map Loader for best performance.
