# CUSTOM SNAP

{% hint style="info" %}
*Version tested here: 1.2.6*
{% endhint %}

{% hint style="danger" %}
*Version 1.2.5 of this mod is included in Dungeondraft 1.2.0.0 and 1.2.0.1.* Two versions of the same mod can't exist at the same time, so you might need to manually update the file in the install folder (`C:\Program Files\Dungeondraft\mods` on Windows) for it to work. \
\
\&#xNAN;*Deleting the old one and placing the update in your mods folder is not recommended as it might cause issues.*
{% endhint %}

[Custom Snap](https://cartographyassets.com/assets/45748/custom-snap-mod/) gives you the ability to customize your grid. You can set:

* Custom snap values (row and colums of pixels that assets will align with)
* A grid matching your snap values
* Various grid shapes (square, hex, triangle, isometric)

{% hint style="warning" %}
*The first time you load the mod, you might be suprised to see a very tiny grid on your map.*&#x20;

*Once you change the grid settings to your liking, it will stay that way until you change it, even between sessions and maps.*
{% endhint %}

## BASIC KNOWLEDGE

In [Vanilla Dungeondraft](#user-content-fn-1)[^1], the grid is set to 256x256 pixels. You can snap to each grid cell or to each half-cell, but there's nothing more.

This mod adds a new tool in the [Settings Tab](https://dungeondraft-encyclopaedia.gitbook.io/guide/all-the-tools/settings-tab), called **Custom Snap Settings**.

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FLBP3HPD49XwVGP4QORAO%2Fcss3.jpg?alt=media&#x26;token=78c2f84d-f297-441b-95f7-7cb6aed9cc19" alt=""><figcaption></figcaption></figure>

By clicking on it, you will display a new tab where you'll be able to tweak the **snap** and **grid settings**.

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FTKw0i1D4DbpgBfbEwjnL%2Fimage.png?alt=media&#x26;token=42467b32-dbe1-4f66-b2c0-d279ed30c3df" alt=""><figcaption></figcaption></figure>

### Enabling/Disabling the Mod

By default, both the Custom Snap and its Custom Grid are enabled, set to 1/4th of the default grid (64px instead of 256). \
\
You can disable the mod by pressing the **Enabled** toggle button. You can also turn off both Custom Snap and Default Snap by pressing <kbd><mark style="color:purple;">**S**<mark style="color:purple;"></kbd>  on your keyboard.

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FeeZWqNsbhRLczvbzL68J%2Fimage.png?alt=media&#x26;token=5025375c-1be2-4050-b601-ffa237dea041" alt=""><figcaption></figcaption></figure>

You can also just disable the Custom Grid by pressing the **Custom Grid** toggle button. This won't disable the default grid. If you want to hide the custom grid without disabling it, press <kbd><mark style="color:purple;">**G**<mark style="color:purple;"></kbd> on your keyboard.

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FuMGqT2zXMXN0SmcC9pzT%2Fimage.png?alt=media&#x26;token=15979f2d-eb97-4b64-98db-011240bee077" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The **Custom Grid** will always adapts to your **Custom Snap** settings, you can't have a **Custom Grid** with different values.
{% endhint %}

### Understanding the Different Grids

There are a few grid/snap shape options:

* Square (regular grid)
* Horizontal Hex (allowing horizontal lines)
* Vertical Hex (allowing vertical lines)
* Isometric (for isometric perspective)

This is represented by these four shapes you can click on:

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FQVt3cEo6uBdMhs79tEbs%2Fimage.png?alt=media&#x26;token=17d79e00-a574-4985-9949-a53c8b5c0e17" alt=""><figcaption></figcaption></figure>

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FREFMK7CLuXryWEqqLhkI%2Fimage.png?alt=media&#x26;token=c090f5e7-297a-4ebc-9c2c-a5a1b8147948" alt=""><figcaption><p>Square</p></figcaption></figure>

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FCiLPOEEaCpg1rpwXagoN%2Fimage.png?alt=media&#x26;token=abeef7c4-f989-42ac-ba4e-d202c3ebd2d5" alt=""><figcaption></figcaption></figure>

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FoFVSSkUHKBLkjmJPVyvZ%2FHex%20Hor.jpg?alt=media&#x26;token=6e408731-1eff-4165-9014-1cac280c8937" alt=""><figcaption><p>Horizontal Hex</p></figcaption></figure>

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FcEN326BwycmeAyEoWwUX%2Fimage.png?alt=media&#x26;token=dc376fc7-b155-4638-908f-83dbfb64b45c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FQ7F5sn09meBAK50vyE1Y%2FHex%20Vert.jpg?alt=media&#x26;token=7113f7c0-01d3-4273-a270-120c2b35d398" alt=""><figcaption><p>Vertical Hex</p></figcaption></figure>

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2F1ctSupOreg9S3tHANXTW%2Fimage.png?alt=media&#x26;token=fd088277-6b83-4cd8-8560-e5f4eeb20e2e" alt=""><figcaption></figcaption></figure>

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FxGQylrWrR1fnNKF7fHsl%2Fimage.png?alt=media&#x26;token=95c38aaa-2119-4e5f-98a4-f991d45ead6d" alt=""><figcaption><p>Isometric</p></figcaption></figure>

Depending on the shape you chose, you might get two more options:

* **Corner/Edge** will define if the amount of pixels you've set is measured from the center to the corner or from the center the edge of the Hex shape. The **Corner** option will always result in a **smaller grid** than the **Edge** option.&#x20;

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FD08iiwUgheIoXzFst3z4%2Fimage.png?alt=media&#x26;token=2fed8dd2-0d74-458a-a8b6-ad64afcbd2ba" alt=""><figcaption></figcaption></figure>

* **Triangle/Hex** is only useful when you choose to display the grid. Hex will display regular Hex shapes while Triangle will display lines between all the corners of the Hex shape, visually resulting in triangles. This will appear only with the two Hex shapes.

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FypECqp4Jt1W9jeFrqaIk%2Fimage.png?alt=media&#x26;token=1a10ba8d-eb8b-49f5-b4f7-e862070bc256" alt=""><figcaption></figcaption></figure>

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FBw8ABvZlbygXwrK1emdA%2Fimage.png?alt=media&#x26;token=53b571a9-80d8-4c85-9cd2-38ccee1d0d8c" alt=""><figcaption><p>Regular Hex</p></figcaption></figure>

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FntpKHTMWt84RykUoxx49%2Fimage.png?alt=media&#x26;token=7e2924f9-2c7e-42ab-9369-2a0f7862548f" alt=""><figcaption><p>Triangle</p></figcaption></figure>

### Presets

In the **Presets** dropdown menu, you can select between several snap presets (and grid presets, if that option is enabled).

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FWhJfafnEq27SrFUe9JLW%2Fimage.png?alt=media&#x26;token=2148afef-daff-4ac2-922a-5e634ec59071" alt=""><figcaption></figcaption></figure>

There are a few options:

* *1/4th (64 px)*
* *1/8th (32 px)*
* *Large Horizontal Hex (128x128 px)*
* *Small Horizontal Hex (64x64 px)*
* *Large Vertical Hex (128x128 px)*
* *Small Vertical Hex (64x64 px)*
* *Roll20 Horizontal (128x128 Horizontal Hex)*
* *Roll20 Vertical (128x128 Vertical Hex)*

{% hint style="warning" %}
*If your R20 presets are not 128x128 but 150x150, click on Open User Folder in the top left menu and delete the file named `custom_snap_mod_data.txt` (you don't need to close Dungeondraft).*
{% endhint %}

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FO6dE1CTzv1cW1sFnRPYn%2Fimage.png?alt=media&#x26;token=fb319099-6ee8-414d-9978-8f6b1864c9b7" alt=""><figcaption></figcaption></figure>

For a standard battlemap with a square grid, using either **1/4th (64 pixels)** or **1/8th (32 pixels)** should be more than enough for most cases. Some people like to use **1/16th (16px)**, which can be achieved in the **Advanced Settings**.

## ADVANCED SETTINGS

You can display more controls by clicking the **Enable Advance** toggle button.

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FT1V9AMOgqpMWHMZaqSXS%2Fimage.png?alt=media&#x26;token=b7a1faaa-1ec3-47a7-9c78-f2defa0561a6" alt=""><figcaption></figcaption></figure>

### Scaling

In Advanced mode, you can now choose your own values. There's a slider for the horizontal scaling and one for the vertical scaling. Values go from 1 to 256 and represent the gap in pixels between two snapping points (and the size of a grid cell when Custom Grid is enabled).

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FZX3T5dLvm3r7j6RBP0bd%2Fimage.png?alt=media&#x26;token=091b643f-9242-4665-83ea-cd5dbe3ec3c8" alt=""><figcaption></figcaption></figure>

By default, both sliders are working together to keep the same ratio, but you can move them separately by pressing the **Lock Aspect Ratio** toggle button.

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FJMHvkxH1ik8aR6SBaWC2%2Fimage.png?alt=media&#x26;token=25ff0e79-29c6-4150-86e1-31116c8d9148" alt=""><figcaption></figcaption></figure>

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2F1WHFw5tXHq0FKSsS3FEw%2Fezgif-56f2616d036b91.webp?alt=media&#x26;token=06aa342c-569f-42fc-b034-598528f958cc" alt=""><figcaption></figcaption></figure>

### Offset

In Advanced mode, you can offset the snapping points (and the grid when Custom Grid is enabled).

You can offset the snapping points/grid up to 256 pixels right and down with two sliders.&#x20;

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2Frc7smoEc2uRfDRPNNPU8%2Fimage.png?alt=media&#x26;token=791e52c2-8bd6-48bd-af03-13ef5fe494c3" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
That option can be very useful when you're trying to match a premade grid (for example with the [Trace Tool](https://dungeondraft-encyclopaedia.gitbook.io/guide/all-the-tools/settings-tab/trace-image)) that doens't start right at the corner of the image.
{% endhint %}

By default, both sliders are working together, but, as for **Scaling**, you can choose to move them separately by pressing the **Lock Aspect Ratio** toggle button.

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FJMHvkxH1ik8aR6SBaWC2%2Fimage.png?alt=media&#x26;token=25ff0e79-29c6-4150-86e1-31116c8d9148" alt=""><figcaption></figcaption></figure>

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FGcsFa3OWoZemcYsMIp2j%2Fezgif-55fc0d8039a0f4.webp?alt=media&#x26;token=5d4349fc-3229-44aa-80f0-c8f2c4fc93da" alt=""><figcaption></figcaption></figure>

## SNAP SELECTION

In the selection tool, you can now see a <kbd><mark style="color:blue;">**Snap Selection**<mark style="color:blue;"></kbd> button. Clicking on it after selecting a asset will bring it to the closest snapping point.

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2F8lSZPi2Ky2VMLcLx7PDh%2Fimage.png?alt=media&#x26;token=b5f3efd8-314a-455e-9f97-026f65cf348a" alt=""><figcaption></figcaption></figure>

### Snapping a Multiple Selection

When you select and move multiple assets, [vanilla snap](#user-content-fn-2)[^2] doesn't work correctly. This can be especially frustrating when you copy some assets that were snapped but you need to snap back each copied asset manually, one by one.

*The Snap Selection feature fixes that issue.*&#x20;

When multiple assets are selected, clicking on <kbd><mark style="color:blue;">**Snap Selection**<mark style="color:blue;"></kbd> several times will cycle through several reference points to snap to the grid.&#x20;

It will either align the center of the selection’s bounding box to the nearest snapping point or the different assets in the selection.

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FFn9Dp7bQAKZDve3XqYhb%2Fimage.png?alt=media&#x26;token=247610e1-0aa6-404a-a7c7-3dd43e1cec1d" alt=""><figcaption><p>Unsnapped selection</p></figcaption></figure>

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2Fo5n3lXEupG1hXHlRpxoy%2Fimage.png?alt=media&#x26;token=34d9092b-9812-46b5-a3b5-4e1d6079b610" alt=""><figcaption><p>Click #1: Snapping the selection box's center</p></figcaption></figure>

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2Fmlq54boHukyxhEeMs1Hi%2Fimage.png?alt=media&#x26;token=881ebb5a-7773-4103-afb6-a365ca67db36" alt=""><figcaption><p>Click #2: Snapping the right asset</p></figcaption></figure>

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FwIIOGyHLZ40fBf3OTFpZ%2Fimage.png?alt=media&#x26;token=030ca039-c459-4ce5-b919-c71d967bdfa8" alt=""><figcaption><p>Click #3: Snapping the left asset</p></figcaption></figure>

<figure><img src="https://717747526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FonbNaZHYfX7cze8ubfnQ%2Fuploads%2FlAf7tnsG7hKfhoQRDBgY%2Fezgif-4f5202490f6b4e.gif?alt=media&#x26;token=a3d8165f-f41d-49a7-a3ef-1485592f7d8a" alt=""><figcaption></figcaption></figure>

***

{% hint style="danger" %}

### KNOWN BUGS

**Version:**\
\&#xNAN;*1.2.0.0 (fixed in 1.2.0.1)*

**Bug description:**\
Custom Snap is packaged with Dungeondraft but doesn't even appear in the mod list unless you have set a custom folder for your mods. Each time you will start Dungeondraft, the mod will be enabled even if you have disabled it before. \
\
As a side effect, the mod will display a 64x64 **custom grid** the first time you load it, which might confuse users.&#x20;

**Workaround:**

* Install Dungeondraft 1.2.0.1 or higher
* The mod itself can be disabled from the [Settings](https://dungeondraft-encyclopaedia.gitbook.io/guide/all-the-tools/settings-tab), in the Custom Snap Settings tab. You can also just disable the custom grid or change its settings.
* You can also move your mod from the internal mod folder (in the install folder) to your custom mod folder.
  {% endhint %}

***

{% hint style="warning" %}
Usually, creators post some minor updates of their mods on [Discord](https://discord.com/invite/J9Czgpu) and release a bigger update from time to time on [CartographyAssets.com](https://cartographyassets.com/asset-category/specific-assets/dungeondraft/mods-scripts/), so if you're missing some features from there, you might find the most recent version on Discord.
{% endhint %}

***

{% hint style="success" %}

<p align="center"><a href="https://cartographyassets.com/assets/45748/custom-snap-mod/"><strong>DOWNLOAD</strong></a></p>
{% endhint %}

[^1]: Unmodded version of Dungeondraft

[^2]: unmodded snap from the base version of Dungeondraft
