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

Repeating sections - Referencing attributes

Greetings people I have a problem with repeating sections. This is my code: <fieldset class="repeating_skills"> <input type="text" name="attr_FertigkeitName" value=""> <input type="number" name="attr_FertigkeitWert" value="0" title="Fertigkeitswert ohne Boni" /> <select name="attr_FertigkeitAttribut"> <option value="@{Stärke}" selected="selected">Stärke</option> <option value="@{Geschick}">Geschick</option> <option value="@{Konstitution}">Konstitution</option> <option value="@{Willenskraft}">Willenskraft</option> <option value="@{Weisheit}">Weisheit</option> <option value="@{Charisma}">Charisma</option> <option value="@{Wahrnehmung}">Wahrnehmung</option> </select> <input type="text" name="attr_FertigkeitAttributBonus" value="(@{FertigkeitAttribut})" disabled="true" /> <input type="text" name="attr_FertigkeitGesamt" value="((@{FertigkeitWert})+(@{FertigkeitAttributBonus}))" disabled="true" /> <button type="roll" value= "&{template:custom} {{title=Probe auf @{selected|repeating_skills_FertigkeitName}}} {{subtitle=@{selected|character_name}}} {{result=[[ [[floor([[[[@{selected|repeating_skills_skill_total}]] / 3]])]]d6 + [[[[@{selected|repeating_skills_skill_total}] % 3]] + ?{Modifikator|0}]] }}" name="FertigkeitProbe"></button> </fieldset> The problem lies in the roll button at the end. It can't find the correct attributes. The wiki says you need some variable, but I don't understand how to put it in correctly. Can somebody help me please? Kind regards Blacksaeus PS: I use "Jakob's Better Default Rolltemplate" and I hope you can handle the german terms in the code. ;)
1648916530
Kraynic
Pro
Sheet Author
Do you actually have the attributes it is looking for? repeating_skills_skill_total Does that actually exist on the sheet somewhere?
There is an attribute in the line above the <button>. <input type="text" name="attr_FertigkeitGesamt" value="((@{FertigkeitWert})+(@{FertigkeitAttributBonus}))" disabled="true" />
1648918835

Edited 1648919061
Andreas J.
Forum Champion
Sheet Author
Translator
It's probably a good idea to remove the " selected| " part in the macros, as it forces you to always have a token selected, breaking any roll if no token is selected. Also change the name at the end to: name=" roll_ FertigkeitProbe"&gt;&lt;/button&gt; this will make it possible to call the buttons with chat commands or drag to your macro quickbar. <a href="https://wiki.roll20.net/Button#Roll_Button" rel="nofollow">https://wiki.roll20.net/Button#Roll_Button</a> Blacksaeus said: &lt;input type="text" name="attr_FertigkeitGesamt" value="((@{FertigkeitWert})+(@{FertigkeitAttributBonus}))" disabled="true" /&gt; Then you need to change it's name to make the calculation work(or the other way around): &lt;input type="text" name=" attr_skill_total " value="((@{FertigkeitWert})+(@{FertigkeitAttributBonus}))" disabled="true" /&gt;
1648919663

Edited 1648919705
You mean like this: &lt;button type="roll" value= "&amp;{template:custom} {{title=Probe auf @{selected|FertigkeitName}}} {{subtitle=@{selected|character_name}}} {{Ergebnis=[[ [[floor([[[[@{selected|FertigkeitGesamt}]] / 3]])]]d6 + [[[[@{selected|FertigkeitGesamt}]] % 3]] + ?{Modifikator|0}]] }}" name="roll_FertigkeitProbe"&gt;&lt;/button&gt; The line before is still: &lt;input type="text" name="attr_FertigkeitGesamt" value="((@{FertigkeitWert})+(@{FertigkeitAttributBonus}))" disabled="true" /&gt; I'm calling the same attribute or do I miss something?
Still getting the same fail message: No attribute was found for @{selected|FertigkeitGesamt}
1648920010
Andreas J.
Forum Champion
Sheet Author
Translator
Do this: &lt;button type="roll" value= "&amp;{template:custom} {{title=Probe auf @{FertigkeitName}}} {{subtitle=@{character_name}}} {{Ergebnis=[[ [[floor([[[[@{FertigkeitGesamt}]] / 3]])]]d6 + [[[[@{FertigkeitGesamt}]] % 3]] + ?{Modifikator|0}]] }}" name="roll_FertigkeitProbe"&gt;&lt;/button&gt; Hardcoding @{selected|FertigkeitGesamt}&nbsp; with the selected part is a really bad idea, as I said.
1648920263

Edited 1648920299
I don't know why but it worked like a charm. :) The @{selcted|...} part works in every over part of my code but in the repeating sections it's a problem. Can you please explain to me why this is the case? Thank you for your help. :)
1648929349

Edited 1648929418
Andreas J.
Forum Champion
Sheet Author
Translator
Blacksaeus said: The @{selcted|...} part works in every over part of my code but in the repeating sections it's a problem. Can you please explain to me why this is the case? No idea why it doesn't work, but there are tons of weird things with repeating sections so I am not surprised this is happening: <a href="https://wiki.roll20.net/BCS/Repeating_Section#Definition_.26_Restrictions" rel="nofollow">https://wiki.roll20.net/BCS/Repeating_Section#Definition_.26_Restrictions</a> <a href="https://wiki.roll20.net/Character_Sheet_Development/Bugs_%26_Quirks#Repeating_Sections" rel="nofollow">https://wiki.roll20.net/Character_Sheet_Development/Bugs_%26_Quirks#Repeating_Sections</a> Just don't use the @{selcted|...} at all on your sheet, it just makes things harder for the user, as I explained.