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

[Script] TokenAction creator for the 5th Edition OGL sheet

This is a simple script that takes anything defined in the "Attacks & Spellcasting" section on the 5th Edition OGL sheet: and automatically makes a character ability macro, allowing it to be selected as a token action from the Abilities & Attributes tab of the character journal: Simply select the token that represents the character and type "!ta" from the chat box, then open the character journal and switch to the Abilities & Attributes tab and select the abilities that you want shown as token actions: The script is located here: <a href="https://raw.githubusercontent.com/beeke01/TokenAct" rel="nofollow">https://raw.githubusercontent.com/beeke01/TokenAct</a>... NOTE: &nbsp;There currently is one limitation that I haven't found a reasonable solution for, essentially I had to use the "full" roll template, meaning it will always automatically roll damage regardless of the option set for the character. &nbsp;Due to the different varieties of the roll templates it is difficult to account for the differences based on the types of attacks and spells defined there, but hopefully this is helpful for some GMs. A huge thank you to The Aaron who helped me understand many aspects of javascript, the Roll20 API, and provided a great framework to build the script around.
1454982840
The Aaron
Pro
API Scripter
Cool! &nbsp;Happy to help!
Can this be used to work for other sheets similar to the OGL? EG Kryxs Shaped 5E ?
1455031135
The Aaron
Pro
API Scripter
It should work fine for other sheets, you'd just need to change this line at the bolded sections to whatever matches the sheet in question: repeatingAction = "%{" + characterName + "| repeating_attack_ " + repeatingId + " _attack_full }",
1455031970
Kryx
Pro
Sheet Author
API Scripter
Kevin and I looked at this. I'll be adapting it to the Shaped scripts when I redo those. Just remove _full and it'll work currently though.
I am also making one for the Shaped sheet, though I am still puzzling out how to handle spells efficiently. &nbsp;Currently I have a script that will add all attacks and optionally all spells. &nbsp;Given that a players spellbook could get rather large rather quickly, would be better to have an option to pick which spells you want to create token actions for, rather than add all of them. &nbsp;It is something I am tinkering with, but haven't had much time to dedicate to it. As Kryx said, seems like a good tool to add as part of the shaped scripts as a whole.
If you want to not roll damage, just change _attack_full to _attack_pick repeatingAction = "%{" + characterName + "|repeating_attack_" + repeatingId + "_attack_pick}",
Mark R. said: If you want to not roll damage, just change _attack_full to _attack_pick repeatingAction = "%{" + characterName + "|repeating_attack_" + repeatingId + "_attack_pick}", The problem however is when you start mixing in spells and attacks, because in my testing _attack_pick didn't work for spells like Fireball.
1455306371

Edited 1455306423
So I have a solution to the problem of automatically rolling damage and can automatically create appropriate token action macros based on the sheet configuration. &nbsp;However, there seems to be a bit of a problem with newly created Attacks where the "atkflag" resource, which is necessary to determine the proper macro syntax, is not available to the API. &nbsp;Details are in this post: &nbsp; <a href="https://app.roll20.net/forum/post/2918869/5th-edit" rel="nofollow">https://app.roll20.net/forum/post/2918869/5th-edit</a>... If this problem gets resolved, I will post an update to the script removing the current limitation.