Set/Get Properties for a Token on another map

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
Merudo
Giant
Posts: 228
Joined: Wed Jun 05, 2019 7:06 am

Set/Get Properties for a Token on another map

Post by Merudo »

There are a few times I'd like to Set/Get properties of a token on another map.

For example, I might want to edit a token on another map before copying it to the current map, or I might want to have an action on one map impacts another map.

There is no elegant way to do this at the moment - the best is to change map temporarily to do the job and come back to the previous map. This induces flickering.

Would it be beneficial to add an extra parameter "mapname" to these functions, so that they could work for tokens on other maps? I think it could be done relatively easily.

The big question is, would that parameter be considered bloat? Or would it be helpful enough to justify its own existence?

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

Re: Set/Get Properties for a Token on another map

Post by aliasmask »

Check out this thread: viewtopic.php?f=20&t=22147&p=271425&hil ... en#p271425

When copying tokens from another map you can set the properties of the token. I have a macro called createToken() that does a bunch of things. It was made before they added more functionality to the function, mostly the image options, but setting properties would still be done the same way.

Merudo
Giant
Posts: 228
Joined: Wed Jun 05, 2019 7:06 am

Re: Set/Get Properties for a Token on another map

Post by Merudo »

Does that mean you don't think the extra parameter would be useful?

I personally believe that built in functionality is much preferable to complicated macros doing the same job.

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

Re: Set/Get Properties for a Token on another map

Post by aliasmask »

Someone may or may not fix this before 2.0 where this won't be an issue, but until then I'm just offering a solution.

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

Re: Set/Get Properties for a Token on another map

Post by Full Bleed »

Merudo wrote:
Fri Aug 02, 2019 9:58 am
Does that mean you don't think the extra parameter would be useful?
As long as it added no overhead to the existing functions I'd be for it. Otherwise I'd just as soon see it have it's own functions (i.e. something like "get/setRemoteProperty()").
I personally believe that built in functionality is much preferable to complicated macros doing the same job.
Anytime someone wants to come in and create/improve existing functions to do what "complicated" (or even uncomplicated) macros that others simply don't have easy access to (because they don't spend much time on the forums or have optional drop-ins installed) is a good thing.

I saw in another thread that you've been poking around in the MT source code... does that mean you're thinking about tackling this yourself?
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

Merudo
Giant
Posts: 228
Joined: Wed Jun 05, 2019 7:06 am

Re: Set/Get Properties for a Token on another map

Post by Merudo »

Full Bleed wrote:
Fri Aug 02, 2019 12:54 pm
As long as it added no overhead to the existing functions I'd be for it.
The functions would have an additional parameter for the mapname. In the absence of that parameter, the function would revert to what it is now. So no overhead except for a quick check on the number of arguments.
Full Bleed wrote:
Fri Aug 02, 2019 12:54 pm
I saw in another thread that you've been poking around in the MT source code... does that mean you're thinking about tackling this yourself?
Yep.

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

Re: Set/Get Properties for a Token on another map

Post by Full Bleed »

Merudo wrote:
Fri Aug 02, 2019 3:20 pm
Full Bleed wrote:
Fri Aug 02, 2019 12:54 pm
I saw in another thread that you've been poking around in the MT source code... does that mean you're thinking about tackling this yourself?
Yep.
Great. That means the chances of this actually seeing the light of day just went up exponentially... ;)
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

Merudo
Giant
Posts: 228
Joined: Wed Jun 05, 2019 7:06 am

Re: Set/Get Properties for a Token on another map

Post by Merudo »

I created a commit that would add "mapName" as an optional parameter for these functions.

Code: Select all

    getTokenImage
    getTokenPortrait
    getTokenHandout
    setTokenImage
    setTokenPortrait
    setTokenHandout
    setTokenOpacity
    getTokenOpacity
If the response is positive I might add support for other functions as well.

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

Re: Set/Get Properties for a Token on another map

Post by Phergus »

Update the issue when it's complete and we'll get it merged.

Merudo
Giant
Posts: 228
Joined: Wed Jun 05, 2019 7:06 am

Re: Set/Get Properties for a Token on another map

Post by Merudo »

I have added the extra parameter to the functions in TokenPropertyFunction.java and TokenImage.java.

Post Reply

Return to “Feature Requests”