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] Formulas in the character sheet

I've got this chunk of code:         <input type='number' name='attr_base_STR' min=1>Strength</input>         <input type='number' name='attr_var_STR'></input>         <input type='number' name='attr_edu_STR' disabled></input>         <input type='number' name='attr_car_STR' disabled></input>         <input type='number' name='attr_final_STR' value='[[@{attr_base_STR} + @{attr_var_STR} + @{attr_edu_STR} + @{attr_car_STR}]]' disabled></input>         <input type='number' name='attr_STRskillbase' value='[[floor(@{attr_final_LUK}/2) + @{attr_final_STR} + 2]]' disabled></input>         <button type='roll' value='/roll 1d100 + @{attr_STRskillbase}' name='roll_STR_skillbase'></button> which has two issues. The attr_final_STR does not actually show a value when I have values in the other fields. As does the attr_STRskillbase. The second issue is the roll button does roll the 1d100 but throws an error of No attribute was found for @{Ehi Aziw|attr_STRskillbase}. (yay for random character names!) Any guidance on this would be appreciated. The system is one of my own devising, and this is the first custom sheet I've done on Roll20.
You do not need [[ ]], as they are not inline rolls. Those are for Roll20 chat output use. then change your button roll to include them: <button type='roll' value='/roll [[ 1d100 + @{attr_STRskillbase}]]' name='roll_STR_skillbase'></button>
Making the change you suggest results in the same error, "No attribute found for @{Ehi Aziw|attr_STRskillbase}'. The only change is the output for the roll reads "rolling 19 19 = 19" instead of rolling 1d100 + Ehi Aziw|attr_STRskillbase. 
1442111096

Edited 1442111674
vÍnce
Pro
Sheet Author
Try dropping "attr_"  from the attribute names in your formulas. Assign a value as well, even if it's just value="0" <input type='number' name='attr_base_STR' value="1" min=1>Strength</input> <input type='number' name='attr_var_STR' value="0"></input> <input type='number' name='attr_edu_STR' value="0" disabled></input> <input type='number' name='attr_car_STR' value="0" disabled></input> <input type='number' name='attr_final_STR' value='[[@{base_STR} + @{var_STR} + @{edu_STR} + @{car_STR}]]' disabled></input> <input type='number' name='attr_STRskillbase' value='[[floor(@{final_LUK}/2) + @{final_STR} + 2]]' disabled></input> <button type='roll' value='[[ 1d100 + @{STRskillbase}]]' name='roll_STR_skillbase'></button>
Thanks Vince. That worked. Now to continue until I break something else :)
1442115743
vÍnce
Pro
Sheet Author
Happens to me on every new line.  :-)
Vince said: Try dropping "attr_"  from the attribute names in your formulas. Assign a value as well, even if it's just value="0" I completely missed this in his code! At least I had it right with the [[ ]] :P