Function Impersonate by activating the token (only players)

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

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

Lost in Khyber
Kobold
Posts: 11
Joined: Wed Apr 13, 2016 4:18 am
Location: Germany

Function Impersonate by activating the token (only players)

Post by Lost in Khyber »

Hi there,

maybe I should describe at first my question in more detail.

It is possible to give a token (controlled by a player) the state "Impersonate" (as seen in the control menue by right-clicking) wenn the token is selected by the player who has the ownership? I ask because in a campaign that we are playing the players controlls more than one token. The problem we have atm is, that some functions can only be used correctly if the player token has the state "Impersonate". So if the player set "Impersonate" to his first charakter and the functions works, he has to do this for the next charakter and so on. Sometimes the players forgot this and the makros change some property entries for the wrong charakter.

Im far away to be an expert in maptool, but my thougt was, that there has to be an option to set this global - maybe with some function like onCampaignLoad as I've seen in the bag of tricks.

(or maybe someone knows a better solution for my problem - please feel free to write any idea or hint)

Thank you for reading this
speaks german and moderate english

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Function Impersonate by activating the token (only playe

Post by wolph42 »

you don't tell us what kind of macros it are. But in general simply checking 'apply to selected token' in the macro editor will fix the issue.
Obviously this *does* require the user to select the token before they hit the macro.

Lost in Khyber
Kobold
Posts: 11
Joined: Wed Apr 13, 2016 4:18 am
Location: Germany

Re: Function Impersonate by activating the token (only playe

Post by Lost in Khyber »

wolph42 wrote:you don't tell us what kind of macros it are. But in general simply checking 'apply to selected token' in the macro editor will fix the issue.
Obviously this *does* require the user to select the token before they hit the macro.
thank you for your awnser,

the macros are mainly linked to a lib - I could, of course, copy some code.

The macros are in the campaign window and we used a framework, changed a lot, and added macro libraries (also your bag of tricks - thanks a lot for this awestome stuff) and bound them together. Fo me (I must say this) I'm generally happy with this as it is now - and I have not much ideas about macros and programming languages and how they work (could read them a bit and change some minor things, but thats it). At this point I sometimes fear that I can destroy more then I can "repair".
So I thougt: IF there is a possibility to have this "get impersonate by selection if your are a player option", then I would use this permanently when the campaign is loaded.

The 'apply to selected token' is used for the most of the macros - they are regulary working fine, but some dont do this.
For example: the change of HP need, that the charakter, who is ownershiped by a player, is 'impersonated'.

Also the picture of the token isn't showing up for the player, when the playertoken isn't impersonated - it would be nice for the players when they see the tokenimage, even if its not necessary for the most of the macros.

If there is exist a function "get impersonate by selection if your are a player option" this could be a solution - but of couse, it has to checked first in the campaign.

thanks again
speaks german and moderate english

User avatar
Irrlicht
Dragon
Posts: 426
Joined: Mon Feb 09, 2009 10:53 am

Re: Function Impersonate by activating the token (only playe

Post by Irrlicht »

Also, maybe you're not using the Impersonate window (Window, in the upper menu -> Impersonate)?
That should "force" you to impersonate any token you select, so you couldn't forget to do it.
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Function Impersonate by activating the token (only playe

Post by wolph42 »

Lost in Khyber wrote: So I thougt: IF there is a possibility to have this "get impersonate by selection if your are a player option", then I would use this permanently when the campaign is loaded.
AFAIK there isn't but I might be wrong have a look: http://lmwcs.com/rptools/wiki/Category:Macro_Function I think Irrlicht suggestion is your best option.

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

Re: Function Impersonate by activating the token (only playe

Post by aliasmask »

Relying on Wiki: getImpersonated() is a bit of a trap since it's specific to the Impersonate window and can only be set manually. It's not so bad if you're a player with one token, but switching can be a pain. There is no setImpersonated which would set the token for the impersonated window, but there is Wiki: switchToken() which will change the currently impersonated token you select but only for the duration of the macro and doesn't effect the Impersonated Window unless your token and user name are the same (I think).

Long story short, it's better to use Wiki: getSelected(), Wiki: switchToken() and Wiki: currentToken() with macros not using "Apply to Selected Tokens" checkbox or to just use currentToken if you are rather than getImpersonated.

Lost in Khyber
Kobold
Posts: 11
Joined: Wed Apr 13, 2016 4:18 am
Location: Germany

Re: Function Impersonate by activating the token (only playe

Post by Lost in Khyber »

Thank you all for your awnsers and time! This are some important informations, so I'm very thankfull.

I will follow all the hints you have given to me and speak with the team (well, the players and the gm :-D) about the possibilities we have and how to deal with the situation after the research and evaluation.
speaks german and moderate english

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

Re: Function Impersonate by activating the token (only playe

Post by Full Bleed »

aliasmask wrote:Relying on Wiki: getImpersonated() is a bit of a trap since it's specific to the Impersonate window and can only be set manually.
But the bigger question is, "Why?"

Not having a setImpersonate() function allows people to paint themselves into some annoying corners.

Anyone know of a reason that we don't have this function? It's one of those functions that seems so obvious... and yet, it doesn't exist.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Function Impersonate by activating the token (only playe

Post by Jagged »

Full Bleed wrote: Not having a setImpersonate() function allows people to paint themselves into some annoying corners.
Is there something that a SetImpersonate() function would do that switch token does not?

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Function Impersonate by activating the token (only playe

Post by wolph42 »

Jagged wrote:
Full Bleed wrote: Not having a setImpersonate() function allows people to paint themselves into some annoying corners.
Is there something that a SetImpersonate() function would do that switch token does not?
switchToken is 'macro temporary' setImpersonate is permanent. However if user would start using switchToken AND setImpersonate in the same macro, you would get a nice spaghetti painting.
Basically impersonation is really useful during roleplay/ using the chat. switchToken is only useful for macros.

The *only* reason it would be useful (AFAICS) to have an setImpersonated is so you could create a macro button: 'Impersonate' however that one already exists in the panel. The only advantage a 'macro' button would have over the 'default' button is that you can assign a shortcut key to it.
As for the latter, I'm far more in favor to be able to map shortcut keys to all the functions in maptool then to have them as macro functions and do it through that method. (but thats my opinion)

Lost in Khyber
Kobold
Posts: 11
Joined: Wed Apr 13, 2016 4:18 am
Location: Germany

Re: Function Impersonate by activating the token (only playe

Post by Lost in Khyber »

Irrlicht wrote:Also, maybe you're not using the Impersonate window (Window, in the upper menu -> Impersonate)?
That should "force" you to impersonate any token you select, so you couldn't forget to do it.
Yes, that’s true. We didn’t use this window because it’s another one which blocks some of our precious mapview-space – but if scaled it’s kind of small, so this is a good hint to remember to impersonate and its also faster than the right clicking option.

Thanks – if there is no other way, we will use this (also for now).
speaks german and moderate english

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

Re: Function Impersonate by activating the token (only playe

Post by Full Bleed »

wolph42 wrote:switchToken is 'macro temporary' setImpersonate is permanent. However if user would start using switchToken AND setImpersonate in the same macro, you would get a nice spaghetti painting.
Basically impersonation is really useful during roleplay/ using the chat. switchToken is only useful for macros.
If switchToken always got the job done I wouldn't run into so many situations where setImpersonate() would be a lot simpler. There are a lot of functions that default to impersonate, and impersonate is great for keeping actions locked onto a particular token without having to pass id's and pull id's all the time.

Not to mention that using switchToken code blocks burns 50% of MT's code level limit.

Sorry, I do not see switchToken() as an replacement for a setImpersonate().
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Function Impersonate by activating the token (only playe

Post by Jagged »

Perhaps you could give a more concrete example, as I have to say, its not an issue I have run up against?

Nor have I run into problems with switchtoken() eating up a branching level, so an example there might help too.

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

Re: Function Impersonate by activating the token (only playe

Post by aliasmask »

When dealing with open frames, it's best to pass the token id to the frame so any link clicked from it would be set to a specific token. This is something I've done for like the spell manager. I would have several frames open for each token I was controlling.

If you're not sure what I'm talking about,

macroLink(text, macroName, output, args, target)

Post Reply

Return to “Macros”