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] GMSheet - a simple GM Cheatsheet to display your party's most important stats at a glance

1524692112

Edited 1530816124
Arthur B
API Scripter
I'm still trying to create something reasonably useful with javascript. Here's my newest attempt: Some kind of simple GM dashboard to display the most important stats for your party (currently OGL sheet only). Something like this: As you can see, it shows if a character has temporary hit points (I always forget about it), if a character is injured, or if he has inspiration (we all  forget about our inspiration - so I put in a green/golden star).  The script can be found  on GitHub . I now better bugger off and go to sleep before anybody has a chance to look more closely to my messy code... ;) Na, just joking - feedback is absolutely welcome! But here's a quick description of all the current features: Roll20-GMSheet Version 0.1.4 A quick GM Cheatsheet for the D&D 5e OGL sheets on  Roll20 . Please use  !gmsheet -h  for inline help and examples. Displayed information The script currently shows name, race, level and (main) class, including the character's avatar inspiration! HP, also indicating temporary hitpoints and injuries speed, passive perception, initiative bonus main abilities + modifiers available spell slots class resources (as stored in the attributes  class_resource  and  other_resource ) Usage Select one or several tokens Type  !gmsheet  in chat
1524692190
The Aaron
Pro
API Scripter
That's really nice looking!  I'm looking forward to trying it... once it has Shaped Sheet support. =D
Won't happen anytime soon, as I'm completely on OGL. But I think most attribute names should be the same anyway, right? Never really looked into the differences in detail...
Just tried it "as is" on my Shaped Sheet testing campaign, and this was the chat output I got: Not terrible - the main attributes are there, plus Race, Level, HP, AC and Speed.  Didn't pick up the class, Passive Perception, or Initiative bonus.  This particular character is multi-classed, I'm wondering how the script handles that.
1524751768
vÍnce
Pro
Sheet Author
Great script.  It's been an often requested feature by GM's.  It would be cool if the attributes used within the script could be made easily accessible(direct editing of the script, or perhaps via specially formatted handout...) so the that you could customize the attributes that are used for your particular sheet.  You know, just "Pie in the sky".  ;-)
1524752167
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I'm not sure a port for Shaped is needed. The sheet has some pretty robust built-in reporting macros.
Gozer the Gozerian said: Just tried it "as is" on my Shaped Sheet testing campaign, and this was the chat output I got: Not terrible - the main attributes are there, plus Race, Level, HP, AC and Speed.  Didn't pick up the class, Passive Perception, or Initiative bonus.  This particular character is multi-classed, I'm wondering how the script handles that. Yeah, I haven't implemented any multi-class support yet. Also on my todo-list ;) But thanks for checking it – it seems like it's really just some slightly different attribute names that I have to take care for. I wonder if I could use that for auto-detecting the sheet type... and how reliable that would be, considering some people might have switched from one sheet to another at one point. Vince said: Great script.  It's been an often requested feature by GM's.  It would be cool if the attributes used within the script could be made easily accessible(direct editing of the script, or perhaps via specially formatted handout...) so the that you could customize the attributes that are used for your particular sheet.  You know, just "Pie in the sky".  ;-) Well, I can't post complete forms in chat, afaik. So it would be some rather clunky approach with API buttons in the chat window... and then I don't see any benefit over just editing things in the proper sheet directly. Or am I missing something?
keithcurtis said: I'm not sure a port for Shaped is needed. The sheet has some pretty robust built-in reporting macros. If I find an easy way to auto-detect the sheet type, then it shouldn't be a big thing to add the support. Otherwise I agree with you.
1524753194
The Aaron
Pro
API Scripter
Arthur B said: Vince said: Great script.  It's been an often requested feature by GM's.  It would be cool if the attributes used within the script could be made easily accessible(direct editing of the script, or perhaps via specially formatted handout...) so the that you could customize the attributes that are used for your particular sheet.  You know, just "Pie in the sky".  ;-) Well, I can't post complete forms in chat, afaik. So it would be some rather clunky approach with API buttons in the chat window... and then I don't see any benefit over just editing things in the proper sheet directly. Or am I missing something? I think he's talking about the format of the output, like having a handout that sets up a template or something: [AVATAR] [NAME_FULL] [{race} Lvl {level_full} {class_list}] HP: [{hp}/{hp|max}] ... That sort of thing.
I don't know how the Shaped sheet does Passive Perception.  There's an option to show passive skills on the character sheet, but I can't for the life of me find an Attribute linked to Passive skills.  My guess is that they are calculated with sheetworkers, rather than defining an attribute, but I could be wrong about that.
The Aaron said: Arthur B said: Vince said: Great script.  It's been an often requested feature by GM's.  It would be cool if the attributes used within the script could be made easily accessible(direct editing of the script, or perhaps via specially formatted handout...) so the that you could customize the attributes that are used for your particular sheet.  You know, just "Pie in the sky".  ;-) Well, I can't post complete forms in chat, afaik. So it would be some rather clunky approach with API buttons in the chat window... and then I don't see any benefit over just editing things in the proper sheet directly. Or am I missing something? I think he's talking about the format of the output, like having a handout that sets up a template or something: [AVATAR] [NAME_FULL] [{race} Lvl {level_full} {class_list}] HP: [{hp}/{hp|max}] ... That sort of thing. Ah, now I get it. A template for the output. Sorry, I completely misunderstood it before... Won't work with the way I set it up right now, but maybe I should change that anyway. I like the idea of having a template for that... 
1524753959
The Aaron
Pro
API Scripter
They're in a repeating group, like skills.  Repeating group attributes don't show up in the Attributes and Abilities tab.  There are other complications as you really need to be able to say something like "The repeating_skills_*_passive where repeating_skills_*_name is 'perception'." which is a little non-trivial.
1524754908
Jakob
Sheet Author
API Scripter
I think the Shaped sheet specifically creates non-repeating attributes from skills. It should create a "perception" attribute, which should make getting passive perception easier, and if the "passive" toggle is active, it also creates a "passive_perception" attribute. I think level and class correspond to the "class_and_level" attribute, and initiative to the "initiative" attribute.
1524755085
The Aaron
Pro
API Scripter
Hmm. I'll be darned, you're right!
Yeah, guys... guess I stick with the OGL support for now... XD
Ok, I've fooled around with changing the attribute names to match the Shaped Sheet attributes, and this is the output I've gotten it to so far: You have to make sure the Passive attributes have been generated for the sheet, or they'll come up as undefined.  The Shaped Sheet lumps class and level as one attribute (aptly named "class_and_level"), so I had to remove one of those, otherwise, the rest is simple substitution.  I still can't figure out Inspiration or spell levels yet.  And characters with a 10 attribute (+0 bonus) don't seem to get recognized, not sure why this is.
1524763407
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thanks for the detective work on generating passive scores. I wondered why I could never find them.
1524770643

Edited 1524770888
Finderski
Pro
Sheet Author
Compendium Curator
Arthur B said: keithcurtis said: I'm not sure a port for Shaped is needed. The sheet has some pretty robust built-in reporting macros. If I find an easy way to auto-detect the sheet type, then it shouldn't be a big thing to add the support. Otherwise I agree with you. Well...there as a conversation a while about having a common attribute (character_sheet) that identifies the character sheet and the version number. I thought the Shaped sheet made that modification, but I could be wrong about that...? EDIT: Yes, it does.  When I loaded the Shaped Sheet to a campaign and output the value of @{character_sheet} to the chat, I got this in response: Shaped v17.0.5
1524775201
The Aaron
Pro
API Scripter
I was working on an API library to do sheet detection... I should finish that up...
1527222783

Edited 1527222812
This script is amazing! Would there be any way for you to give this script the ability for the GM to designate who the party  is, so they can !gmsheet to check up on the party  without selecting all the tokens?
1527248763
GiGs
Pro
Sheet Author
API Scripter
This script was a great idea. I had to rewrite a lot of it for my Pendragon campaign, but it gave a solid foundation: It's a new campaign so the characters have placeholders in place of portraits and don't have proper descriptions yet, but it looks good! Thanks for the idea and framework.
I just published v0.1.3 here. No big changes. I added proficiency bonus plus the class abilities (like rage, sorcerer points etc.) and some minor output changes when it comes to the HP output.
1530716506

Edited 1530716601
Bug report (I think?).... The sheet is reporting Channel Divinity for a Paladin player of mine.  Considering he's only level 2, this is incorrect.
Hi all, I don't do much scripting, but my brother who is totally unfamiliar with Roll20 knows JavaScript quite well. I am trying to get some information together as I would like to get my brother to edit this to include All Skills. I am seeing some edits here that show people adding more skills, but I am not sure where specifically to put those into the base code. Is there anything I can tell him that would make it easier to figure out? I am guessing there is some specific name to skills that the script has to reference.
1530813273
The Aaron
Pro
API Scripter
Currently, the skills are hardcoded.  Look at line 64: output += '<br><br>Speed: ' + resolveAttr(cid, 'speed').current + ' ft, Passive Perception: ' + resolveAttr(cid, 'passive_wisdom').current + '<br>Initiative bonus: ' + (resolveAttr(cid, 'initiative_bonus').current > 0 ? '+' + resolveAttr(cid, 'initiative_bonus').current : resolveAttr(cid, 'initiative_bonus').current) + ', Proficiency ' + (resolveAttr(cid, 'pb').current > 0 ? '+' + resolveAttr(cid, 'pb').current : resolveAttr(cid, 'pb').current); Your brother probably wants to make his changes around that area.  Either by increasing the hard coded list of skills, or doing something a bit more dynamic.
1530814808

Edited 1530816168
Arthur B
API Scripter
Hi Craig L.,  yeah, that was actually quite a stupid mistake from my side. I'll fix it and will release a new version later. Edit: Fixed in v0.1.4 now. Craig L. said: Bug report (I think?).... The sheet is reporting Channel Divinity for a Paladin player of mine.  Considering he's only level 2, this is incorrect.
The Aaron said: Currently, the skills are hardcoded.  Look at line 64: output += '<br><br>Speed: ' + resolveAttr(cid, 'speed').current + ' ft, Passive Perception: ' + resolveAttr(cid, 'passive_wisdom').current + '<br>Initiative bonus: ' + (resolveAttr(cid, 'initiative_bonus').current > 0 ? '+' + resolveAttr(cid, 'initiative_bonus').current : resolveAttr(cid, 'initiative_bonus').current) + ', Proficiency ' + (resolveAttr(cid, 'pb').current > 0 ? '+' + resolveAttr(cid, 'pb').current : resolveAttr(cid, 'pb').current); Your brother probably wants to make his changes around that area.  Either by increasing the hard coded list of skills, or doing something a bit more dynamic. Sesserdrix, TheAaron is right (as always). I handpicked some of the skills that I needed as GM all the time. But it's rather easy to add whatever skill you need. There was a proposal for a more dynamic, template-based output, but I'm currently too busy with real life stuff to take care for any big changes. But when things are getting better, this is definitely something I'll have a look into!
Hi Craig L.,  yeah, that was actually quite a stupid mistake from my side. I'll fix it and will release a new version later. Edit:  Fixed in v0.1.4 now. Craig L.  said: Bug report (I think?).... The sheet is reporting Channel Divinity for a Paladin player of mine.  Considering he's only level 2, this is incorrect. Woot!  Thank you, sir!
1530822977

Edited 1530823184
Arthur B said: The Aaron said: Currently, the skills are hardcoded.  Look at line 64: output += '<br><br>Speed: ' + resolveAttr(cid, 'speed').current + ' ft, Passive Perception: ' + resolveAttr(cid, 'passive_wisdom').current + '<br>Initiative bonus: ' + (resolveAttr(cid, 'initiative_bonus').current > 0 ? '+' + resolveAttr(cid, 'initiative_bonus').current : resolveAttr(cid, 'initiative_bonus').current) + ', Proficiency ' + (resolveAttr(cid, 'pb').current > 0 ? '+' + resolveAttr(cid, 'pb').current : resolveAttr(cid, 'pb').current); Your brother probably wants to make his changes around that area.  Either byincreasing the hard coded list of skills, or doing something a bit more dynamic. Sesserdrix, TheAaron is right (as always). I handpicked some of the skills that I needed as GM all the time. But it's rather easy to add whatever skill you need. There was a proposal for a more dynamic, template-based output, but I'm currently too busy with real life stuff to take care for any big changes. But when things are getting better, this is definitely something I'll have a look into! Thank you both! That is super helpful for someone as script incompetent as I am. :D Nevermind the question I had in here, apparently he can see the names in the website. Stuff is way over my head. Thank you both again!
1533658300
Pantoufle
Pro
Sheet Author
Translator
Hello, nice script ! :) Is there a way to avoid API console errors if the script doesn't find attributes ? (lvl3 spell slots when you are lvl1 for instance etc) nothing big but wanted to know :)
Hi, unfortunately I haven't found a way around it yet. I know it's quite annoying when the console is flooded with error lines, but right now there doesn't seem a way to suppress those. :-(
1533671438

Edited 1533671617
GiGs
Pro
Sheet Author
API Scripter
For the spell slot error, you can probably add after line 82/3: spellLevelTotal = resolveAttr(cid, 'lvl' + parseInt(i, 10) + '_slots_total').current; if(spellLevelTotal === undefined) break; That will exit the While loop there. This is untested. But if thats where the script is generating invalid attribute names, something like this weill work. You need to identify exactly what the spellLevelTotal variable is when the attribute doesn't exist. I've guessed that it is  undefined , but it might be something else. Construct the check accordingly. Also I'm guessing it's the spellleveltotal variable that is erroring out - i dont know the sheet, but the problem will be in that section somewhere. To handle the more generic case, you probably need to restructure the script quite a bit. You use resolveAttribute.current or .max a lot, without checking if the attributes exist. It would be better to have a wrapper for resolveAttribute that checks if the attribute exists (or rewrite resolveAttribute to do it internally and report undefined or error if it doesnt exist), and then would need to rewrite every place in the script were resolveAttribute exists, to account for missing attributes. That's probably going overboard though - since this is for a specific sheet, you know most of the attributes should always exist. If spells are the only ones that sometimes dont exist, then something like the approach I state at the start of this post should be fine.
G G, I think you're right. I need to rewrite the resolveAttr routine. I'll have a look into this now (the last two weeks were just too crazy here IRL - family visit from overseas plus an attention-seeking toddler plus Roll20 is too much to handle for me right now ;)) 
Great script, I was able to adapt it for the Starfinder official sheet here's an out put: