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

Use of istokenaction on a character sheet

1533015935

Edited 1533015982
Mike W.
Pro
Sheet Author
Is it possible we can use the method for istokenaction, from the Attributes & Abilities section, on a character sheet? I would like to have a similar check box and function on a character sheet for the macros contained within. I have a whopping 2 weeks of experience with HTML5 and CSS so if this is possible, I have no idea on how to do it. Can it be used? Thanks for your time
1533048912
Diana P
Pro
Sheet Author
In the html, you can hard-code a roll-button to be a token action by giving it class="tokenaction"  ie: <button class="tokenaction" type="roll" name="attr_initroll" title="initroll" value="@{initiative}"></button> This creates that button as a token action for *every* token linked to a character sheet for that character sheet template.  As a result, it probably should be used sparingly in sheets submitted to the official repository since not everyone wants the same actions linked to tokens and (as far as I know) it cannot be turned off without editing the html.  For the sheets that I have created, the only roll I turn into a token action is the initiative since it needs to be rolled with the token selected anyway to put the values in the turn tracker. Sorry no wiki link on this, just realizing that I have no idea where I first saw this; possibly in a forum thread back when character sheet templates were first being released.
1533053896
vÍnce
Pro
Sheet Author
"Why can't I delete my Initiative ability macro?..." ask Diana ;-P
1533058100
Mike W.
Pro
Sheet Author
So there is no way to make it work like it does under Attributes & Abilities? Ideally it would be nice to have the functionality, with the capability of limiting the Token Action's name to say 15 characters (Trimming the existing name of the skill or combat action for instance).
1533058856

Edited 1533058925
vÍnce
Pro
Sheet Author
Mike W. said: So there is no way to make it work like it does under Attributes & Abilities? How do you mean Mike?  Are you wanting checkbox inputs on the sheet that that would toggle adding an appropriate token ability macros? I played around with tokenaction in the past trying to find a way to make it optional via a checkbox setting on the sheet, but I was never able to make it work since tokenaction must be written into the html of the sheet (see Diana's example above). istokenaction however may be something different as it relates to the API correct?
1533058935
Mike W.
Pro
Sheet Author
Vince said: Mike W. said: So there is no way to make it work like it does under Attributes & Abilities? How do you mean Mike?  Are you wanting checkbox inputs on the sheet that that would toggle adding an appropriate token ability macros? I played around with tokenaction in the past trying to find a way to make it optional via a checkbox setting on the sheet, but I was never able to make it work since tokenaction must be written into the html of the sheet (see Diana's example above). Exactly Vince
1533060342
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Vince said: Mike W. said: So there is no way to make it work like it does under Attributes & Abilities? How do you mean Mike?  Are you wanting checkbox inputs on the sheet that that would toggle adding an appropriate token ability macros? I played around with tokenaction in the past trying to find a way to make it optional via a checkbox setting on the sheet, but I was never able to make it work since tokenaction must be written into the html of the sheet (see Diana's example above). istokenaction however may be something different as it relates to the API correct? Yep, but the API can't modify sheet roll buttons.
1533062853
GiGs
Pro
Sheet Author
API Scripter
If you're making the sheet with the intention to make it public later, it';s a good idea to avoid adding token action buttons. They aren't optional, and most people like to choose what buttons appear on their tokens. With this feature, players and GMs cant switch them off or manipulate them in any way, and are forced to have them on every token linked to a character. They get inconvenient fast.
1533065188
Mike W.
Pro
Sheet Author
What I was looking for was the capability that is available under Attributes and Abilities for "Show as Token Macro" A check box. when checked, will create a Token action macro button using the macro as designed in the character sheet for that assigned Token..
1533088894
James W.
Sheet Author
API Scripter
Currently there is no way to allow players to mark individual character sheet roll buttons as token actions, but this would certainly be something you could request in the Suggestions & Ideas forum, and I'm sure many would agree that this would be a welcome addition.
1533155526
Mike W.
Pro
Sheet Author
Vince said: I played around with tokenaction in the past trying to find a way to make it optional via a checkbox setting on the sheet, but I was never able to make it work since tokenaction must be written into the html of the sheet (see Diana's example above). istokenaction however may be something different as it relates to the API correct? Vince If you ever get that to work, please let us know. In the mean time I will try making this a suggestion.
1533155967
Mike W.
Pro
Sheet Author
Update I found an existing suggestion from 3 years ago requesting this specific option <a href="https://app.roll20.net/forum/post/1244874/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/1244874/slug%7D</a> It was said, 3 years ago, that this could not be done and the suggestion was closed (mainly because it also include the Drag-and-Drop method to the Macro Bar which does work). So I guess we are out of luck.
1533161921

Edited 1533162352
vÍnce
Pro
Sheet Author
Mike W. said: Vince said: I played around with tokenaction in the past trying to find a way to make it optional via a checkbox setting on the sheet, but I was never able to make it work since tokenaction must be written into the html of the sheet (see Diana's example above). istokenaction however may be something different as it relates to the API correct? Vince If you ever get that to work, please let us know. In the mean time I will try making this a suggestion. Maybe the Devs could add istokenaction to character sheet's.&nbsp; I'm not really sure how you would actually link an attribute that uses istokenaction with the corresponding tokenaction attribute. I'm sure it could be done.&nbsp; Any ideas, Jakob, Aaron, Steve K. anyone?
1533198472

Edited 1533198497
James W.
Sheet Author
API Scripter
If they say it can't be done, then the only work-around would be to manually create your own abilities that call the character sheet abilities, and set them as a token action, which is basically what I do.&nbsp; When I'm feeling particularly lazy, I drag the character sheet button onto the macro bar, click that, then press the up button while in the chat box, which will bring up the previous command given; in this case, the character sheet ability you just used.&nbsp; Then you can copy &amp; paste that into the ability you're creating.&nbsp; If you replace your character's name with "selected" (as in "%{Bob the Terrible|Fort-save}" becomes "%{selected|Fort-save}"), then it becomes generic and you can copy that from character to character. The one thing to keep in mind is that you shouldn't name your abilities the same as the name of any character sheet ability; if you do that, Roll20 won't know which one to use when called, and it will cause unpredictable behavior.&nbsp; If you really want to use that name, put "&amp;NoBreak;" (without the quotes) somewhere in the name; it won't be visible on the token action button, but it'll keep the names from being the same.