17
\$\begingroup\$

I've discovered an issue when importing maps from D&D Beyond into Foundry VTT via the VTTAssets: D&D Beyond extension.

The map imports 100% correctly in that it brings in walls and doors, as well as keeps the scale of 1 square = 10 feet.

However, I want to play with a grid of 1 square = 5 feet, but keep the same dimensions.

If I double the map size, the doors and walls don't double with it. It does put 2 grid squares in each map square, but I was hoping to keep everything when the scale changed.

\$\endgroup\$

2 Answers 2

4
\$\begingroup\$

The macro worked great for me. I needed to scale lighting as well, so created another macro for that:

let scale = 2;
canvas.scene.update({
  lights: duplicate(canvas.scene.data.lights.map(w => {
    w.x = w.x * scale;
    w.y = w.y * scale;
    w.dim = w.dim * scale;
    w.bright = w.bright * scale;
    return w;
  }))
});

You could potentially combine the 2 macros into one, but I kept them separate for my purposes because there may be times when you want to address one but not the other.

I didn't have any tiles, drawings, journal notes or other things in my scene, but you should be able to do the same for those.

I recommend exporting the JSON for a scene to see what you can play with.

\$\endgroup\$
3
\$\begingroup\$

Use A Macro

As of right now, there is no convenient way to do this through Foundry's UI. However, you can use the following script macro to resize all walls in a scene:

let scale = 2;
canvas.scene.update({
  walls: duplicate(canvas.scene.data.walls.map(w => {
    w.c = w.c.map(x => x * scale);
    return w;
  }))
});

Create a new macro, insert the above code, and ensure that it runs as a "script" macro rather than a "chat" macro. As written, when executed the macro will scale up all doors and walls by a factor of 2, doubling their size.

Alter the scale variable in order to scale to different sizes (0.5 for half size, 3 for triple, etc)

This macro is taken from the FoundryVTT Discord. I have verified that it currently works on Foundry version 0.7.8- however, do remember that FoundryVTT is still in active development, and so you should always back up your scenes before running a script on them.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .