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 .
×
Create a free account

3.5 Character sheet, "Attributes & Abilities" tab question

1681595245

Edited 1681599405
Hi all! Is there a way to toggle a "Show as Token Action" check box next to an abiity via a script or a macro? Thanks!
1681616939
GiGs
Pro
Sheet Author
API Scripter
You can probably do this with a script (I've never done it), but you can't do it with just a macro. Macros can't make changes, only read the current values of things.
Thanks for the reply. You are correct and I did play fast and loose with the language. In my mind anything that has code is a macro, but especially in the Roll20 environment I should have said script. We use various scripts to modify values all over the character sheet, including some check boxes. But those particular check boxes are seemingly "meta" in the sense that they are not available to any scripting, only for manual manipulation. Have a nice Sunday!
1681708308
GiGs
Pro
Sheet Author
API Scripter
Try using the chatrSetAttrs script. If it is on a character sheet, that script can modify it. And yes, the terms can be tricky, because people put the code for a script inside a macro, and naturally call it a macro.
1681739022
timmaugh
Forum Champion
API Scripter
I can confirm that this can be set from a mod script. The property you are looking for is:  istokenaction . It's the same property whether we're talking about an ability or a macro: (above screenshot from Inspector script) I wrote a little scriptlet just to test whether this could be set by a script, and it did work (if I had the token selected, I had to deselect/select the token in order to trigger the UI change; if it wasn't selected in the first place, then it worked for the next time I selected the token). If you can't figure out the ChatSetAttr syntax to make this happen, post back and maybe the community can help.
Hello Tim, I tried this simple script, but I'm not sure how to indicate to the script that it should act on a prorperty associated with an ability (istokenaction), not the ability itself (BlessOn). There is one "istokenaction" property for each ability, so how to indicate which one to target? I used a Hyphen or a Pipe character, but no result. No error message at all. I tried adding {&log}, but no particular useful message. Finally, I read the ChatSetAttr ReadMe file, and I couldn't find an example like that, the closest I saw was syntax used for repeating rows in the 5e character sheet, but it seemed to use hyphens, which doesn't work here. !setattr --silent --charid @{Réjean|character_id} --BlessOn-istokenaction|1 !!! !setattr --silent --charid @{Réjean|character_id} --BlessOn|istokenaction|1 !!! Thanks!
1681765069
timmaugh
Forum Champion
API Scripter
Yeah... I read through the ChatSetAttr code and there isn't even a reference to an "ability"... which... in hindsight... I guess makes sense for a script named "Chat Set  Attribute ". =D Let me knock a couple corners off my test script tonight to get it release-ready, and I'll share it.
1682176169
timmaugh
Forum Champion
API Scripter
I just posted this script (in beta release, currently) here . Give it a run and let me know if you run into any issues.
Thank you so much, it works exactly as advertised! Just curious, I don't need this, but would it be feasible to include "Show in Macro Bar" in the same script, or is that too different?
1682214350
timmaugh
Forum Champion
API Scripter
Glad it's working for you! And, unfortunately, we can't change the "In bar" setting. That isn't exposed to scripts, only the token action setting... so this is the best we can do.