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

Asking for help in getting an API that will play jukebox tracks automatically when certain things happen/macros used

I have seen a couple APIs that allow you to make macros that will roll dice and also play a pre-selected track (greatsword attack and damage dice while also making a sword clash sound) I was curious if someone could help me expand on that concept by making the OGL character sheet macros able to play certain tracks.  Examples of things I would like to do are: Death save Success Death save Fail Third death save success marked Third death save fail marked 0 hit points reached Inspiration gained/used Attack/spellcasting macro used If this is at all possible to achieve and if anyone would be willing to help me make it happen that would be super great and amazing. I understand I have to find and then select the tracks I want to be played, I just dont understand how to craft an API script to do what I am interested in having it do.
Here's something. For the drop to 0, make sure the sheet is assigned (even to you, the GM). I dunno how to check sheet events, or if we can. So, for example, having inspiration on or off is an attribute, but checking for that, or if it is an event is unclear to me. For spells and attacks, I usually make them token actions, with sound commands in the token action. It might be workable with this script though. Warning! no effort on my part to be careful, or error check. Make sure all sounds are in game, and appropriately named before trying this! <a href="https://gist.github.com/Bastlifa/9f8567d2ceb9c102f" rel="nofollow">https://gist.github.com/Bastlifa/9f8567d2ceb9c102f</a>...
I hate to be a bother but I am unable to get any of the sounds to play.I have renamed tracks to the titles you put in the script and tried refreshing the api sandbox but have not been able to get them to play.
1526876580

Edited 1526876649
Bast L.
API Scripter
Oh, I should've mentioned, it requires the OGL companion script (from the dropdown) to work So when you click "Death Save" from the sheet, it has the output which this script checks for. Edit: Although the "DropToZero" thing should play regardless. Edit again: assuming you use bar 1 (green) for HP
yeah I have the companion script on, I also have an api that plays sounds on a nat 1 or 20 could that be interfering?
Hmm, shouldn't be an issue. I would invite you to my script test game if you want to see it set up in mine. Maybe we can figure out what's different.
that would be cool if you would
PM sent
1526880648

Edited 1526973570
Bast L.
API Scripter
Well, we discovered that the issue was the sheet. Though he had selected 5E OGL by Roll20, and even tried switching to another and back, it was some older, SRD5 sheet, which didn't seem compatible with the 5E companion script (wouldn't output death save results, for example). In case anyone wants to use my crummy script here, it seems to work with the actual 5E OGL sheet, (the one without the legalese at the bottom, and which says dungeons and dragons at the top left, rather than SRD5), along with the 5E OGL companion script. It seems to work with OGL sheet with the companion script working.