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

[L5R] Feeding a button roll command through a variable.

So it's always bugged me that the current L5R 4th Edition sheet has three buttons for every skill. The reason is the skills need a Trained, Untrained, and Emphasis button. It's occurred to me that if it were possible to have a single button just access a variable, and then to feed what would normally be the value of the button into the variable, something like this: '/em @{name} rolls a skill! \n\n/roll [[{@{rolldice}, 10}kl1]]d10k[[{@{keepdice} + [[floor({@{rolldice} - 10, 0}k1 / 2)]], 10}kl1]] + [[(({{@{keepdice},0}>10} * {{@{rolldice},0}>10} * (((@{keepdice} - 10) + (@{rolldice} - 10)) * 2)) + ({{((floor((@{rolldice} - 10) / 2)) + @{keepdice}),0}>10} * {{@{keepdice},11}<9} * (((@{rolldice} - 10) - ((10 - @{keepdice}) * 2)) * 2))) + @{rollerbonus}]]' Then I could have a drop down select Trained, Untrained, or Emphasis and have that selection set the variable that the button reads from. The button's roll equation could change based on changing that drop down. But I haven't been able to make a roll button access the data in a variable and use it to roll. Is that possible? What might the syntax look like? I'm trying to make that sheet a lot more elegant.
1520608158

Edited 1520609444
Jakob
Sheet Author
API Scripter
The important thing to know here is what the roll formulas look like in the Trained, Untrained, Emphasis cases — you can definitely do this with a query, but depending on the extent that these formulas differ in the three cases, it becomes more or less annoying (where annoyance = #HTML entity replacements on the sheet needed to make the queries work as expected). Oh, I totally misread what you were trying to do (reading GG's post cleared it up, thanks). I though you wanted to set it as a query when clicking the button, but what you want to do is much easier! value='/em @{name} rolls a skill! \n\n/roll @{corresponding_roll_formula}' would do the trick, where you have, e.g. <select name='attr_corresponding_roll_formula'> <option value='[[{@{rolldice}, 10}kl1]]d10k[[{@{keepdice} + [[floor({@{rolldice} - 10, 0}k1 / 2)]], 10}kl1]] + [[(({{@{keepdice},0}>10} * {{@{rolldice},0}>10} * (((@{keepdice} - 10) + (@{rolldice} - 10)) * 2)) + ({{((floor((@{rolldice} - 10) / 2)) + @{keepdice}),0}>10} * {{@{keepdice},11}<9} * (((@{rolldice} - 10) - ((10 - @{keepdice}) * 2)) * 2))) + @{rollerbonus}]]'>Trained</option> <option value='someotherformula'>Untrained</option> </select>
1520609046

Edited 1520609057
GiGs
Pro
Sheet Author
API Scripter
Robert, another approach would be to leave the three buttons working as they are, but use CSS rules to hide the ones that aren't relevant based on the dropdown value.