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 .
×

The new D&D 2024 sheet is now available!

Create a free account

Function call that identifies sheet name/game type?

1700324492
Villain in Glasses
Pro
Sheet Author
API Scripter
Hi, I wonder if there is a function call that I could use that would identify the character sheet being used? I haven't had luck reading through the wiki and existing mods. The reason I'm asking is related to the mod Hero Roller. It was designed to be used with one sheet (HeroSystem6e), but is mostly compatible with another (HeroSystem6eHeroic). If I could identify which sheet was being used, I could probably update Hero Roller with an if or switch statement to handle the few differences between them instead of trying something more involved. Thanks for the help. :-)
<a href="https://app.roll20.net/forum/post/11690987/conditional-api-load-based-on-which-character-sheet-is-loaded/?pageforid=11691026#post-11691026" rel="nofollow">https://app.roll20.net/forum/post/11690987/conditional-api-load-based-on-which-character-sheet-is-loaded/?pageforid=11691026#post-11691026</a>
1700335017
timmaugh
Pro
API Scripter
Hey, ViG.... Hero Roller should be* compatible with most sheets since you construct the power/skill command line. I don't even think it uses the template from the sheet. * - I know, this phrase is doing a LOT of work in this sentence. I am the author of Hero Roller, so if you can articulate what you need, I can probably mod the script and release it so everyone can benefit.
1700336944
Villain in Glasses
Pro
Sheet Author
API Scripter
Thanks, Jarren. It looks like I'm not alone. Hi timmaugh, It's great that you saw my post. There is an issue when Hero Roller tries to get CVs. For instance, my sheet doesn't use "ocv_base" and "ocv" is lower case. The latter is a pain because the Hero Roller doesn't find it and creates a new variable "OCV" set to 0. I don't really want to change the case of each CV if I can avoid it. In the end, it's not a deal breaker, but it makes the hit DCV value incorrect. I could create a hidden variable that identifies the sheet type. This would be a specific fix, but I think it would work. It would require two calls for attributes however. The first to see if this hypothetical sheetID existed. Maybe Supernotes' implementation is good compromise, but existing HeroSystem6e games could be affected. A default to that sheet would likely be the best choice.
1700340550
timmaugh
Pro
API Scripter
ah... fair point. I had forgotten that it go that info from the sheet. I can add a configuration step to the script to let the GM pick the sheet (and/or declare a set of attributes for a custom configuration if they're using a homebrew sheet). Once declared, it will be stored in the state object so it will persist between games. Let me see what I can do...
1700344829
Villain in Glasses
Pro
Sheet Author
API Scripter
Cool. Let me know if I can do anything on my end. I'd be happy to add the hidden variable sheet ID if needed.