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

Help Needed: AGE system Mod for Heal Action and similar

I am not very good at JavaScript, and I am struggling to understand how to tell it what I need. I am working from the sheet and roll templates made for Fantasy AGE and its related games . I have managed to make an adjustment to the sheet so it always shows the Healing ability, as with Initiative, and when clicked it rolls as follows: on('clicked:healing_check', (info) => { getAttrs(["chirurgy-bonus"], function(v) { let total = 0; startRoll("@{wtype}&{template:age-roller} {{color-@{color}=1}} {{total=[[@{cunning} + @{heal-bonus} - @{fatigue}]]}} {{mod=[[@{cunning}]]}} {{ability=@{cunning_label}}} {{extramod1=[[@{heal-bonus}]]}} {{extramod1-name=@{healing_adjustment}}} {{desc=@{healing}}} {{fatigue=[[@{fatigue}]]}} {{player=@{char-name-option}}} {{die1=[[1d6]]}} {{die2=[[1d6]]}} {{drama=[[1d6]]}} {{drama2=[[@{stunts2-select}]]}}", (results) => { total = results.results.die1.result + results.results.die2.result + results.results.drama.result + results.results.total.result finishRoll(results.rollId,{total: total}); }); }); }); It does its job. Puts out the result in chat, displayed like it should be:   But how do I tell it to take the result of that third die  (results.results.drama.result) and have it use that number in an additional calculation that returns HP Healed =  ([drama.result]*[multiplier])+ [stat]  ? If it can't be done in the code above, how would I make a mod where what is sent to chat is clickable and uses that same result? Would I have to make an attribute that holds that result to then pull down for the next roll? Any advice would be greatly appreciated.
1744735487
Gauss
Forum Champion
Hi Forta-Ver,  If you don't get a response here after a bit you might want to move your question to the Character Sheets forum . That is where folks usually post questions regarding character sheet coding. 
Thanks