maptool icon indicating copy to clipboard operation
maptool copied to clipboard

[Feature]: Map creation

Open LKS23 opened this issue 1 year ago • 1 comments

Feature Request

Hello

I was writing this on the discord the other day. I'm currently working on a System to randomly create dungeon maps, as a part of a mega dungeon project. Maptool currently offers enough functions & features to create a macro that creates the full VBL, when provided with a sufficient image. However, to use something like that, one manually has to create a map first to use it on. If it was possible to implement a function, that can create maps, one would be able to fully create a full dungeon map via macro, which would be immensely helpful for randomized dungeon crawls.

If the feature is too difficult to produce, I have a possibly easier compromise: A function that lets you set a new map image. This way, the same could be achieved with the copyMap function + setting a new map image.

The Solution you'd like

New Function -> createMap(1,2,3,4,5) 1 - Name -> necessary input 2 - DisplayName -> necessary input 3 - Background (color id / asset ID) -> necessary input 4 - Map (asset id) -> optional input 5 - Fog (color id / asset id) -> optional input

Further options? (these could be simply taken by the default maptool properties or maybe via additional "setMap" functions) Cell Type (SQUARE,HEX1,HEX2,ISOMETRIC,NONE) -> default to maptool properties Distance per cell -> default to maptool properties Pixels per cell -> default to maptool properties Vision distance -> default to maptool properties AI - (NONE,CELLU,INTEGER) -> default to maptool properties Lights (NONE,DAY,NIGHT) -> default to maptool properties

Alternatives that you've considered.

Alternate / Additional expansion of the existing "g/setMap" functions: g/setMapBackground(Mapname,colorid/assetid) g/setMapImage(Mapname,assetid) g/setMapFog(Mapid,assetid)

Additional Context

No response

LKS23 avatar Jul 20 '22 09:07 LKS23

Would be a nice function.

I think everything in the "New Map" dialog definitely needs to be an option... probably using a json object similar to how create token does it.

FullBleed avatar Jul 21 '22 02:07 FullBleed

I agree that a JSON object would be a good way to do the configurations, especially since most could have default values.

Here's how I picture the function being defined:

createMap(mapName)
createMap(mapName, settings)

A full settings object would look like this, where each key would be optional:

{
  "display name": "New Map Display Name",
  "player visible": true,
  "vision type": "NIGHT",
  "vision distance": 500,
  "grid": {
    "type": "Vertical Hex",
    "size": 50,
    "units per cell": 10,
    "color": "#ffffff",
    "x offset": 25,
    "y offset": 31
  },
  "background": "#ff0000",
  "fog": "#00ff00",
  "map asset": "asset://014aaa10a10b5ddcbbe006f3c22188c2"
}

kwvanderlinde avatar May 26 '23 00:05 kwvanderlinde

Closing this off as the feature has been released for a while now. Bug reports can be filed if needed.

kwvanderlinde avatar Apr 01 '24 22:04 kwvanderlinde