# PREFABS TOOL

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FGU5EjEuY8bQBXZANpSsP%2Fimage.png?alt=media&#x26;token=892282e5-0726-4641-ad96-332909432e96" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FS88zupPjqQkuczyXG8RS%2Fezgif-605a257bd79ecf.webp?alt=media&#x26;token=edf2991c-3953-42a4-a74a-5ad3ef419403" alt=""><figcaption></figcaption></figure>

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2F15mjrNAmzyYLUtSXHwXa%2Fimage.png?alt=media&#x26;token=23f26611-6871-487c-b59e-1a52487e76fa" 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="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FV1rbo9kL4TcqifIDj2dN%2Fimage.png?alt=media&#x26;token=831d3d1c-06df-41aa-ad06-ad2613c1e1fa" alt=""><figcaption></figcaption></figure>

Then, in the [Select Tool](https://unofficial-dd-manual.gitbook.io/dungeondraft/select-tool/interactive-areas#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="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FXfZpOUjV5fxNcHy5VwXF%2Fimage.png?alt=media&#x26;token=278b75ba-5a5e-45b1-9251-2ba154b2cf57" alt=""><figcaption></figcaption></figure>

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FK8wfPruPhcPrXzKN0P5a%2Fimage.png?alt=media&#x26;token=ba4a7345-7bd4-4818-aeb5-7e37d4ad8f54" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FwXXoaVBeYIWpkfWaS4Qq%2Fimage.png?alt=media&#x26;token=1fd5d6d1-afd8-432b-b395-c2f9bda586da" alt=""><figcaption></figcaption></figure>

Still in the [Select Tool](https://unofficial-dd-manual.gitbook.io/dungeondraft/select-tool/left-tab#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="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2Fb89jHq06HTqrVBVzh4sw%2Fimage.png?alt=media&#x26;token=df6c627d-401a-4e22-a053-ca20231fa276" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2F46sfj9xM5PzZM0tvuxa2%2Fimage.png?alt=media&#x26;token=065716d0-81b5-4d00-ad23-9f9a0eaa2778" 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="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2Fuh4jqwlb7PmATC1gSw6b%2Fimage.png?alt=media&#x26;token=3b376736-92af-4353-b1bc-ecdbddf66711" 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="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FBRFknViZXvYgaZclbGlV%2Fimage.png?alt=media&#x26;token=337ae084-f35c-4d6c-85e6-0ef549dcd3d2" 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="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FIcnAaHqiywZaA8EAnm9K%2Fimage.png?alt=media&#x26;token=1cc4ff5f-d8f2-49e2-b589-138f6880e1f6" 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="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2Fx33xbkITDDIrSSHXwLz9%2Fezgif-656b43a2496a53.webp?alt=media&#x26;token=871f914f-a7b5-47a7-8e04-1a25f544b3ea" 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="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2F8Zzw1qeNnFPDaaXkj7cs%2Fimage.png?alt=media&#x26;token=97d4672e-1245-45df-baee-2bc1b3c3e7fb" alt=""><figcaption></figcaption></figure>

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2F4zANr5Pww7TqW68al9hQ%2Fimage.png?alt=media&#x26;token=db4f614c-fcee-44d2-a99b-b9eddc80e6ee" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2F4mm8J1BmT8MHSKQsD592%2Fimage.png?alt=media&#x26;token=b82355ba-465d-4fb2-aea0-db47b9a523f8" 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="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FICCxgNmIOf1BRK2zVho3%2Fezgif-643c434971ee5a.webp?alt=media&#x26;token=9e49595f-520e-44d3-9c76-888c14a51272" alt=""><figcaption></figcaption></figure>

In the [Select Tool](https://unofficial-dd-manual.gitbook.io/dungeondraft/all-the-tools/select-tool), you can now select any part of the prefab you've placed and it will select the whole prefab.

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FnHfxYJvlNBHhSJbi9YVl%2Fezgif-6d7a3f896fd7ab.webp?alt=media&#x26;token=96a59a5a-3bb4-4686-bab8-699f3f2d3cd4" 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="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2F3jjDsCwp5Y3FtqtIYkxj%2Fimage.png?alt=media&#x26;token=f88e1866-344b-4ff9-b67f-18f09a515d75" 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](https://unofficial-dd-manual.gitbook.io/dungeondraft/all-the-tools/select-tool) 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="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FKIl2oSVO9V3d9TJUCRZF%2Fezgif-67f3d2dcc2ff3a.webp?alt=media&#x26;token=60b8be65-ea42-4e37-af2a-ef78ea55d627" 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**](https://unofficial-dd-manual.gitbook.io/dungeondraft/introduction/first-look/main-menu#open-user-folder) and click on <kbd><mark style="color:blue;">**Open User Folder**<mark style="color:blue;"></kbd>.&#x20;

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2Furtu1YCNcgBCP1RMuMNU%2Fimage.png?alt=media&#x26;token=3b74b552-2a58-424a-aac8-9d5f46370541" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FaKfG9FEtHNY7xggO30BT%2Fimage.png?alt=media&#x26;token=7e42ebe1-ef2e-459c-99f4-2e2fa808fcb2" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2F9I2bER9DVmFDMDD9lozW%2Fimage.png?alt=media&#x26;token=bacc94bf-1868-4195-9487-e19db689e42d" 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="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FNsE0gzYXoqlfgTzWpmKc%2Fimage.png?alt=media&#x26;token=69e3166f-fe22-4940-b498-7fcd7de02212" 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](https://unofficial-dd-manual.gitbook.io/dungeondraft/all-the-tools/objects-tab/objects-tool).
  {% 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.*\\

***

\
**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 %}
