[FREQ] Map IDs.

If you have an idea for a new feature, please discuss it in the main MapTool forum first, then post a summary of the discussion here. Use the first Sticky as a template.

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

[FREQ] Map IDs.

Post by Full Bleed »

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.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: [FREQ] Map IDs.

Post by Phergus »

They do:

Code: Select all

[r: json.get(getInfo("map"),"id")]
Oh. What you really want is for someone to go through and change all the macro functions to accept IDs as well as names.

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: [FREQ] Map IDs.

Post by aliasmask »

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.

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: [FREQ] Map IDs.

Post by Full Bleed »

Phergus wrote:
Tue Jul 14, 2020 8:52 am
They do:

Code: Select all

[r: json.get(getInfo("map"),"id")]
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.
Oh. What you really want is for someone to go through and change all the macro functions to accept IDs as well as names.
Can't tell if you're being facetious or not.

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."

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: [FREQ] Map IDs.

Post by Phergus »

Full Bleed wrote:
Tue Jul 14, 2020 6:07 pm
Do they all use the same basic look-up function?
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.
Full Bleed wrote:
Tue Jul 14, 2020 6:07 pm
Or would every function with a map name parameter have to be changed?
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.

All doable. Only takes time.

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: [FREQ] Map IDs.

Post by Full Bleed »

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?
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

Post Reply

Return to “Feature Requests”