It would be nice if maps had a static ID (like tokens) that we could use.
I tend to change my map names dynamically for various reasons and it often causes issues with other functionality.
My most recent use-case scenario comes from building some Movement Undo functions that record what maps a token is on during a particular move (because the tokens may be teleporting between various maps.) But if one of the map names change the Undo breaks.
[FREQ] Map IDs.
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
[FREQ] Map IDs.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."
Re: [FREQ] Map IDs.
They do:
Oh. What you really want is for someone to go through and change all the macro functions to accept IDs as well as names.
Code: Select all
[r: json.get(getInfo("map"),"id")]
Re: [FREQ] Map IDs.
Whenever you change a map name you need to update your reference. Then when you save your maps, you update the references. You can use the getInfo MapId, but you can just make your own reference like 0 to ... for an array.
So, you record that a token moved on map 0 or whatever. Then when you need to get the map name, just refer to the array.
So, you record that a token moved on map 0 or whatever. Then when you need to get the map name, just refer to the array.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: [FREQ] Map IDs.
I thought there might be. But I wasn't sure since there are no functions that use it. Token functions tend to rely on the ID more than the names. Map parameter functions obviously don't seem to even know that maps have IDs. Since they do, maybe this isn't too difficult to implement.Phergus wrote: ↑Tue Jul 14, 2020 8:52 amThey do:Code: Select all
[r: json.get(getInfo("map"),"id")]
Can't tell if you're being facetious or not.Oh. What you really want is for someone to go through and change all the macro functions to accept IDs as well as names.
I don't know how the map name parameter is called in MT. Do they all use the same basic look-up function? Or would every function with a map name parameter have to be changed? Is there some simpler way that when MT sees a Map Name parameter without an associated map that it could do a map ID lookup instead? Or a way to recognize than a map name parameter is an ID (not a name) and just do the correct lookup without failing through names? I believe some token functions take a token name/id interchangeably so similar recognition code may already be available.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."
Re: [FREQ] Map IDs.
That's always the question when you are talking about macro functions that have been added in over the course of 10 years or so.
Changed? Probably not. At the very least each function would have be to be checked and tested however. Not a particularly difficult task; just time consuming. Then, of course, the wiki page for each one has to be updated.Full Bleed wrote: ↑Tue Jul 14, 2020 6:07 pmOr would every function with a map name parameter have to be changed?
All doable. Only takes time.
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: [FREQ] Map IDs.
Is there anyway to pull a map's ID without switching to it?
And does anyone know if anything in particular causes a Map ID to change?
And does anyone know if anything in particular causes a Map ID to change?
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."