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

Value not working

I imagine this would be simple, but I don't know html, just sort of fumbling through....I want the athletics field to display str. + agi / 2. What would that code look like? I currently have a thingy with name="attr_str" and another one with name="attr_agi" In the next section I'm using value="floor((@{str} + @{agi} / 2))" I have no idea how to link the code and it show up as code. If there is anything more I can post, please let me know. I'm a nub and not sure I'm doing much right.
1435504879

Edited 1435512777
vÍnce
Pro
Sheet Author
Hi Patrick. Maybe something like?; <input title="athletics" type="number" name="attr_ath" value=" ( floor(@{str}+@{agi})/2 ) ">Athletics <input title="@{str}" type="number" name="attr_str" value="0"> <input title="@{agi}" type="number" name="attr_agi" value="0"> Update: updated parenthesis in value formula
Now it copy/pastes....this is what I have. Note: I generally do a lot of copy/paste, then butcher what I have...so i don't even know what of all of this is needed code, and what could be cut....But to what I understand, the attr_str and attr_agi should add together and divide by 2 in the attr_ath area below. .... <div class="section"> <table style="width: 100%"> <tr> <td><input title="@str" type="number" name="attr_str" value="12"/></td> <td><input type="number" name='attr_strmax'/></td> <td><input type="number" name='attr_strDP'/></td> <td><input type="number" name='attr_strMOD'/></td> </tr> <tr> <td text align="left"><h5>Strength</h5></td> <td text align="center">Max</td> <td text align="center">Dice Pool</td> <td text align="center">Details</td> </tr> <tr> <td><input title="@agi" type="number" name="attr_agi" value="12"/></td> <td><input type="number" name='attr_agimax'/></td> <td><input type="number" name='attr_agiDP'/></td> <td><input type="number" name='attr_agiMOD'/></td> </tr> <tr> <td text align="left"><h5>Agility</h5></td> <td text align="center">Max</td> <td text align="center">Dice Pool</td> <td text align="center">Details</td> </tr> <tr> </table> </div> </div> <div class="sheet-col"> <h4>Seconday Qualities</h4> <div class="section"> <table style="width: 100%; text-align: right; font-size: 8px;"> <tr> <td><input title="athletics" type="number" name='attr_ath' value="floor((@{str}+@{agi}/2))" disabled="true"/></td> <td><input type="number" name='attr_athDP'/></td> <td><input type="number" name='attr_athMOD'/></td> </tr> ....
1435512620
vÍnce
Pro
Sheet Author
You are probably having an Order of Operations issue <a href="https://wiki.roll20.net/Dice_Reference#Order_of_Op" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Order_of_Op</a>... Will this work? value="(floor(@{str}+@{agi})/2)"
Thank you Vince for responses That didn't work :( I just don't understand, I've gotten it to work on a different character sheet I "made". Going to review all of my code, and see if I find the issue. Any continued help here is appreciated and I'll update if I find anything :/
1435514446
vÍnce
Pro
Sheet Author
try &lt;td&gt;&lt;input title="athletics" type="number" name='attr_ath' value="(floor(@{str}+@{agi})/2)" disabled&gt;&lt;/td&gt;
Tried it. Didn't work Vince :( I like that line though, how when I mouseover the box it says "athletics"...that's awesome. For some reason, it's not accepting values (unless I put in a number like "12" or whatever). Any equation fails. Could it have to do with being in a table? A sheet col? I dunno :(
1435538065

Edited 1435538322
vÍnce
Pro
Sheet Author
Patrick said: Tried it. Didn't work Vince :( I like that line though, how when I mouseover the box it says "athletics"...that's awesome. For some reason, it's not accepting values (unless I put in a number like "12" or whatever). Any equation fails. Could it have to do with being in a table? A sheet col? I dunno :( I tested it out on a dummy campaign and it seems to be working for me. PM sent. Code used &lt;div class="section"&gt; &lt;table style="width: 100%"&gt; &lt;tr&gt; &lt;td&gt;&lt;input title="@str" type="number" name="attr_str" value="12"/&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="number" name='attr_strmax'/&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="number" name='attr_strDP'/&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="number" name='attr_strMOD'/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td text align="left"&gt;&lt;h5&gt;Strength&lt;/h5&gt;&lt;/td&gt; &lt;td text align="center"&gt;Max&lt;/td&gt; &lt;td text align="center"&gt;Dice Pool&lt;/td&gt; &lt;td text align="center"&gt;Details&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;input title="@agi" type="number" name="attr_agi" value="12"/&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="number" name='attr_agimax'/&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="number" name='attr_agiDP'/&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="number" name='attr_agiMOD'/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td text align="left"&gt;&lt;h5&gt;Agility&lt;/h5&gt;&lt;/td&gt; &lt;td text align="center"&gt;Max&lt;/td&gt; &lt;td text align="center"&gt;Dice Pool&lt;/td&gt; &lt;td text align="center"&gt;Details&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="sheet-col"&gt; &lt;h4&gt;Seconday Qualities&lt;/h4&gt; &lt;div class="section"&gt; &lt;table style="width: 100%; text-align: right; font-size: 8px;"&gt; &lt;tr&gt; &lt;td&gt;&lt;input title="athletics" type="number" name='attr_ath' value="(floor(@{str}+@{agi})/2)" disabled&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="number" name='attr_athDP'/&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="number" name='attr_athMOD'/&gt;&lt;/td&gt; &lt;/tr&gt;
It seems I found the problem. While tugging at my bald head looking for answers in that cavernous space...I opted to check the character sheet in the campaign instead of the preview, and it works. The preview still doesn't show a working example, but the real thing works. Very happy. Thank you Vince for all of your help!!
1435539471
Finderski
Pro
Sheet Author
Compendium Curator
The Preview doesn't show calculated values, just FYI. :)
1435539516
vÍnce
Pro
Sheet Author
That's a common issue Patrick. Mantra... Never trust the preview. Have fun.
1435539544
vÍnce
Pro
Sheet Author
G V. said: The Preview doesn't show calculated values, just FYI. :) there you go. Thanks GV