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

[Script] SmartAoe - What is the roll template used for chat output?

I'm adding sound effects to my SmartAoE spells using customizable roll listener. Trying to get it to only listen for the AoE output template so it doesn't double trigger the sound. Had a look through the script, wiki, forum posts, etc. but couldn't find what I was looking for. Little help? :)  Cheers!
1655119918
David M.
Pro
API Scripter
I've never used CRL, but if it's looking for a template that sounds problematic. SmartAoE uses direct html output. Also, for the individual saving throw rolls it uses a Promise.all mapped to a tokenRolls array and processes the results before final output (see below). I stole this code from Jakob's GroupChat script, and have no idea how this would/should interact with CRL. Posting this here in case someone else familiar with CRL sees this thread.  Promise.all(tokenRolls.map(o => new Promise((resolve) => { sendChat("", `${o.formula}${o.roll2x ? `<br>${o.formula}` : ""}`, resolve); }))) .then(async(messages) => processFinalMessages(messages, damageRolls, tokenRolls, aoeLink)) .catch(sendErrorMessage);  The ProcessFinalMessages function parses these api-generated inline roll results and builds the final html output for presentation in chat (see the buildTitle, buildDamageRow, buildSaveHeaderRow, buildDescRow, buildTableBody, and buildGMOutput functions for the html content). It looks like this could get ugly. I should probably try adding soundFX support to the script, but note that this month is really busy for me.
thanks David. thanks for that. crl works fine but for some reason the smartaoe chat output makes the listener trigger on the token spawn event and then again on the trigger-all event passing everything to chst... make sense that it's html output after I tried every possible template configuration I could find haha.
got a work around (play sound + trigger-all abilities on the AoEControlToken specific to each spell). not elegant but it will work until I or someone else figures out something better... or David M. gets time to include sound. thanks by the way for your script. I'm looking at how I can modify it for attack roll spells. works great for target spells that require saves or no saves... managed to get auto cure wounds and healing word working using it...
1655212909

Edited 1655213224
David M.
Pro
API Scripter
EDIT - glad you found a work-around! Lots of people have asked about attack rolls. Technically you can shoe-horn it by setting the dc to the ac of the target, and a saveFormula equal to the attack roll. However, this will only work for single target attacks (since the script only allows for a single dc), and I'm not sure if the auto-damage feature will work since the script assumes the one that makes the "save" takes the damage. Not ideal, and probably not time-saving. Attack rolls were really outside of the original scope of the script, and there are already other scripts that I think would do a better job of it (like scriptcards) that already have tons of examples.
aaah. thanks for that... you just saved me an agonizing few hours.!. will try to do what I want with scriptcards in the mean time...