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] Looking for a script to add sounf FX

I love to put sound effects inside my game. Besides music and ambiental sounds I use Roll20 AM script to trigger sounds as part of an attack (simply attaching a sound from the jukebox to the attack macro of the token I'm using). Same to dead screams, for which I use EasyXP script to both assign XP to players and play the sound of the dying creature. I've uploaded many custom FX on the jukebox and applied a raw and naif solution to randomize them. So, I have for example 5 different battlecries for humanoids: battlecry 1, battlecry 2... etc... Inside the attack macro of the enemies I simply put this: !roll20AM --play|battlecry [[d5]] This works fine (even though sometimes sounds don't play for some reason). I'm sure somebody have made a script for something like this and to add sounds for critical hits and stuff like that. Could somebody suggest me an appropriate script (if it exists) to do this? 
1507761675
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
There is a  Roll Listener script you can look for that triggers actions for critical hits and fumbles.
1507762614

Edited 1507762628
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yep, this is actually why I made CRL. It was originally going to be internal to Roll20AM, but it was easier to code as it's own entity. Note that there are some reported bugs with it that I just have not had time to track down.
Could you give me an example of the syntax for an hypothetical critical hit sound on an attack die roll of 20? 
1507764458
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
At it's most basic: !crl \\create,name=Critical Sword,text=##,roll=critical \\!roll20AM --play|critical sword track The above will respond to any critical roll, which isn't really ideal, but is a nice simple example.  You've also mentioned that you are using the 5e OGL sheet. You can limit the script to only respond to messages using a given template, like the atk template: !crl \\create,name=Critical Sword,template=atk,text=##,roll=critical \\!roll20AM --play|critical sword track Now this will only play on a critical that is in a &{template:atk} message. We can specify it even further though by adding some text that is required to be part of the message: !crl \\create,name=Critical Sword,template=atk,text={{r1=##}},roll=critical \\!roll20AM --play|critical sword track This will now only play when a critical is detected in the roll contained within the r1 template field. You would of course need to add a listener for r2 as well.