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

Autocalc showing text instead calc result.

1559059123

Edited 1559060927
Rago
Pro
I have the following HTML on a character sheet. The input I highlighted with bold is showing me the formula instead of showing the final result, and I don't know why. Can anyone help? <div class="sheet-row">     <input class="sheet-width-1b5 sheet-input-value sheet-font-yellow" type="text" name="attr_DEX" value="(floor((@{DEXBase} + @{DEXMod} + @{DEXTemp})/2)-5)" disabled="true" />     <button class="sheet-width-1b5" type="roll" value="&{template:default} {{name=@{name}: DEX}} {{Resultado=[[1d20+@{DEX}]]}}">DEX</button>     <input class="sheet-width-1b5 sheet-input-value" type="number" name="attr_DEXBase" />     <input class="sheet-width-1b5 sheet-input-point" type="number" name="attr_DEXMod" />     <input class="sheet-width-1b5 sheet-input-point" type="number" name="attr_DEXTemp" /> </div> <div class="sheet-row">     <div class="sheet-width-1b1-border">         <div class="sheet-row sheet-title">Armor Class</div>         <div class="sheet-row">             <label class="sheet-width-2b30 sheet-small-title">AC</label>             <label class="sheet-width-2b30 sheet-small-title">Surprised</label>             <label class="sheet-width-2b30 sheet-small-title">Touch</label>             <label class="sheet-width-2b30 sheet-small-title"> </label>             <label class="sheet-width-2b30 sheet-small-title">Max Dex</label>             <label class="sheet-width-2b30 sheet-small-title">Armor</label>             <label class="sheet-width-2b30 sheet-small-title">Shield</label>             <label class="sheet-width-2b30 sheet-small-title">Natural</label>             <label class="sheet-width-2b30 sheet-small-title">Deflect</label>             <label class="sheet-width-2b30 sheet-small-title">Dodge</label>             <label class="sheet-width-2b30 sheet-small-title">Size</label>             <label class="sheet-width-2b30 sheet-small-title">"Armor"</label>             <label class="sheet-width-2b30 sheet-small-title">"Armor"</label>             <label class="sheet-width-2b30 sheet-small-title">"Deflect"</label>             <label class="sheet-width-2b30 sheet-small-title">"Deflect"</label>         </div>         <div class="sheet-row">             <input class="sheet-width-2b30 sheet-input-value" type="text" name="attr_AC" value="(10 + [[{@{ACMaxDex},@{DEX}}kl1]] + @{ACArmor} + @{ACShield} + @{ACNatural} + @{ACDeflection} + @{ACDodge} + @{ACSize} + @{ACMiscArmor1} + @{ACMiscArmor2} + @{ACMiscDeflect1} + @{ACMiscDeflect2})" disabled="true" />             <input class="sheet-width-2b30 sheet-input-value" type="text" name="attr_FF" disabled="true" />             <input class="sheet-width-2b30 sheet-input-value" type="text" name="attr_TC" disabled="true" />             <label class="sheet-width-2b30"> </label>             <input class="sheet-width-2b30 sheet-input-point" type="number" name="attr_ACMaxDex" />             <input class="sheet-width-2b30 sheet-input-point" type="number" name="attr_ACArmor" />             <input class="sheet-width-2b30 sheet-input-point" type="number" name="attr_ACShield" />             <input class="sheet-width-2b30 sheet-input-point" type="number" name="attr_ACNatural" />             <input class="sheet-width-2b30 sheet-input-point" type="number" name="attr_ACDeflection" />             <input class="sheet-width-2b30 sheet-input-point" type="number" name="attr_ACDodge" />             <input class="sheet-width-2b30 sheet-input-point" type="number" name="attr_ACSize" />             <input class="sheet-width-2b30 sheet-input-point" type="number" name="attr_ACMiscArmor1" />             <input class="sheet-width-2b30 sheet-input-point" type="number" name="attr_ACMiscArmor2" />             <input class="sheet-width-2b30 sheet-input-point" type="number" name="attr_ACMiscDeflect1" />             <input class="sheet-width-2b30 sheet-input-point" type="number" name="attr_ACMiscDeflect2" />         </div>     </div> </div>   
1559062443
vÍnce
Pro
Sheet Author
On phone... What happens if you change type to "number" on the input?
1559064208

Edited 1559064232
Rago
Pro
It stays blank, because its being set to a string instead a number. (just did the test)
1559072764
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I could be wrong, but I don't believe inline roll brackets work in autocalc fields. Additionally, does kl/h work in autocalc?
1559078854

Edited 1559080020
Rago
Pro
I'll isolate some parts of the equation into hidden HTMl elements and remove the inline roll brackets. Let's see what happens. Edit: This is always wrong: (does not matter if I use brackets or not, the result is the same) <input class="sheet-width-1b2 sheet-input-point" type="number" name="attr_DexForAC" value="{[[@{ACMaxDex}]],[[@{DEX}]]}kl1" disabled="true" /> If I input the same formula on chat, like this: [[{@{A|ACMaxDex},@{A|DEX}}kl1]] it works perfectly. (The current char name is "A").
1559080587

Edited 1559080854
Rago
Pro
I think kh and kl and not meant to be on autocalc fields... I'll switch to some equation that does the same. =\ Edit: Just in case someone is trying to reach the same result: {x,y}kl1 = (x + y - abs(x - y))/2 {x,y}kh1 = (x + y + abs(x - y))/2 <input class="sheet-width-1b2 sheet-input-point" type="number" name="attr_DexForAC" value="(@{ACMaxDex} + @{DEX} - abs(@{ACMaxDex} - @{DEX}))/2" disabled="true" />