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

[Request] API Jukebox interface

Realizing that it would be several small scripts, is there anyone writing scripts to play sound effects? This would be great if a macro callable script was available for certain stock sounds, gunshot, sword, raygun... To add it into player macros, would really be fabulous, sadly, I am "illscriptorite"...
1442948058
The Aaron
Pro
API Scripter
I'll probably start working on something like that soon.  =D
1442948188
The Aaron
Pro
API Scripter
Let's spec out what it should do.  Thoughts: !play <something that matches a sound name or folder name> Plays the matching sound or sound collection !play --grant <something that matches a sound name or folder name> Grants players the ability to play the matching sound or sound collection !play Lists available sounds (for the current user) with API Buttons to play them.
I was just looking for something like !gunshot that played the sound when appended to a standard attack macro: /emas @{selected|token_name} &{template:attack} {{name=Makarov}} {{rollValue=[[1d20 + ?{AC|0} + @{Aaron Aardvark|attack_bonus} + 1 + @{Aaron Aardvark|dexBonus} + ?{Other Modifier|0}]]}} {{damage=[[1D6+1]]}} !gunshot
1442970812
The Aaron
Pro
API Scripter
The main problem with that would be coming up with a way to match !gunshot to something.  In my proposed interface, you'd have instead: /emas @{selected|token_name} &{template:attack} {{name=Makarov}} {{rollValue=[[1d20 + ?{AC|0} + @{Aaron Aardwolf|attack_bonus} + 1 + @{Aaron Aardwolf|dexBonus} + ?{Other Modifier|0}]]}} {{damage=[[1D6+1]]}} !play gunshot Now we have a command that tells it what it's doing, and an argument it needs to find the thing to play.
That makes more sense. That's why you are der scriptmeister. I didn't realize when I took a macro from the first NPC, that it would be named Aaron... He is the facilitator in the intro sessions for my SWN game.
Interesting. I think its very useful to have an api to have. Certainly it allows certain sound boards to be made. I like the principle behind it. I cant think of anything else to add to the jukebox api function
1443011264
The Aaron
Pro
API Scripter
That bug with the jukebox where a non-looping sound plays again on any change seems to still be present (I thought that got fixed?), that might cause some issues, we might want to limit the playback time of sound effects, or provide an option for that. Plays for 1 second, then turns it off: !play gunshot Plays for 5 seconds, then turns it off: !play --5 gunshot I'll look into it further this weekend.  This should be a pretty fast one to turn out.
You are the best Aaron, I look forward to seeing what the API Wizard does.
Following!
1443168660
Scaby79
Sheet Author
API Scripter
Very nice, Aaron! I'm looking forward to this!
1443169322
Scaby79
Sheet Author
API Scripter
Is it maybe possible to implement a function that stops all (or even individual) tracks, that are currently playing? Like  !stop gunshot or !stop all That would be awesome and could be used as a workaround till the issue is fixed, that non-looping tracks remain in the now playing section. And it could be used in combination with the move-players-script from Aaron. At the moment tracks that are assigned to a page are only triggered when you move the player ribbon by drag-and-drop and NOT by using the move-players script. So one could combine  !move-players-to-same-pages-as @{selected|tiken_id} !stop all !play darkforest or something like that!
1443169399
Scaby79
Sheet Author
API Scripter
btw. how do you use the "terminal" boxes with cleartype fonts in posts here?
1443179311
The Aaron
Pro
API Scripter
Those are great ideas! (You make the source code boxes by selecting some text and clicking the Paragraph symbol at the left edge of the edit tool bar above the text box and choosing "code".)
I usually rename my tracks, so it would be great if this script would work with the names of the tracks as they are in your own jukebox.
1443184246
The Aaron
Pro
API Scripter
Yup!  The API has access to that name only, in fact.
1443202981
Gold
Forum Champion
How about something like, any time a "20" is rolled on a d20, !play sound "You Rolled a Natural 20!" (or like a jackpot sound).  In another thread someone has asked for 1's to make "sad trombone" play. Is that the same script idea, or different?
1443207291
DK Heinrich
Marketplace Creator
Sheet Author
/following
It's possible. You'd just have to check the msg object every time there's a roll and then sort through for possible crits. 
I support this idea. I do think it'd be nice if the developers made this a real thing instead of relying all to much on API (my experiences with this is horrid). Many great and fun things can be accomplished with this idea :)
1443793274
DK Heinrich
Marketplace Creator
Sheet Author
odd, my experiences with API have been great - and I am almost giddy at what the script-masters might come up with this.