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 .
×

Assistance creating an updating field for custom sheet

Hello everybody!  My friends and kinda me have been working on a custom system and in trying to make the character sheet we're running into a problem with getting movement fields to automatically update based on the characters statistics, there is a similar issue with getting it to calculate total armor values. <input type="number" value="floor(@{speed}/10)+4"> is the current standing line, however we have tried 10 or 12 others, including workers. Ideally it would display the characters movement which is a base of 4 tiles, + their speed modifier which is speed/10 round down, minus the encumberance penalty which isnt set at the moment.
1587576173
GiGs
Pro
Sheet Author
API Scripter
You need to add disabled  or disabled=true  to inputs that calculate automatically (aka autocalc fields) <input type="number" value="floor(@{speed}/10)+4" disabled> 
No change, still does not find the items nor do math.
1587577452
GiGs
Pro
Sheet Author
API Scripter
I admit I'm a bit rusty with autocalc fields. Maybe you need to put [[ ]] brackets around that. <input type="number" value="[[floor(@{speed}/10)+4]]" disabled>  Failing that, you'll have to post the relevant parts of your code so we can figure out whats going on - the speed input, for example.
<input name="attr_speed" id="speed" type="text" value="0"> no success
1587578027
Andreas J.
Forum Champion
Sheet Author
Translator
In general, it's advised to not use IDs: <a href="https://wiki.roll20.net/Building_Character_Sheets#Only_Use_Classes.2C_not_IDs" rel="nofollow">https://wiki.roll20.net/Building_Character_Sheets#Only_Use_Classes.2C_not_IDs</a>
1587578035
GiGs
Pro
Sheet Author
API Scripter
aha, its because your autocalc field doesnt have a name. &lt;input name="attr_move" type="number" value="floor(@{speed}/10)+4" disabled&gt;&nbsp; Also for your speed attribute, you cant use ids on roll20, you have to use classes. so this &lt;input name="attr_speed" id="speed" type="text" value="0"&gt; should be &lt;input name="attr_speed" class="speed" type="number" value="0"&gt; and you might as well make it a type=number.
considering that its not referencing it as an ID that shouldnt impact it. I've tried making speed a number instead of text with the same result.
1587578259
GiGs
Pro
Sheet Author
API Scripter
The id doesnt affect it - but you wont be able to use css to style it unless you change it to a class. Check my last post for the reason its not working.
Yeah i was saying naming it didnt fix it
1587580134
GiGs
Pro
Sheet Author
API Scripter
I put these lines in a custom sheet and it worked fine &lt;input&nbsp;name="attr_speed"&nbsp;id="speed"&nbsp;type="text"&nbsp;value="0"&gt; &lt;input&nbsp;name="attr_move"&nbsp;type="number"&nbsp;value="floor(@{speed}/10)+4"&nbsp;disabled&gt;&nbsp; If its not working for you, there's something else that is interfering. I'd remove all code from your sheet (just temporarily) and put just those two lines there and test it, to confirm it works.
didnt work. made an entirely new sheet, no remnants or anything, put in those lines, no response
It sorted itself, thank you for the assistance.