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] Counting the highest value of many values and plugging it into a feild.

So I run a homebrew system that combines some parts of d20 with some parts of a vampire style system. Essentially Traits are purchased directly on a cumulative cost basis, so the cost for next trait increases by 1, each 1 that is purchased. These traits generally represent a +1 bonus to something. So for characters filling out points, I have them deal with checkboxes. each checkbox has a value, and they fill in each box up until they reaech their trait total. It will autocalculate the score for them. Someone with a trait raiting of 3 will get 6 character points of cost. Someone who goes hardcore on a single trait could get up to a 10, which would cost 55 Character Points.      <tr>            <td class='sheet-left-align'>  Physique</td>            <td><input class="sheet-traitcheckbox" name="attr_CostPhysique1" value="1" type="checkbox">                <input class="sheet-traitcheckbox" name="attr_CostPhysique2" value="2" type="checkbox">                <input class="sheet-traitcheckbox" name="attr_CostPhysique3" value="3" type="checkbox">                <input class="sheet-traitcheckbox" name="attr_CostPhysique4" value="4" type="checkbox">                <input class="sheet-traitcheckbox" name="attr_CostPhysique5" value="5" type="checkbox">             </td>              <td><input class="sheet-traitcheckbox" name="attr_CostPhysique6" value="6" type="checkbox">                 <input class="sheet-traitcheckbox" name="attr_CostPhysique7" value="7" type="checkbox">                 <input class="sheet-traitcheckbox" name="attr_CostPhysique8" value="8" type="checkbox">                 <input class="sheet-traitcheckbox" name="attr_CostPhysique9" value="9" type="checkbox">                 <input class="sheet-traitcheckbox" name="attr_CostPhysique10" value="10" type="checkbox">              </td>              <td><input disabled="true" type="number" class="sheet-short sheet-noedit" name="attr_CostAllPhysique"                   value="@{CostPhysique1} + @{CostPhysique2} + @{CostPhysique3} + @{CostPhysique4} + @{CostPhysique5} +                           @{CostPhysique6} + @{CostPhysique7} + @{CostPhysique8} + @{CostPhysique9} + @{CostPhysique10}"></td>                </tr> However the cost math isn't useful for figuring out what the actual trait value is. Is there a way I can simply grab the greatest value out of all those checkboxes? Currently my players need to fill out their trait twice, once to do the math for costs, and again so that macros and other things will calculate the proper value. I'd like to be able to just grab the highest checkbox, and that have that pull into something else.
1444542731

Edited 1444543367
Diana P
Pro
Sheet Author
For the max value in a roll, [[{@{CostPhysique1},@{CostPhysique2},@{CostPhysique3},@{CostPhysique4},@{CostPhysique5},@{CostPhysique6},@{CostPhysique7},@{CostPhysique8},@{CostPhysique9},@{CostPhysique10} }kh1]] should work.&nbsp;&nbsp; (edit: reference: <a href="https://wiki.roll20.net/Dice_Reference#Grouped_Rol" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Grouped_Rol</a>... ) For display purposes on a character sheet, you would need a math-only version which would be much more complicated. Something like several iterations of: max(x, y, z, ...) If x &gt; y, the result is x, while if x &lt; y, the result is y &lt;input type="hidden" disabled="true" name="attr_max_xy" value="(((@{x} + @{y}) + abs(@{x} - @{y})) / 2)" /&gt; &lt;input type="hidden" disabled="true" name="attr_max_xyz" value="(((@{max_xy} + @{z}) + abs(@{max_xy} - @{z})) / 2)" /&gt; &lt;input type="hidden" disabled="true" name="attr_max_xyzw" value="(((@{max_xyz} + @{w}) + abs(@{max_xyz} - @{w})) / 2)" /&gt; (from: <a href="https://app.roll20.net/forum/post/882997/css-wizar" rel="nofollow">https://app.roll20.net/forum/post/882997/css-wizar</a>... ) edit: here's a start at this type of iteration. &lt;input type="hidden" disabled="true" name="attr_max_p12" value="(((@{CostPhysique1} + @{CostPhysique2}) + abs(@{CostPhysique1} - @{CostPhysique2})) / 2)" /&gt; &lt;input type="hidden" disabled="true" name="attr_max_p123" value="(((@{max_p12} + @{CostPhysique3}) + abs(@{max_p12} - @{CostPhysique3})) / 2)" /&gt; &lt;input type="hidden" disabled="true" name="attr_max_p1234" value="(((@{max_p123} + @{CostPhysique4}) + abs(@{max_p123} - @{CostPhysique4})) / 2)" /&gt; There might be a better way to do the math only version than this one, but I haven't though of it yet if there is. Hope that helps somewhat.
1444544538

Edited 1444544565
It does help! , but yeah&nbsp;I don't need a macro for it. I alraedy got a great system for automatically building macro's built into the sheet. I would just like to have players fill something out once instead of twice. &nbsp;I need something math only, so it can populate a feild, as a single &nbsp;value, and get put pulled into a special roll template i built when something needs to be rolled. I was hoping there was a way to leverage that into populating a feild.&nbsp; I'm really worried about performance if I need to make 60 hidden input feilds just to deal with figuring out which one is the biggest. It's a key value, and the entire system is trait based. My sheet right now zooms because it stores the data simply and avoids that kind of complexity you see in the high-end sheets. According to the refrence, that seems to be the only way sadly. A max function would be awesome.&nbsp;
1444588747
Diana P
Pro
Sheet Author
Yeah.&nbsp; There are other math functions which would be nice also. There are some suggestions in the suggestion forum for additional math functions for character sheets (such as: <a href="https://app.roll20.net/forum/post/2174117/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/2174117/slug%7D</a> ) which you could put votes into if you desire.&nbsp;