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] Hero Roller

1617297904

Edited 1617297978
I've just started GMing a Champions game for a bunch of players new to the system, and am using Hero Roller. I must say I like it much better than the dice rolling mechanism built into the player character sheets. In fact, I'd like to replace the character sheet rolls by setting the 'Custom Action' field in the player's (and NPC's) powers so it uses hero roller instead. This *mostly* works. The problem is that HeRoller either doesn't find the OCV for the character, or takes the OCV of the last speaker, rather than the current character sheet. I understand that it may be difficult (or impossible) to automagically detect that a API call is being launched from a character sheet, so I was hoping that someone who isn't quite so new to Roll20 and javascript could add a new option like '--as' so that one could put in an entry like: !heroll --as:Heretic --d:4d6k --pn:Sword of Cuisinart And have the code successfully determine the OCV to use.
1617301923
timmaugh
Forum Champion
API Scripter
I could probably do that for you. Seeing as I wrote it. =D Let me see what I can put together for you. (and that's exactly how I would use the script, too... as a Custom Action on the sheet.)
1617387770

Edited 1617388304
timmaugh
Forum Champion
API Scripter
Here you go, Stirling... I uploaded it to my personal repository . There was more to change than just where it pulled the OCV from; if you specify a source for the power, it will now also pull the character's name (for the top of the chat output panel) as well as the value of the location selection on that character's sheet (which can obviously still be overridden).  I did a little testing and everything looks good, but you should give it a try and let me know if you run into any problems. If we're good, I'll push it to the Roll20 repo. ...although, it reaaaaaaalllllllly could use a refactor. =D EDIT: Forgot the syntax. Either of the following will work anywhere in your command line: --as: --source: ...and, for either, you can supply a character name, character id, or token id (provided it represents a character), and it should resolve.