# PREFABS TOOL

<figure><img src="/files/xgPgCn0vMlpyoLwl2q2F" alt=""><figcaption></figcaption></figure>

Making prefabs is a way to group assets and save designs to re-use them easily later.

<figure><img src="/files/AnJkJPUD8tIKzp1WvzhB" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/s4OucpLQVv138Qi9zkwJ" alt=""><figcaption></figcaption></figure>

***

## **WHAT ARE PREFABS?**

They are a simple way to group several assets together, in order to save their layout and recreate it easily later. Any group of assets turned into a prefab can be moved, resized or rotated as if they were a single asset.&#x20;

{% hint style="info" %}
*Not to be confused with what many custom asset creators call "prefabs", which are in general multiple assets of their library arranged together as a new asset, but that you won't be able to edit yourself.*
{% endhint %}

***

## **TYPES OF ASSETS YOU CAN USE**

&#x20;Only **Objects,** **Paths, Patterns,** **Roofs** and **Lights** can be turned into prefabs.

***

## **CREATING A PREFAB**

First, place several assets from the list above on your map.&#x20;

<figure><img src="/files/zt6O9E5r8aXr80Pdo96f" alt=""><figcaption></figcaption></figure>

Then, in the [Select Tool](/guide/all-the-tools/select-tool/interactive-areas.md#selecting-multiple-assets), select them all, either by drawing a **selection box** around them or by clicking on them one by one while holding  <kbd>🡅 Shift</kbd> **.**

<figure><img src="/files/qY9aKLlAbIp1AnIyZ7uq" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/lhzcFNp7mKvkJtN5Z00B" alt=""><figcaption></figcaption></figure>

All the assets now **selected** are showing a **blue selection rectangle** around them.&#x20;

<figure><img src="/files/q5W43n37puzCHhhAXr8O" alt=""><figcaption></figcaption></figure>

Still in the [Select Tool](/guide/all-the-tools/select-tool/left-tab.md#make-prefab-separate), you can now click on <kbd><mark style="color:blue;">**Make Prefab**<mark style="color:blue;"></kbd> in the left panel.

<figure><img src="/files/6xqS1F1iSeqBxfBvqcO9" alt=""><figcaption></figcaption></figure>

A new dialogue window will appear. This is how you will **save** your **prefab**.&#x20;

<figure><img src="/files/vOGR6ooZaevTncvGMFug" alt=""><figcaption></figcaption></figure>

You can type in the **name** of your **prefab**, that will be used to find it back later.

<figure><img src="/files/6kwxPPE8HMxZBtqVn8K7" alt=""><figcaption></figcaption></figure>

You can also change the **Set** (see that as a folder) the prefab will be saved in, or create a **new Set** by clicking on  <kbd><mark style="color:blue;">**+**<mark style="color:blue;"></kbd>**&#x20;.** You can also delete a **Set** by clicking on  <kbd><mark style="color:blue;">**-**<mark style="color:blue;"></kbd>  when a **Set** is displayed in the box.

<figure><img src="/files/er5KvAAXqNHAMb0yD5tc" alt=""><figcaption></figcaption></figure>

When everything seems correct to you, you can click on <kbd><mark style="color:blue;">**Accept**<mark style="color:blue;"></kbd> and the prefab will be saved.

<figure><img src="/files/aPXrtlQzUr8Z4GsVBMYY" alt=""><figcaption></figcaption></figure>

From now on, the assets you selected are **grouped** until you **save** and **reload** your map. Clicking on one will select them all at once.

<figure><img src="/files/JxacmRTaOhRmMUa7WRwk" alt=""><figcaption></figcaption></figure>

***

## **USING PREFABS**

Now that you've made a prefab, you can find it in the **Prefab Tool**, under the set and the name you chose.&#x20;

To select another set, click on the Set dropdown menu in the left panel of the Prefab Tool.

<figure><img src="/files/FpNDndNgORosTu6HGdTm" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/X1hXTR9Pcm0Ps6XdQFOj" alt=""><figcaption></figcaption></figure>

You can then find your prefab in the set where you saved it.

<figure><img src="/files/OnKcYNMqEEb4EUo1MiSG" alt=""><figcaption></figcaption></figure>

To use place a prefab on the map, simply click on its **name** and then click on the map where you want it to be.

<figure><img src="/files/WkjXn96pJkTa8ifzcfei" alt=""><figcaption></figcaption></figure>

In the [Select Tool](/guide/all-the-tools/select-tool.md), you can now select any part of the prefab you've placed and it will select the whole prefab.

<figure><img src="/files/FjTuRUPBtBk6xu5z0XUz" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Prefabs selected from the list in the Prefab Tool will stay grouped even after reloading your map, unlike the first time you grouped the assets.
{% endhint %}

***

## **DELETING AND SPLITTING**

You can **delete** a prefab in a set by clicking on its **name** and then clicking on <kbd><mark style="color:blue;">**Forget**<mark style="color:blue;"></kbd> . The prefab will then be removed from the list forever.

<figure><img src="/files/6m6Ucz2WIzdy1lL60ZN0" alt=""><figcaption><p>I promise I didn't plan to have Forge and Forget<br>on the same screenshot at some point :D</p></figcaption></figure>

You can **split** a prefab that you placed on the map by selecting it in the [Select Tool](/guide/all-the-tools/select-tool.md) and click on <kbd><mark style="color:blue;">**Separate**<mark style="color:blue;"></kbd>. The assets will then be ungrouped. It will affect only the assets that were selected, not the prefab in the list or the other instances of the prefab on the map.

<figure><img src="/files/wjSoqqzgNrBBknCMAFdQ" alt=""><figcaption></figcaption></figure>

***

## **SHARING PREFABS**

It is possible to **share** prefabs with other Dungeondraft users, as long as they use the same assets as you. You're sharing data and not directly assets.&#x20;

It will work fine with default assets but if you're using custom packs in the prefab you're sharing, then the other user will need to have the precise same custom pack, otherwise assets will be missing from the prefab. \
\
To share the prefab file, go in the **top left** [**menu**](/guide/introduction/first-look/main-menu.md#open-user-folder) and click on <kbd><mark style="color:blue;">**Open User Folder**<mark style="color:blue;"></kbd>.&#x20;

<figure><img src="/files/D3qMO2ah9cNru442xI3W" alt=""><figcaption></figcaption></figure>

\
In that folder, open the **prefabs** folder.&#x20;

<figure><img src="/files/OWKH0ipsZQXqUihJO4E6" alt=""><figcaption></figcaption></figure>

The next folders will be your **Sets**.

<figure><img src="/files/r2fQEfFCFVqMkfoY3UNA" alt=""><figcaption></figcaption></figure>

The you can select any file from the folder you want and **share** it with another user over the messaging app of your choice&#x20;

{% hint style="info" %}
It's better to [zip](https://www.7-zip.org/) the file before sharing it, as some apps modify the format name for some reason.
{% endhint %}

<figure><img src="/files/hawbHdQNZUrdNtGmrqgq" alt=""><figcaption></figcaption></figure>

***

## USEFUL INFO

{% hint style="warning" %}

### 📌 Good to know 📌

* The first time you create a Prefab, the assets will stay grouped on your map only until the next reload. That won't happen when you select a prefab from the list in the Prefab Tool, which will stay grouped unless you separate the assets manually.
* A prefab chosen from the Prefab Tool will stay grouped even if you remove it from the list ("Forget" button).
* Prefabs in Dungeondraft must not be confused with what custom asset creators sometimes call [Prefabs](https://www.forgotten-adventures.net/product/map-making/assets/prefabs-pack-1/), which are more like a new asset made out of several others, but that you can't separate and that won't appear in the Prefab Tool but in the [Objects Tool](/guide/all-the-tools/objects-tab/objects-tool.md).
  {% endhint %}

{% hint style="danger" %}

### KNOWN BUGS

**Version:**\
\&#xNAN;*At least from 1.1.0.6 to 1.2.0.0*\
\
**Bug description:**\
\&#xNAN;*Copying a prefab results in some odd results. It is better to simply choose the prefab again from the list.*<br>

***

\
**Version:**\
\&#xNAN;*At least from 1.1.0.6 to 1.2.0.0*\
\
**Bug description:**\
\&#xNAN;*Selecting several prefabs at once and rotating them with the mouse wheel might rotate the individual assets at a different rate from each other. You'll need to rotate each prefab one by one to avoid that.* \
*It might also happen when you select only one prefab but it's a lot rarer and no replicable steps have been found yet.*
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dungeondraft-encyclopaedia.gitbook.io/guide/all-the-tools/prefabs-tool.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
