I have a MapTool campaign which consists of multiple maps. Each map is prepared in advance to run the different encounters in the adventure.
For performing most of the common actions (including attacks, damage, skill uses, etc) I have created by own framework which simplifies most of the work for me. The framework consists of a lib token which does almost all of the "heavy lifting" and the player tokens just make calls to this lib token.
This all seems to work well.
The problem that I am having is that when I create a new map and copy over the lib token, MapTool complains that the lib token is duplicated (i.e. because it is on more than one map). However, if I keep the lib token on only one map, the player token macros complain that they cannot find the specified lib token.
Workaround: Currently each map has a copy of the lib token with a slightly different name and I rename it to the required name when using that particular map. This works but is a pain especially if I forget to rename back the lib token on one of the maps (so as to make it available on other maps) because then I have to search through all the maps just to figure out which is the duplicating map.
I cannot use General Marcos for this purpose because I need them to be on a token since I set a bunch of in-game properties on the token.
I cannot use Campaign Macros for this purpose because I want to hide the macros from the players.
Library Tokens
Moderators: dorpond, trevor, Azhrei
Forum rules
Posting now open to all registered forum users.
Posting now open to all registered forum users.
-
- Kobold
- Posts: 15
- Joined: Tue Jun 18, 2019 7:43 pm
Re: Library Tokens
The other oddity with lib tokens is that they need to be visible to players. Why?
If you are using Strict Ownership then this is not an issue because the players won't have ownership and thus won't be able to launch the lib macros but in cases where a game is not using Strict Ownership it would seem beneficial to me to be able to hide the lib token.
If you are using Strict Ownership then this is not an issue because the players won't have ownership and thus won't be able to launch the lib macros but in cases where a game is not using Strict Ownership it would seem beneficial to me to be able to hide the lib token.
Re: Library Tokens
You only need one instance of your lib:token. They can be accessed from any map. The usual practice is to put them on a map which is hidden from the players. The lib:token must be set to "Visible to players" but the map itself won't be.
Also, you can use the Global macro panel for GM macros as those are local to your machine and not seen by anyone.
Also, you can use the Global macro panel for GM macros as those are local to your machine and not seen by anyone.
Re: Library Tokens
lib token should be treated as a library of macros but you shouldn't need to click them directly. Usually you call the macro from another location like the campaign window. the lib tokens should be on the token layer and visible, but the map that they are on doesn't need to be visible to players. If not on the token layer then they may duplicate, in my experience.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
-
- Kobold
- Posts: 15
- Joined: Tue Jun 18, 2019 7:43 pm
Re: Library Tokens
I will try this again but last time I tried to access macros on the lib token when the lib token was on another map, it said it can't find the lib token. Maybe I hadn't set the "Visible To Players" and that was the problem...
I used the GM token (as opposed to Global) for two reasons: 1) Using the token all spoken components echo the token name as opposed the player name. That means I can change the name more easier without even having to re-login. 2) My setup is currently limited to one monitor and having the Global panel open takes up more of the monitor space. Using the GM token allows me to access the macros using the Selected tab which I always have up for characters. But thanks for the advice in any case.
-
- Kobold
- Posts: 15
- Joined: Tue Jun 18, 2019 7:43 pm
Re: Library Tokens
Previously I was trying to skip the GM token and have the GM trigger macros directly from the lib token but dropped that for two reasons: 1) Messages to other players where send using the lib token name, 2) Lib token ended up having a mix of GM macros and processing macros which confuses things a little.aliasmask wrote: ↑Sun Jun 23, 2019 3:11 pmlib token should be treated as a library of macros but you shouldn't need to click them directly. Usually you call the macro from another location like the campaign window. the lib tokens should be on the token layer and visible, but the map that they are on doesn't need to be visible to players. If not on the token layer then they may duplicate, in my experience.
Now I am doing exactly what you suggested. The player tokens have macros which just end up calling the appropriate macro on the lib token and now I created a GM token that does the same. No one calls the lib token macros directly from the lib token.
-
- Kobold
- Posts: 15
- Joined: Tue Jun 18, 2019 7:43 pm
Re: Library Tokens
Okay I retested using multiple maps but only a single copy of the lib token on one map.
Here was my setup:
Two maps: one called "(Library)" and the other called "Grasslands".
The "(Library)" map has a token called "lib:D20" which has all my actual macros.
On both maps, I have a copy of a player token which has a macro that just calls the macro on lib:D20 with some parameters.
When the player token macro is used on the "(Library)" map, it works fine. However, when use from the "Grasslands" map, the macro from the lib token on "(Library)" but the macro on the lib token uses "getProperty" to read some properties off the lib:D20 lib token and it appears that it is unable to execute that, giving:
Error executing "getProperty": the token name or id "lib:D20" is unknown.
My guess at what is happening is that the execution of the macro from the lib token works but it is still executing from the "Grasslands" map. So when the macro gets to the "getProperty" call (which specified the "lib:D20" token as the source) it is unable to find the lib:D20 token because (it seems) "getProperty" can't access tokens on other maps.
If this is the case then...
Workaround: I could change all the getProperty and setProperty references to another token (e.g. the GM token). If I am correct in the above explanation this should allow the macro to reside in the lib token on the "(Library)" map but access properties on the local map GM token. I believe MapTool will not complain about duplicates unless it is a lib token, so that should work.
Here was my setup:
Two maps: one called "(Library)" and the other called "Grasslands".
The "(Library)" map has a token called "lib:D20" which has all my actual macros.
On both maps, I have a copy of a player token which has a macro that just calls the macro on lib:D20 with some parameters.
When the player token macro is used on the "(Library)" map, it works fine. However, when use from the "Grasslands" map, the macro from the lib token on "(Library)" but the macro on the lib token uses "getProperty" to read some properties off the lib:D20 lib token and it appears that it is unable to execute that, giving:
Error executing "getProperty": the token name or id "lib:D20" is unknown.
My guess at what is happening is that the execution of the macro from the lib token works but it is still executing from the "Grasslands" map. So when the macro gets to the "getProperty" call (which specified the "lib:D20" token as the source) it is unable to find the lib:D20 token because (it seems) "getProperty" can't access tokens on other maps.
If this is the case then...
Workaround: I could change all the getProperty and setProperty references to another token (e.g. the GM token). If I am correct in the above explanation this should allow the macro to reside in the lib token on the "(Library)" map but access properties on the local map GM token. I believe MapTool will not complain about duplicates unless it is a lib token, so that should work.
Re: Library Tokens
If you want a property off a lib token you need to use getLibProperty() so you don't have to be on the same map to get the property.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools