How can i get permission to access another token?

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

Post Reply
SerenityInFire
Kobold
Posts: 3
Joined: Thu Aug 18, 2011 8:49 pm

How can i get permission to access another token?

Post by SerenityInFire »

I placed a macro in the Impersonate token window and the code is sort of similar to this:

Code: Select all

[h: attackProp = getProperty("AttackProperty", getImpersonated())]

[h: defenseProp = getProperty("DefenseProperty", getSelected())]

[h, IF(attackProp >= defenseProp): Result = "Hits!"; Result = "Misses!"]

[r: Result]
Wanting to test the macro out, I selected another token and when click on the Macro, I get an error saying "You do not have permission to access another token in the "getProperty" function."

Is there anyway that i can get this macro to work in the Impersonate window? It works fine in the Campaign window.

chaossdragon
Giant
Posts: 145
Joined: Tue Jul 05, 2011 10:18 pm

Re: How can i get permission to access another token?

Post by chaossdragon »

edit the macro in question and at the top, there are 2 tabs.

command / options

click on options and uncheck 'allow players to edit'

any macro on impersonated, campaign, lib:token are protected this way to allow players to use them.
otherwise GM's might get a couple cheaters that know the code and edit macros to suit their needs.

pretty sure selected is part of that list but not global as those are macros only accessable to the machine they are writen on.

User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

Re: How can i get permission to access another token?

Post by CoveredInFish »

Maybe (I'm not sure of the full detail of the anti-cheating mechanics out of my head) you'll have to learn how to use Library tokens.

This are special tokens (actually just usual tokens with a specific setup) that are used to store macros. If set up correctly these macros are "trusted" and can do more than "non-trusted" macros can.There are many functions that require trust. Wiki: getProperty() requires trust if you specify the token id.

Note that library tokens are not the only way to give trust to a macro and maybe chaosdragons way is sufficient to do so.

I recommend reading: Trusted Macro, Library Token

chaossdragon
Giant
Posts: 145
Joined: Tue Jul 05, 2011 10:18 pm

Re: How can i get permission to access another token?

Post by chaossdragon »

given the touchy nature of lib:tokens, and by touchy I mean its an Intermediate/Advanced option to use them.

the code involved, while pretty standard, can get fubard easily.
an example would be my current problem with a lib:token (see Need a guru's advice).

I was aiming to ease the OP into macro/coding with basic understanding and proficiency before delving deeper
into macro calls, user defined functions and the like. Of course everyone has their own learning pace, and
that is entirely up to SerenityInFire.

User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

Re: How can i get permission to access another token?

Post by CoveredInFish »

You were right in pointing to a working and simple solution. Keep it simple is always a good thing in coding.

But I wasnt sure if it is sufficient, was to lazy to try it out and wanted to give additional advice in case the problem is not solved yet (or if the OP wants to get lured into the secrets of dark coding).

ziltmilt
Dragon
Posts: 331
Joined: Sun Apr 29, 2007 9:28 pm
Contact:

Re: How can i get permission to access another token?

Post by ziltmilt »

All of a sudden, I'm getting this error as well. Sorry for the dead thread resurrection.

Code: Select all

You do not have permission to access another token in the "setProperty" function.
I'm getting this AFTER unchecking 'Allow Players to Edit Macro' in the Options tab in the Edit Macro dialog box. Help please!!

thanks again -

ziltmilt
Dragon
Posts: 331
Joined: Sun Apr 29, 2007 9:28 pm
Contact:

Re: How can i get permission to access another token?

Post by ziltmilt »

NVM, figured it out. The macro was calling a function on a Lib token, which had to be changed. Awesome documentation! Got it fixed in no time.

Post Reply

Return to “Macros”