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

Nesting macro inside OGL sheet

Hi guys. I am trying to get an audio track to play when making an attack roll in the attacks and spellcasting section of the OGL roll20 character sheet using the roll20AM API. I have roll20AM set up and working correctly and the correct macro in the macro quick bar, however I don't know how to place that macro inside the attack so the audio track triggers when the attack roll is made, can someone help ? This is the macro I want to activate when the attack roll is made (using roll20AM API)    !roll20AM --audio,play,nomenu|M93R
1532467936

Edited 1532467993
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
So, this requires taking advantage of some macro tricks. At the very end of your attack (or spell or trait) description put this: }} !roll20AM --audio,play,nomenu|M93R ! This will trick the roll template into letting the command act as an api command.
Your a genius! Thanks! :) It's working :)
I have encountered another problem now. The ammo no longer tracks as a resource using the character companion, is there a fix? Thanks.
1532470282
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
ah, can you hit up in the chat box after sending the attack macro, then post the results here?
@{Frugaleo Laukus|wtype}&{template:dmg} {{rname=PA3}} 0 {{range=}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[d10+20]]}} {{dmg1type=}} 0 {{dmg2=[[0]]}} {{dmg2type=}} 0 {{desc=}} !roll20AM --audio,play,nomenu|PA3 !}}  {{spelllevel=}} {{innate=}} {{globaldamage=[[0]]}} {{globaldamagetype=@{Frugaleo Laukus|global_damage_mod_type}}} ammo=Buckshot|-LIDHovsu4ZWIYdjC4h8|-LIDHovsu4ZWIYdjC4h8|-LIDHovsu4ZWIYdjC4h8 @{Frugaleo Laukus|charname_output} NOTE: I changed the weapon from M93R to PA3 as expressed in the roll20AM macro. 
1532471871
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ok, yeah, looks like the OGL doesn't do what most sheets do, which is to put the description last. Change what you have at the end of the description to be this: }}{{spelllevel=}} {{innate=}} {{globaldamage=[[0]]}} {{globaldamagetype=@{Frugaleo Laukus|global_damage_mod_type}}} ammo=Buckshot|-LIDHovsu4ZWIYdjC4h8|-LIDHovsu4ZWIYdjC4h8|-LIDHovsu4ZWIYdjC4h8 @{Frugaleo Laukus|charname_output} !roll20AM --audio,play,nomenu|PA3 !}}
Thanks a bunch, got a few nice surprises for my players now. :)
1532473231
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
np. Note that you'll have to change the ammo=Buckshot|-LIDHovsu4ZWIYdjC4h8|-LIDHovsu4ZWIYdjC4h8|-LIDHovsu4ZWIYdjC4h8 section based on the attack/spell/trait that you are modifying.
Thank you