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

[5E OGL by Roll20 Companion] quiet disables longrest function

1585843563
Chris M.
Pro
API Scripter
Trying to use the "!longrest" command for this API script I found it wasn't working in our game after testing it successfully in a demo game.  Looking at the code I can see that the logic requires spelltracking to be set to "on" instead of "on or quiet" (or "not off").  This means for "quiet" spell tracking is still happening but the "!longrest" functionality does nothing which seems counterintuitive. Is anyone able to confirm if this was an intentional choice? There are a few ways I can address this so trying to decide on the "best": use ChatSetAttr for all of longrest functionality (not ideal, less scalable) turn spellcasting to "on" (not ideal, noisy and Wizard doesn't want to announce available slots) fork the API and update the logic to what I want update the API code logic and submit to github any other suggestion? I'm obviously leaning towards #3 / #4 (#3 I can just do right away) but trying to understand if #4 is valuable.  I haven't submitted anything prior so would have to read all about that but could do so if beneficial.
1585844318

Edited 1585844433
Are you just typing !longrest or adding a player name at the end? !longrest @{selected|character_name}
1585844817
Chris M.
Pro
API Scripter
Adding a player name.  I did a test with the same command having spelltracking set to "on" then "quiet" and observed it working for "on" but not "quiet".  Then I looked at the API code and confirmed the logic only looks for the value to be "on" (from v1.4.1 on github):
1586182528
Chris M.
Pro
API Scripter
Closing this out I went with option #3 and forked a local copy - it also gave me the opportunity to add some functionality such as removing unconscious / bloodied status markers without installing another API script.  Looks like the companion hasn't been updated in quite a long time and the author doesn't post to the forums anymore so I'm less concerned about updates. If anyone wants to make the changes themselves and have !longrest work with spell tracking set to quiet just copy the script code, paste it as a new script, and update line #73 (shown above) to the following: if(state.FifthEditionOGLbyRoll20["spelltracking"] !== "off") {
1586197549
Dumbhuman
Pro
Marketplace Creator
That seems like such a simple yet needed change that I really hope someone can guide you through the process of getting it into the official Roll 20 API Script Library version of the Companion script. 
1586203807
Chris M.
Pro
API Scripter
Yeah I can figure that out fairly easily but I wasn't sure if there was some background on why the script was implemented this way.  Often what seems like a common sense change actually breaks intended functionality. That said will submit for review after I take a look at the docs on how to do so later this week.  Will submit the following updates - the rest of the changes I made were more personal preference based on how I'm running the campaign. allow !longrest to work when spell tracking is set to any value besides "off" clean up death saves so that a critical failure ticks both fail circles
1587352398
Chris M.
Pro
API Scripter
Code submitted and merged - these two changes should now be in the latest one-click version from what I can see