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

Roll Template not calling attributes properly...

Did Roll20 change how custom character sheet rolls are structured? I am using a slightly edited version of Jakob's Better Default Roll Template ( JBDRT)  in a custom character sheet, and suddenly a bunch of my roll buttons are failing (they were working fine previously). EXAMPLE (HTML) <button class="sheet-skactbut" type="roll" value="&{template:custom} {{title=**Academic (@{academic1s})**}} {{subtitle=@{cname}}} {{SCORE=[[ 1d20+[[@{academic1}]]+[[@{edumod}]] -[[@{impairment}]][Impairment] ]]}}" name="rollSkill"></button> The html above used to call a roll, using titling and caption that called on stored string attributes. For example,  academic1s   is the specific name of the (write-in) Academic skill;  cname  is the character's name (this identifies who the roll was made for, using the JBDRT caption feature);  academic1  (without the "s" on the end) is the attribute containing the skill value;  edumod  is the Education attribute modifier; and  impairment  is the attribute representing any impairment the character may be suffering (complete with a label for easy identification of the modifier's purpose). All this previously worked. Now I get this... Any ideas? Thanks in advance for any assistance you can offer.
1685861339
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Nothing has changed. This usually happens when the sheet in question has a non numerical value, or a roll syntax character(s) that are screwing up the values.
1685861430

Edited 1685861526
GiGs
Pro
Sheet Author
API Scripter
Does this work when called as a character ability? &{template:custom} {{title=**Academic (@{academic1s})**}} {{subtitle=@{cname}}} {{SCORE=[[ 1d20+[[@{academic1}]]+[[@{edumod}]] -[[@{impairment}]][Impairment] ]]}} For that matter, what about this (again, create as an ability on the character): /roll 1d20+@{academic1} + @{edumod} - @{impairment} If any of them fail, I'd check the contents of those attributes and make sure each is a number. As an aside, this shouldn't affect it, but it looks like you have too many inline roll brackets there. This would also work exactly the same: &{template:custom} {{title=**Academic (@{academic1s})**}} {{subtitle=@{cname}}} {{SCORE=[[ 1d20+@{academic1}+@{edumod} -@{impairment}[Impairment] ]]}} If there's something in those attribute values that makes this fail, you could slap normal parentheses around them, like &{template:custom} {{title=**Academic (@{academic1s})**}} {{subtitle=@{cname}}} {{SCORE=[[ 1d20+(@{academic1})+(@{edumod}) -(@{impairment})[Impairment] ]]}} Generally, IMO you should use no more inline roll brackets than you need to. hehe I see I've been ninja'd by Scott.
Thanks, guys, for your speedy responses. And thanks, GiGs for the detailed response including examples. My understanding of bracket usage is...limited to say the least, and consists mainly of copying and modifying things other people have done. That can result in roll syntax that is a bit kludgy. I will try your suggestions out and see if they work. Odd thing, though, is that for all their kludginess, these rolls worked previously. Weird. Thanks again! Michael
1685919793
GiGs
Pro
Sheet Author
API Scripter
Have you tried any of the suggestions? If you still get failures, try each of /roll 1d0 + @{academic1} or just @{academic1} As abilities on the character - try each attribute ad see what you get in chat.
GiGs said: Have you tried any of the suggestions? So, GiGs, an update. Yes, your suggested replacement (without the extra brackets) worked fine. I plan to implement this to all the other skills just to reduce pointless brackets. Thanks for that!  But that's not the weird part... When I went to my character sheet to test it, suddenly EVERYTHING was screwed up. Attribute based CSS was broken, other CSS based pieces were gone, background layers had gone transparent, and many of the functions no longer worked. It was the weirdest thing I had ever seen on Roll20! I went to the CSS sheet, and all the original CSS was unchanged. Same with the HTML sheet and all of the scriptworker javascript. Nevertheless the character sheet remained messed up. So then, as a test, I created a new game, copied over all the CSS, HTML and Javascript. Dragged over the test character with transmogrifier. He looked fine. everything is working fine again. INCLUDING the old roll buttons (the ones with more brackets than they really need). The new game  worked fine. But the original game? Still effed up. What in the heck! Have you ever heard of anything like this happening before? An entire game going wonky?
1685955568
GiGs
Pro
Sheet Author
API Scripter
Do you know what the Lagacy sanitisation checkbox is? That's the thing that immediately occurs to me. On the page where you save the html/css/translations, just above the edit window should be a checkbox. See if its checked? If so uncheck it and save. If it's not checked, check it and save. Then load the campaign and see if its working. If that fixes things, here's the cause: a while back, Roll20 introduced some changes to hTML and CSS. But a lot of sheets were written under the old (Legacy) version, so they had to provide a way to use that code. So with the legacy Santisation checkbox you switch between the two versions. Did that work for you?
GiGs said: Did that work for you? Yep. That does indeed seem to have been the culprit. Messed everything up good. Apparently it was unchecked, and somehow got checked (not sure how that happened). So, does this mean that I am doing m CSS and HTML wrong? It says this "Forces sheet to use the more limited legacy version of CSS and HTML." So it holds it to a tighter standard?
1686005692
GiGs
Pro
Sheet Author
API Scripter
The old (Legacy) styll is fine if you're used to it. Lots of older sheets still use it without issues The problem you described in the first post was not related to that. If you're interested, modifying a sheet to use the more modern CSE style does take a bit of know-how. It can be done relatively easily but there are gotchas that can catch you out.
GiGs  said: The old (Legacy) styll is fine if you're used to it. Lots of older sheets still use it without issues The weird thing, though, is that it was  UN checked. Meaning I was not using legacy sanitization and it was working fine. It was when it got checked that it went wonky. GiGs said: The problem you described in the first post was not related to that. You're sure about that? Because all my rolls started working again the moment I switched it back over to having the "Use legacy sanitization" be unchecked. Even the ones with too many brackets.
1686017715
GiGs
Pro
Sheet Author
API Scripter
The description of the problem you described didn't match my understanding, which may be lacking - I dont know how exactly your sheet is built and Roll20 has its own quirks so who knows :)
GiGs said: Roll20 has its own quirks so who knows :) Very true! lol  Well thank you for all your help. You're awesome, in case no one's told you so recently!
1686018530
GiGs
Pro
Sheet Author
API Scripter
No one has told me that recently. I really do appreciate it :)