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

autocalculate not functioning for me

1557086122
CyborgPrime
Pro
Marketplace Creator
What am I doing wrong here? <input type="number" name="str" value="7"> <input type="number" name="str_mod" value="@{str}/2" disabled="true">
1557087746
Finderski
Pro
Sheet Author
Compendium Curator
Names need to start with attr_ for one. <input type="number" name="attr_str" value="7"> <input type="number" name="attr_str_mod" value="@{str}/2" disabled="true"> Also, if you want the mat to round up or down, you'd need to use either ceil or floor functions in the equation... Can't get the exact syntax at the moment, but the wiki will have it.
1557089598
Victor B.
Pro
Sheet Author
API Scripter
[[floor(@{str}/2}]]
1557090055
CyborgPrime
Pro
Marketplace Creator
I misunderstood the instructions in the wiki - I did't use attr_ , I thought that was meant for actual "attritutes", didnt realize every input had to have that prefix. thanks - it works in the roll20 but not the preview, so there were a few things going on I wasntreally concerned with calculating - I couldnt even get the second field to even *copy* the first field. Looks like what I need is a sheetworker, anyway - the second field only updates when i leave the first input field.  I want the second field to update every time you adjust the spinner controls...
1557090239
GiGs
Pro
Sheet Author
API Scripter
CyborgPrime said: Looks like what I need is a sheetworker, anyway - the second field only updates when i leave the first input field.  I want the second field to update every time you adjust the spinner controls...  I think this is a roll20 limitation - a sheetworker wont fire either until you leave the input field. 
1557090316
CyborgPrime
Pro
Marketplace Creator
d'oh!
1557147448

Edited 1557147472
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
GiGs said: CyborgPrime said: Looks like what I need is a sheetworker, anyway - the second field only updates when i leave the first input field.  I want the second field to update every time you adjust the spinner controls...  I think this is a roll20 limitation - a sheetworker wont fire either until you leave the input field.  Yep, the attribute isn't actually changed until you leave the field or press enter. The one exception to this is number entry spinners I believe.