Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
May your rolls be merry + bright! 🎄
Create a free account

Copying macros from other tokens

I'm experimenting with a sort of inventory system using roll20 pages, using tokens to represent items, and I like that players have the ability to simply click the item token and a macro appears which can be used to list its description/features. However, I'd like the descriptions of items they use very often to be accessible immediately via macros. Are there any mods that could allow me to add another button that would simply copy the description macro from the item onto the player's character, sort of like "attuning", so that it pops up in their token macros? And would it also be possible to remove it in the same way? I'm not super experienced with using APIs so I'm just looking to see if tools like this are around or if anyone else has experience with a similar concept.
If you want to copy Abilities from one sheet to another, CharUtils can do that. But there may be better ways of accomplishing what you're trying to do.  Instead of copying things from one sheet to another, you could simply create a chat menu to reference other sheets, or use other features that may be already included on whatever character sheet you are using.  What game is this for, and which character sheet are you using?
1698165371

Edited 1698165461
It's a 5e game but we don't actually use character sheets, we just use tokens saved as characters and use the macros under attributes and abilities. 
1698189217
GiGs
Pro
Sheet Author
API Scripter
CharUtils should do what you need. A bit of terminalogy: Macros stored on the character sheet arecalled Abilities.
Got it, thanks for the recommendation.
I'm wondering now if it would be easier to simply have universal token action macros and then use an API to let players change the visibility of those macros. Is that possible?
1698244170
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Jack! You can do this by setting permissions on the macro itself, only allowing players with the need for the Action to be able to see it. Unfortunately, this is out of the ability of players to affect, not being creators/owners of said macro. The GM, or a dedicated script, would be required to control visibility. One quick note: if you do wind up using some sort of a script to copy abilities to character sheets, I would suggest writing references to the original macros, not simply copying the code. This will keep your code centralized, so that if you need to edit the code, you only have to do it once.
keithcurtis said: Hi Jack! You can do this by setting permissions on the macro itself, only allowing players with the need for the Action to be able to see it. Unfortunately, this is out of the ability of players to affect, not being creators/owners of said macro. The GM, or a dedicated script, would be required to control visibility. One quick note: if you do wind up using some sort of a script to copy abilities to character sheets, I would suggest writing references to the original macros, not simply copying the code. This will keep your code centralized, so that if you need to edit the code, you only have to do it once. Ah that's a shame. Would I run into the same problem with the "In Bar" button on a macro? I have been experimenting with CharUtils but I haven't found a way to grant a player an Ability without it being copied, or how to remove an Ability with that mod.
ShowButtons can toggle the visibility of Token Actions. It won't remove it from the sheet, but from your player's perspective hopefully that should be sufficient.
Thanks again for the recommendations, I've pretty much got what I was looking for now.