Impersonate Function

Progress reports and musings from the developers on the current gaming tools.

Moderators: dorpond, trevor, Azhrei

Post Reply
Lee
Dragon
Posts: 958
Joined: Wed Oct 19, 2011 2:07 am

Impersonate Function

Post by Lee »

IDK if I asked this before, but is there a reason why impersonation only has a slash command and not a function? While [token:] does most of what is needed from an impersonated token, I believe having the ability to set impersonation through a function (e.g. impersonateToken(tokenName)), can be a very useful thing to have. In my case, I've come to appreciate that an impersonation persists whereas a selection doesn't; useful to have when I want to keep a lib:token's macros available at all times during design. Unfortunately, I can't apply stuff like conditional etc. since we all know that slash commands always have to be on top of the first macro, to execute.

As stated on one my of earlier posts today, I've done a brief scan of the MT code and want to affect some changes on a fork of the final MT build, for personal use. One of these is making a function for ImpersonateMacro. I've pretty much traced the area of execution and I'd like to ask the devs for any advice before I start on this particular item :)
Last edited by Lee on Wed Sep 12, 2012 1:20 pm, edited 1 time in total.

User avatar
aliasmask
Deity
Posts: 8624
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Impersonate Roll Option

Post by aliasmask »

Do you mean like [wfunc]switchToken[/wfunc]? It sets the [wfunc]currentToken[/wfunc] impersonation for the rest of the function. If the user name matches that of the token (as a side effect) the impersonation remains. If you were to tweak something, I would tweak switchToken.

User avatar
wolph42
Deity
Posts: 9805
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Impersonate Roll Option

Post by wolph42 »

In addition to AMs comment ([wfunc]switchToken[/wfunc] indeed does exactly that which you describe) I'm a bit puzzled by this:
Lee wrote:useful to have when I want to keep a lib:token's macros available at all times during design

the whole Idea of a lib:token is that the macros ARE available at all times, so what exactly do you mean with this?

Lee
Dragon
Posts: 958
Joined: Wed Oct 19, 2011 2:07 am

Re: Impersonate Roll Option

Post by Lee »

aliasmask wrote:Do you mean like [wfunc]switchToken[/wfunc]? It sets the [wfunc]currentToken[/wfunc] impersonation for the rest of the function. If the user name matches that of the token (as a side effect) the impersonation remains. If you were to tweak something, I would tweak switchToken.


It's more of having the functionality of /impersonate in a function as opposed to changing up the macro execution context.

wolph42 wrote:In addition to AMs comment ([wfunc]switchToken[/wfunc] indeed does exactly that which you describe) I'm a bit puzzled by this:
Lee wrote:useful to have when I want to keep a lib:token's macros available at all times during design

the whole Idea of a lib:token is that the macros ARE available at all times, so what exactly do you mean with this?


:lol: I should have been clearer. I meant the macro buttons on a lib:token. My global panel is chock-full of macros calling library macros so I've devolved into running macros from the library itself. Like everyone else, I flit around the MT interface like a mad moth around a flame, so inadvertent clicks on the map area clears the selection panel. It's annoyed me enough to want to make some tweaks. Currently, I work around this by having a couple of macros on hotkey to re-select these tokens and one to cycle through them, but I think it's a lot more convenient, at least for me, to "lock" a lib:token in the Impersonated panel; not to mention that, while there have been many workarounds through macros (like the one in A.M.'s lib:players or another one I saw on the User Creations section), it'd be nice to use the built-in impersonate functionality while macro coding, e.g. [impersonate(tokenName)] ["say something"] [impersonate("")]. I guess it's more of a personal preference and not for everyone :)

Post Reply

Return to “Developer Notes”