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

Attribute not being created.

1612861467

Edited 1612861549
I have very simple attribute <input class="sheet-numbox" style="width: 3em" type="number" name="attr_ac" value="@{ac_base} + @{ac_ability} + @{ac_other}" disabled="disabled" /> However, for some reason the attribute ac is not being created and im unable refer to it. I've tried to change every value in the formula, it gives normal output no problem but attribute is not created. I'm pretty sure it worked at some point but suddenly stopped. Any ideas why its not being created?
1612862859
Ziechael
Forum Champion
Sheet Author
API Scripter
Autocalc fields don't create attributes in the sheets GUI but should be accessible as a reference, I think you need to wrap them in brackets though: value="(@{ac_base} + @{ac_ability} + @{ac_other})"
That's weird I could swear I could use them for token display. Brackets don't help really, still cant reference it on the token to display.
1612866189

Edited 1612866431
Ziechael
Forum Champion
Sheet Author
API Scripter
Will run a quick test... although just noticed this: disabled="disabled" should be disabled="true" or readonly I guess... but that worked for me: <input class="sheet-numbox" style="width: 3em" type="number" name="attr_ac_base" value="10"/> <input class="sheet-numbox" style="width: 3em" type="number" name="attr_ac_ability" value="3"/> <input class="sheet-numbox" style="width: 3em" type="number" name="attr_ac_other" value="0"/> <input class="sheet-numbox" style="width: 3em" type="number" name="attr_ac" value="(@{ac_base} + @{ac_ability} + @{ac_other})" disabled="true" /> And while you won't see them on the attributes tab you can absolutely use them as token references.
1612867516

Edited 1612867781
Ok this works, but how about displaying it. Is there a way to display it on a token? For now it gives out no value. @{ac_ability} for example is a value="@{con}" and it converts it to proper number but, ac for value="(@{ac_base} + @{ac_ability} + @{ac_other})" is blank and doesnt update.
1612869048
Ziechael
Forum Champion
Sheet Author
API Scripter
Ah yeah, now I remember this: <a href="https://app.roll20.net/forum/post/8427520/token-bars-not-syncing-up-with-values/#post-8821985" rel="nofollow">https://app.roll20.net/forum/post/8427520/token-bars-not-syncing-up-with-values/#post-8821985</a> and <a href="https://app.roll20.net/forum/post/8846124/bug-tokens-dont-read-armor-stats-from-3-dot-5-pc-sheet-attributes/?pageforid=8846204#post-8846204" rel="nofollow">https://app.roll20.net/forum/post/8846124/bug-tokens-dont-read-armor-stats-from-3-dot-5-pc-sheet-attributes/?pageforid=8846204#post-8846204</a> Autocalc are somewhat deprecated so it doesn't look like there is going to be much movement in that area as a priority, you are best advised to switch over to sheetworkers instead for setting calculated values (something I really need to get into the habit of myself!).
Well than, thanks for help. It seems I will have to dive deeper into the whole sheet creation, I really hoped to not touch sheetworkers yet. ;(
1612884404
Ziechael
Forum Champion
Sheet Author
API Scripter
They are worth the effort (or so I'm told... I'm too lazy personally)
1612885259
GiGs
Pro
Sheet Author
API Scripter
They are definitely worth the effort! (forum's resident&nbsp;&nbsp;sheet worker fanatic speaking.)