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 .
×

Working macro for age rolls with total?

Anyone know how I'd go about making a macro for the age system that keeps the total?&nbsp; It looks like the sheet does some custom js after the normal command to total up everything so the only time it works is if you do it through the button: <a href="https://github.com/Roll20/roll20-character-sheets/blob/a3cde257a99d1d60189bd187a6f9f79737634ede/AGE%20System/AGE%20System.html#L3920" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/blob/a3cde257a99d1d60189bd187a6f9f79737634ede/AGE%20System/AGE%20System.html#L3920</a> Example (top roll is from clicking the button, bottom is from re-running the last chat command): I have pro so scripts are an option if anyone knows how to do it, I want to keep it as close to the original as possible though and just add some extra info on like what the GM should run a check against and maybe add a button if you fail the target number check and have to roll on the mishap table.&nbsp; Thanks
1665365014
timmaugh
Roll20 Production Team
API Scripter
Not familiar with the system, but the sheet just looks like it's added the die1, die2, and drama die to the existing total value... so if you just wanted to do that, you should be able to do: @{wtype}&amp;{template:age-roller} {{color-@{color}=1}} {{total=[[?{@{ability_value}|0} + ?{@{focus_value}|@{none}, 0|+2, 2|+3, 3} - @{fatigue} + ?{@{additional_modifier}|0} + [[1d6]] + [[1d6]] + [[1d6]]]]}} {{mod=?{@{ability_value}|0}}} {{ability=@{ability_score}}} {{desc=?{@{roll_description}|@{die_roll}}}} {{fatigue=[[@{fatigue}]]}} {{extramod3=[[?{@{additional_modifier}|0}]]}} {{extramod3-name=@{additional_modifier2}}} {{extramod2=[[?{@{focus_value}|@{none}, 0|+2, 2|+3, 3}]]}} {{extramod2-name=@{focus}}} {{player=@{char-name-option}}} {{die1=$[[1]]}} {{die2=$[[2]]}} {{drama=$[[3]]}} {{drama2=[[@{stunts2-select}]]}}
timmaugh said: Not familiar with the system, but the sheet just looks like it's added the die1, die2, and drama die to the existing total value... so if you just wanted to do that, you should be able to do: @{wtype}&amp;{template:age-roller} {{color-@{color}=1}} {{total=[[?{@{ability_value}|0} + ?{@{focus_value}|@{none}, 0|+2, 2|+3, 3} - @{fatigue} + ?{@{additional_modifier}|0} + [[1d6]] + [[1d6]] + [[1d6]]]]}} {{mod=?{@{ability_value}|0}}} {{ability=@{ability_score}}} {{desc=?{@{roll_description}|@{die_roll}}}} {{fatigue=[[@{fatigue}]]}} {{extramod3=[[?{@{additional_modifier}|0}]]}} {{extramod3-name=@{additional_modifier2}}} {{extramod2=[[?{@{focus_value}|@{none}, 0|+2, 2|+3, 3}]]}} {{extramod2-name=@{focus}}} {{player=@{char-name-option}}} {{die1=$[[1]]}} {{die2=$[[2]]}} {{drama=$[[3]]}} {{drama2=[[@{stunts2-select}]]}} Yea the math doesn't seem very complicated but the non-api stuff doesn't let you store variables so what it seems to be doing is rolling 3 dice and displaying them putting the magic bonus in total and then after the command is executed but before it displays it it goes back and grabs the 3 dice and adds them to the total.&nbsp; I might be able to get around it if I can script out the dice rolls and total calculation and then execute the chat command with the values filled in but not sure if that's supported
1665407149
timmaugh
Roll20 Production Team
API Scripter
You don't need variables, you only need to reuse the rolls -- which is absolutely available to every level of Roll20 play. I just created a game to try it out, and the only piece that wasn't working for me was the die that is red in your images... but I figured out that was because the original "total" value was not an isolated value. I'm not sure what the template is doing with that particular number to create/present the die, but it only took wrapping that portion in its own inline roll to make it work. Here is the updated roll (extrapolating my changes to your roll)... followed by the roll from my game that I was actually testing with: @{wtype}&amp;{template:age-roller} {{color-@{color}=1}} {{total=[[[[?{@{ability_value}|0} + ?{@{focus_value}|@{none}, 0|+2, 2|+3, 3} - @{fatigue} + ?{@{additional_modifier}|0}]] + [[1d6]] + [[1d6]] + [[1d6]]]]}} {{mod=?{@{ability_value}|0}}} {{ability=@{ability_score}}} {{desc=?{@{roll_description}|@{die_roll}}}} {{fatigue=[[@{fatigue}]]}} {{extramod3=[[?{@{additional_modifier}|0}]]}} {{extramod3-name=@{additional_modifier2}}} {{extramod2=[[?{@{focus_value}|@{none}, 0|+2, 2|+3, 3}]]}} {{extramod2-name=@{focus}}} {{player=@{char-name-option}}} {{die1=$[[2]]}} {{die2=$[[3]]}} {{drama=$[[4]]}} {{drama2=[[@{stunts2-select}]]}} @{Ookowew Iascup|wtype}&amp;{template:age-roller} {{color-@{Ookowew Iascup|color}=1}} {{mod=@{Ookowew Iascup|intelligence}}} {{ability=Intelligence}} {{desc=}} {{tn=}} {{note1=1}} {{note1-name=@{Ookowew Iascup|spellpower_label}}} {{total=[[[[@{Ookowew Iascup|intelligence} + 1 - @{Ookowew Iascup|fatigue} + @{Ookowew Iascup|fear-intelligence}]] + [[1d6]] + [[1d6]] + [[1d6]] ]]}} {{extramod1=[[1]]}} {{extramod1-name=Hoojaloo @{Ookowew Iascup|focus}}} {{extramod2=[[@{Ookowew Iascup|fear-intelligence}]]}} {{extramod2-name=@{Ookowew Iascup|fear_label} @{Ookowew Iascup|fear}}} {{fatigue=[[@{Ookowew Iascup|fatigue}]]}} {{player=@{Ookowew Iascup|char-name-option}}} {{die1=$[[2]]}} {{die2=$[[3]]}} {{drama=$[[4]]}} {{drama2=[[@{Ookowew Iascup|stunts2-select}]]}} The idea is three parts: 1) use the 3 x 1d6 in the actual Total equation where you're going to need them 2) wrap the original Total (the sub-total, if you will) in its own inline roll 3) reuse the 1d6 rolls by referencing their roll index. #3 is not always easy or intuitive, so I think the post-hoc js-jujitsu the sheet was doing was aimed at keeping the roll template relatively easy to create and use. But it can absolutely be done natively in the chat, making the changes I'm pointing out, above.
Thanks! didn't know you could access roll params with $ in macros, I had to modify it a bit but I got it so it's a match to what clicking the button does so now I just need to add the extra info in. @{Cyrus|wtype}&amp;{template:age-roller} {{color-@{Cyrus|color}=1}} {{mod=+@{Cyrus|magic}}}{{ability=Magic}} {{desc=@{Cyrus|repeating_spell_-NDq0TmA8qasSXCsWYza_spell-name}}} {{tn=@{Cyrus|repeating_spell_-NDq0TmA8qasSXCsWYza_spell-tn}}} {{note1=@{Cyrus|repeating_spell_-NDq0TmA8qasSXCsWYza_spell-spellpower}}} {{note1-name=@{Cyrus|spellpower_label}}} {{total=[[[[1d6]] + [[1d6]] + [[1d6]] + @{Cyrus|Magic}+ @{Cyrus|repeating_spell_-NDq0TmA8qasSXCsWYza_spell-focus-bonus} ]]}} {{extramod1=@{Cyrus|repeating_spell_-NDq0TmA8qasSXCsWYza_spell-focus-bonus}}} {{extramod1-name=@{Cyrus|repeating_spell_-NDq0TmA8qasSXCsWYza_spell-school} @{Cyrus|focus}}} {{extramod2=[[@{Cyrus|fear-intelligence}]]}} {{extramod2-name=@{Cyrus|fear_label} @{Cyrus|fear}}} {{fatigue=[[@{Cyrus|fatigue}]]}} {{player=@{Cyrus|char-name-option}}} {{die1=$[[1]]}} {{die2=$[[2]]}} {{drama=$[[3]]}} {{drama2=[[@{Cyrus|stunts2-select}]]}}