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] Getting two differing data points from one input.

1483770241
Pat S.
Forum Champion
Sheet Author
I have a problem and need someone will more experience than me to give me an idea or help. I need to replicate a table in a system supplement but have not figured out how to do it. I need to replicate 6 entries that give bonuses to hit and damage. I can get it to do whole numbers but I need two differing sets from one entry. At the moment I have it just doing the @{masteryrank} but I need it to give @{masteryrank} and another entry to replicate the table Mastery Hit Damage None 0 0 Basic 1 0 Trained 1 1 Skilled 2 1 Expert 2 2 Master 3 2 Grand Master 3 3 I've tried a few different ways (subtraction, division, using the floor, ceiling, round, but I'm stumped. What I really need is to be able to choose one entry but have two values. Any suggestions? I'm not full of pride and will gladly accept anyone's code that works. I'll even put your name in the json file when I update the code in the github. Main reason I need to do this is farther into the sheet, I have a combat entry that has input points for the combat mastery and being able to set it once and have it replicate farther in the sheet would be nice. <div class="sheet-col-1-2 sheet-padr"> <h4 class="sheet-center">Weapon Specialization </h4> <div class="sheet-row sheet-sub-header sheet-small-label"> <div class="sheet-col-1-6 sheet-padl sheet-padr">Weapon</div> <div class="sheet-col-1-2 sheet-center">Mastery</div>                             <div class="sheet-col-1-6 sheet-center">Hit / Damage</div> </div> <fieldset class="repeating_weaponmastery"> <div class="sheet-row"> <div class="sheet-col-1-3 sheet-padr sheet-small-label sheet-left"><input type="text" name="attr_weaponmasteryname"></div> <div class="sheet-col-1-2 sheet-padl sheet-padr "> <select name="attr_masteryrank">                                         <option value="0">None</option> <option value="1">Basic</option>                                         <option value="1">Trained</option> <option value="2">Skilled (3/2 Attk/rnd)</option> <option value="2">Expert (3/2 Attk/rnd)</option> <option value="3">Master (2 Attk/rnd)</option> <option value="3">Grand Master (2 Attk/rnd)</option> </select> </div>                                 <div class="sheet-col-1-6 sheet-padl sheet-small-label sheet-center"><input type="text" name="attr_weaponmasteryrankhit" value="@{masteryrank}" disabled=true></div> </div> </fieldset> </div>
1483771749
Silvyre
Forum Champion
@{mastery} @{hit} @{damage} 0 0 0 1 1 0 2 1 1 3 2 1 4 2 2 5 3 2 6 3 3 @{hit} = ceil(@{mastery} / 2) @{damage} = floor(@{mastery} / 2) Does that help?
1483774151
Pat S.
Forum Champion
Sheet Author
Silvyre said: @{hit} = ceil(@{mastery} / 2) @{damage} = floor(@{mastery} / 2) Does that help? It does alot. I guess I was just being thickheaded and thought I tried it but it works. This is the main thing I changed (other than the col size of the headers above it) <div class="sheet-col-1-8 sheet-padl sheet-small-label sheet-center"><input type="text" name="attr_weaponmasteryrankhit" value="{ceil(@{masteryrank}/2)}" disabled=true></div> <div class="sheet-col-1-8 sheet-padl sheet-small-label sheet-center"><input type="text" name="attr_weaponmasteryrankdamage" value="{floor(@{masteryrank}/2)}" disabled=true></div> Thanks for the help.
1483788904
Silvyre
Forum Champion
Cool, good luck