RPTools.net

Discussion and Support

Skip to content

It is currently Tue Jan 23, 2018 10:41 am 






Reply to topic  [ 7 posts ] 

Previous topic | Next topic 

  Print view

Author Message
 Offline
Kobold
 
Joined: Thu Aug 18, 2011 7:49 pm
Posts: 3
 Post subject: How can i get permission to access another token?
PostPosted: Fri Aug 19, 2011 12:27 am 
I placed a macro in the Impersonate token window and the code is sort of similar to this:

Code:
[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.


Top
 Profile  
 
User avatar  Offline
Giant
 
Joined: Tue Jul 05, 2011 9:18 pm
Posts: 145
 Post subject: Re: How can i get permission to access another token?
PostPosted: Fri Aug 19, 2011 1:51 am 
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.


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Mon Jun 29, 2009 9:37 am
Posts: 3108
Location: Germany
 Post subject: Re: How can i get permission to access another token?
PostPosted: Fri Aug 19, 2011 2:11 am 
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

_________________
HELP: GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC.

most complete list of my maptool stuff


Top
 Profile  
 
User avatar  Offline
Giant
 
Joined: Tue Jul 05, 2011 9:18 pm
Posts: 145
 Post subject: Re: How can i get permission to access another token?
PostPosted: Fri Aug 19, 2011 2:22 am 
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.


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Mon Jun 29, 2009 9:37 am
Posts: 3108
Location: Germany
 Post subject: Re: How can i get permission to access another token?
PostPosted: Fri Aug 19, 2011 2:51 am 
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).

_________________
HELP: GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC.

most complete list of my maptool stuff


Top
 Profile  
 
 Offline
Dragon
 
Joined: Sun Apr 29, 2007 8:28 pm
Posts: 342
 Post subject: Re: How can i get permission to access another token?
PostPosted: Fri Nov 24, 2017 2:02 pm 
All of a sudden, I'm getting this error as well. Sorry for the dead thread resurrection.

Code:
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 -


Top
 Profile  
 
 Offline
Dragon
 
Joined: Sun Apr 29, 2007 8:28 pm
Posts: 342
 Post subject: Re: How can i get permission to access another token?
PostPosted: Fri Nov 24, 2017 6:00 pm 
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 7 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 2 guests





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman