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

Spells and attacks that make sounds?

Is there a way to add sounds to attacks/spells without the DM having to manually select it in the jukebox screen every time?
With the right API and macros like this  %{selected|meleeattack3} !sfx volume:75 song:Stab action:play /fx missile-blood @{target|token_id} /em stabs at @{target|token_name} with their shortsword!
1576163151

Edited 1576163212
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I don't think the !sfx script is available in the one-click API library, but Roll20 AudioMaster will perform the same function and a lot more. If you are using the D&D 5e by Roll20 sheet, you could place the following code into the description field of the spell or attack. Those extra lines and characters are in there for inscrutable reasons: }} !roll20AM --audio,play|Name_of_Sound ! Unfortunately, that has some drawbacks. According to reports, it "stops the sheet from applying global damage modifiers, tracking spell slots or ammo" Scripter Scott C. offers this advice : Scott C.  said: Unfortunately, the ogl sheet changed the order of it's default fields. This means that hack I developed no longer works. The only way to do it now is to make a custom ability that calls each attack/spell roll and appends the Roll20 call. Something like this: %{my char|acrobatics} !roll20am --audio,nomenu,play|Grunt of effort
That is why I still use !sfx. It works great and does not interfere with anything that I have ever noticed.
Let's say I wanted to use the fx visual display for a fireball and add sound to that effect when I as a GM have a NPC cast Fireball using the Roll20 official sheet for Pathfinder 2. How could I use the API scripts to do that? I would love it if we could click on the target square, then click the Fireball spell tab(icon) on the sheet thus triggering the visual and sound effects while at the same time displaying the information about the spell, DC, saves, and damage to the players in chat.
1576168930
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The Dungeon Master said: That is why I still use !sfx. It works great and does not interfere with anything that I have ever noticed. I think being an API command, it would suffer the same issue. The problem isn't the commands, it's the order of the fields in the D&D 5e Roll20 sheet roll template.
1576170621
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Xathos of Varisia said: Let's say I wanted to use the fx visual display for a fireball and add sound to that effect when I as a GM have a NPC cast Fireball using the Roll20 official sheet for Pathfinder 2. How could I use the API scripts to do that? I would love it if we could click on the target square, then click the Fireball spell tab(icon) on the sheet thus triggering the visual and sound effects while at the same time displaying the information about the spell, DC, saves, and damage to the players in chat. A quick test of the PF2 sheet shows that it suffers the same problem. You would need to make an Ability on the Abilities tab that calls the spell and then plays the effect. Alternatively, on any sheet, you could put an API Command Button in the description field to play the sound . It would show with any attack. This will allow the roll template to resolve normally, and only require an extra click: [Sound](!roll20AM --audio,play|Name_of_Sound) or  [Sound](!sfx volume:75 song:Name_of_Sound action:play) It would look like this on the PF2 sheet: Or this on the D&D 5e by Roll20 sheet:
KeithCurtis, Thank you! I will experiment with that after I get off work. Is there any possible way to do that with the visual fx stuff?
I have this in the notes section of the shortbow for a goblin warrior in the PF2 sheet. [Sound](!roll20AM --audio,play|Shortbow Arrow Hits Chainmail by Jean-Baptiste) I have the sound in the jukebox. When I hit the key to fire the shortbow, the information comes up correctly just like you have it in the picture, but when I click the Sound tab that shows I hear no sound. I'm sure I'm not doing it correctly.
1576178628
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Things to check: 1. You have Roll20 AudioMaster installed on your API page. 2. You have used the config menu in Roll20AM to import the jukebox. Because of the way the back end works, Roll20AM keeps its own database of sounds that are in the jukebox. This must be updated upon installation, and every time you make a change to the jukebox. !roll20AM --config ... will call up the menu. To make sure nothing is wrong with the character button, use the play command by itself in the chat. That way you can narrow down where the problem lies.
I had not imported the playlist using that config menu. I have to figure out how to use that. I've imported the jukebox and checked the tracks and played the sound using it. These are the commands I'm trying. [Sound](!roll20AM --audio,play|Shortbow Arrow Hits Chainmail) [Sound](!roll20AM --audio,play|Shortbow_Arrow_Hits_Chainmail) Is there a tag or something I need to use? I may need to find the instructions for this script.
1576182231
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
If you use that command I posted, you will get a chat menu that will give you all commands as clickable buttons. If you don't import the jukebox into the script, the script will not play anything. This is the command to import, if you want to bypass the config box: !roll20AM --config,import Run that and your sounds should play.
I did that and nothing will play yet. I can bring up the track using the commands and click the play button so I hear the sound, but I can't even get the basic sound command to work when I enter it.
1576188532
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
If you want to PM me an invite and promote me to GM, I'd be happy to take a look-see and see if I can figure out what's going awry. This should work. If you want to play around with it yourself some more, issue the play command through the script interface, then click in the chat box and hit the up arrow. That should give you the exact command Roll20AM is issuing. Then put that into your API command button.