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

[Help Needed-Desperate] Using ScriptCards from WITHIN a repeating Section

I have recently asked a number of questions within the ScriptCards thread regarding using ScriptCards INSIDE repeating sections.  Over the course of a week or so I received limited answers, and none that seemed to address the heart of the matter.  People on this threat suggested I ask my question elsewhere as it was a "character sheet" issue and not a ScriptCards issue.  I am not sure I agree, but I wasn't going to argue with people who are better at coding than I. For greater history on my question please take a look at it over on this thread: script-scriptcards-my-spiritual-successor-to-powercards As for my question: I am trying to create a ScriptCard command/script/whatever you want to call it—that will roll from INSIDE of a repeating section using the values from that specific row of the repeating section. The issue that I am running into is that the ScriptCard doesn’t seem to understand where/what attribute I am trying to assign to variables or use in rolls. The only way that I can see to reference roll values is through the command: --Rfind|@{selected|character_id};Greatsword;repeating_attack;atkname Which isn’t particularly useful if you want to roll a repeating section for which you do not have the attack name.  As when you press a roll button from INSIDE of that section. I have been told that this question isn’t a ScriptCards question but instead a Character Sheet question—something I dispute—but I also know I have probably worn my welcome out in the ScriptCards forums.  And if I ask more questions, I might alienate the only people who can help (I get frustrated quickly, when I cant express what I am trying to do). So I am looking for anyone who knows both character sheets and ScriptCards to help me with this issue, or help explain why what I am trying to do isn’t a character sheet specific problem.   Thank you in advance for the help.  Sorry if this comes out as stiff or formal.
1653069415
Kraynic
Pro
Sheet Author
Did you try my suggestion from that other thread?&nbsp; <a href="https://app.roll20.net/forum/permalink/10871039/" rel="nofollow">https://app.roll20.net/forum/permalink/10871039/</a> If you are using a button from within a repeating section, it automatically uses the attributes from that row, so you don't reference the repeating section at all.
Kraynic said: Did you try my suggestion from that other thread?&nbsp; <a href="https://app.roll20.net/forum/permalink/10871039/" rel="nofollow">https://app.roll20.net/forum/permalink/10871039/</a> If you are using a button from within a repeating section, it automatically uses the attributes from that row, so you don't reference the repeating section at all. Yes, see here&nbsp;<a href="https://app.roll20.net/forum/post/9752053/script-scriptcards-my-spiritual-successor-to-powercards/?pageforid=10872514#post-10872514" rel="nofollow">https://app.roll20.net/forum/post/9752053/script-scriptcards-my-spiritual-successor-to-powercards/?pageforid=10872514#post-10872514</a>&nbsp;
1653089933
Kraynic
Pro
Sheet Author
Hmm, another thing.&nbsp; How is the macro called by your attack button structured?&nbsp; I think your scriptcards command would need to be at the start of a new line, and it might not be when being called by the macro from that text area.
1653104612

Edited 1653104855
Toby
Pro
Kraynic said: Hmm, another thing.&nbsp; How is the macro called by your attack button structured?&nbsp; I think your scriptcards command would need to be at the start of a new line, and it might not be when being called by the macro from that text area. It is the first thing on the line.&nbsp; Here is the repeating section HTML code: &lt;!-- WEAPON REPEATING CODE --&gt; &nbsp; &nbsp; &lt;!-- DEBUG Tab Tab --&gt; &nbsp; &nbsp; &lt;!-- This tab contains WORK in PROGRESS content as well as a selection of DEBUG tools for the GM and sheet authors --&gt; &nbsp; &nbsp; &lt;div class="sheet-wrapper"&gt; &lt;span class="sheet-nontable-name" data-i18n="attacks"&gt;Attacks&lt;/span&gt; &lt;input type="checkbox" name="attr_weapon-min-show"&nbsp; &nbsp; class="sheet-minimize-show&nbsp; &nbsp; &nbsp;sheet-cssbutton" title="Minimize all rows."&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;data-i18n-title="minimize-all-cmd"&nbsp; &nbsp;value="1" /&gt;&lt;span&gt;&lt;/span&gt; &lt;input type="checkbox" name="attr_weapon-expand-show" class="sheet-lock-show&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sheet-cssbutton" title="Collapse or expand all rows." data-i18n-title="expand-cmd"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value="1"/&gt;&lt;span&gt;&lt;/span&gt; &lt;input type="checkbox" name="attr_weapon-column-show" class="sheet-split-column-show sheet-cssbutton" title="Split into two columns."&nbsp; &nbsp; &nbsp; data-i18n-title="column-cmd"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value="1"/&gt;&lt;span&gt;&lt;/span&gt; &lt;div class="sheet-repeating-fields"&gt; &lt;fieldset class="repeating_weapon"&gt; &lt;div class="sheet-nontable-repeating"&gt; &lt;input type="checkbox" name="attr_row-show" class="sheet-counted sheet-sect-show" title="Minimize Row" data-i18n-title="minimize-cmd" value="1" checked="checked" /&gt;&lt;span&gt;&lt;/span&gt; &lt;!--&lt;span class="sheet-repeating-rollbutton"&gt;&lt;button type="roll" name="attr_roll" class="sheet-dice" title="%{selected|repeating_weapon_$X_roll}" value="@{macro-text}"&gt;t&lt;/button&gt;&lt;/span&gt;--&gt; &lt;label class="sheet-small-label2 sheet-limit"&gt; &lt;select name="attr_wProficiency" data-li8n-title="weapon-proficiency-title"&gt; &lt;option selected data-i18n="yes-default"&gt;• Yes&lt;/option&gt; &lt;option data-i18n="no"&gt;No&lt;/option&gt; &lt;/select&gt;&lt;span data-i18n="weapon-proficiency-abbr"&gt;Prof.&lt;/span&gt; &lt;!--&lt;input type="checkbox" name="attr_proficiency" title="@{repeating_weapon_$X_proficiency}" data-li8n-title="weapon-proficiency-title" /&gt;--&gt; &lt;/label&gt; &lt;label class="sheet-small-label2 sheet-repname"&gt; &lt;input type="text" name="attr_name" title="@{repeating_weapon_$X_name}" data-li8n-title="weapon-name-title" data-i18n-placeholder="weapon-name" /&gt; &lt;span data-i18n="weapon-name"&gt;Name&lt;/span&gt; &lt;/label&gt; &lt;label class="sheet-small-label2"&gt; &lt;select name="attr_wClass" data-li8n-title="weapon-class-title"&gt; &lt;option selected data-i18n="select-default"&gt;• Select&lt;/option&gt; &lt;option data-i18n="wType-basic"&gt;Basic&lt;/option&gt; &lt;option data-i18n="wType-heavy"&gt;Heavy&lt;/option&gt; &lt;option data-i18n="wType-melee"&gt;Melee&lt;/option&gt; &lt;option data-i18n="wType-pistol"&gt;Pistol&lt;/option&gt; &lt;option data-i18n="wType-thrown"&gt;Thrown&lt;/option&gt; &lt;/select&gt;&lt;span data-i18n="weapon-class"&gt;Class&lt;/span&gt; &lt;!--&lt;input type="text" name="attr_class" title="@{repeating_weapon_$X_class}" data-li8n-title="weapon-class-title" placeholder="Class" data-i18n="class" class="sheet-range"/&gt;--&gt; &lt;/label&gt; &lt;label class="sheet-small-label2 sheet-macro-text-inline"&gt; &lt;input type="text" name="attr_damage" title="@{repeating_weapon_$X_damage}" data-i18n-placeholder="weapon-damage-placeholder" value="0" style="width: 5em;"/&gt; &lt;span data-i18n="weapon-damage"&gt;Damage&lt;/span&gt; &lt;/label&gt; &lt;label class="sheet-small-label2"&gt; &lt;select name="attr_wType"&gt; &lt;option selected data-i18n="e-u"&gt;E&lt;/option&gt; &lt;option data-i18n="i-u"&gt;I&lt;/option&gt; &lt;option data-i18n="r-u"&gt;P&lt;/option&gt; &lt;option data-i18n="x-u"&gt;X&lt;/option&gt; &lt;/select&gt;&lt;span data-i18n="type"&gt;Type&lt;/span&gt; &lt;!-- &lt;input type="text" name="attr_damType" data-li8n-title="weapon-type-title" data-i18n-placeholder="weapon-type-placeholder" class="sheet-range"/&gt; --&gt; &lt;/label&gt; &lt;label class="sheet-small-label2"&gt; &lt;input type="number" name="attr_pen" title="@{repeating_weapon_$X_pen} Penetration" style="width: 2.5em;"/&gt; &lt;span data-i18n="weapon-pen-abbr"&gt;Pen&lt;/span&gt; &lt;/label&gt; &lt;div class="sheet-RangeGroup"&gt; &lt;label class="sheet-small-label2"&gt; &lt;input type="number" name="attr_range-PB" class="sheet-range" value="3" disabled /&gt;&lt;span data-i18n="weapon-range-pb-abbr"&gt;Point Blank&lt;/span&gt; &lt;/label&gt; &lt;label class="sheet-small-label2"&gt; &lt;input type="number" name="attr_range-S" class="sheet-range" value="[[floor(@{range-n}/2)]]" min="0" disabled /&gt;&lt;span data-i18n="weapon-range-s-abbr"&gt;Short&lt;/span&gt; &lt;/label&gt; &lt;label class="sheet-small-label2"&gt; &lt;input type="number" name="attr_range-N" class="sheet-range" value="0" min="0" /&gt;&lt;span data-i18n="weapon-range-n-abbr"&gt;Normal&lt;/span&gt; &lt;/label&gt; &lt;label class="sheet-small-label2"&gt; &lt;input type="number" name="attr_range-M" class="sheet-range" value="@{range-n}*2" disabled /&gt;&lt;span data-i18n="weapon-range-m-abbr"&gt;Med&lt;/span&gt; &lt;/label&gt; &lt;label class="sheet-small-label2"&gt; &lt;input type="number" name="attr_range-L" class="sheet-range" value="@{range-n}*3" disabled /&gt;&lt;span data-i18n="weapon-range-l-abbr"&gt;Long&lt;/span&gt; &lt;/label&gt; &lt;label class="sheet-small-label2"&gt; &lt;input type="number" name="attr_range-E" class="sheet-range" value="@{range-n}*4" disabled /&gt;&lt;span data-i18n="weapon-range-e-abbr"&gt;Extreme&lt;/span&gt; &lt;/label&gt; &lt;/div&gt; &lt;label class="sheet-small-label2 sheet-RoFGroup"&gt; &lt;input type="number" name="attr_RoF1" title="@{repeating_weapon_$X_rof1}" data-li8n-title="weapon-rof-title" class="sheet-range sheet-inlineblock" value="0" min="0" /&gt; &lt;span class="sheet-divider-db-lg"&gt;/&lt;/span&gt;&lt;input type="number" name="attr_RoF2" title="@{repeating_weapon_$X_rof2}" value="0" min="0" class="sheet-range sheet-inlineblock"/&gt; &lt;span style="position: absolute; top: 1.9em; right: 1.1em; width: fit-content;"&gt;Rate of Fire&lt;/span&gt; &lt;span class="sheet-divider-db-lg"&gt;/&lt;/span&gt;&lt;input type="number" name="attr_RoF3" title="@{repeating_weapon_$X_rof3}" value="0" min="0" class="sheet-range sheet-inlineblock "/&gt; &lt;/label&gt; &lt;label class="sheet-small-label2 sheet-ClipGroup sheet-limit"&gt; &lt;input type="number" name="attr_clip" title="@{repeating_weapon_$X_clip}" data-li8n-title="weapon-clip-title" value="0" min="0" class="sheet-range sheet-inlineblock"/&gt; &lt;span class="sheet-divider-db-lg"&gt;/&lt;/span&gt;&lt;input type="number" name="attr_clip|max" class="sheet-range sheet-inlineblock" title="@{repeating_weapon_$X_clip|max}" value="0" min="0"/&gt; &lt;span data-i18n="weapon-clip" style="position: absolute; top: 1.9em; right: 2.5em; width: fit-content;"&gt;Clip&lt;/span&gt; &lt;/label&gt; &lt;label class="sheet-small-label2 sheet-limit"&gt; &lt;input type="number" name="attr_reload" class="sheet-range" title="@{repeating_weapon_$X_reload}" data-li8n-title="weapon-reload-title" value="0" min="0" /&gt; &lt;span data-i18n="weapon-reload"&gt;Reload&lt;/span&gt; &lt;/label&gt; &lt;div class="sheet-small-label2 sheet-sect sheet-limit" style="width:39%; top: 8px;"&gt;&lt;!-- spit: --&gt; &lt;textarea name="attr_notes" class="sheet-repnotes" title="@{repeating_weapon_$X_notes}" placeholder="Weapon Notes"&gt;&lt;/textarea&gt; &lt;br&gt;&lt;span data-i18n="notes"&gt;Notes&lt;/span&gt; &lt;/div&gt; &lt;button name="roll_rangedattack" type="roll" value="@{wHitRoll}"&gt;&lt;label&gt;Attack&lt;/label&gt;&lt;/button&gt; &lt;label&gt;&lt;input type='checkbox' name='attr_toggle-section' value="1" class="section-collapse noshow" checked=""&gt;&lt;b title="Show/Hide Advanced Weapon Details"&gt;Hide Advanced&lt;/b&gt;&lt;/label&gt; &lt;!-- it doesnt need to be a checkbox --&gt; &lt;input class='section-toggle' type='hidden' name='attr_toggle-section'&gt; &lt;div class="section-hide"&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-accurate"&nbsp; &nbsp; class="boldlabel-check noshow"&gt; &lt;b title="Gain +10 to Hit when the aim action is used." data-il8n="w-accurate" data-il8n-title="w-accurate-title"&gt;Accurate&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-balanced"&nbsp; &nbsp; class="boldlabel-check noshow"&gt; &lt;b title="Gain +10 to bonus to WS Tests when parrying." data-il8n="w-balanced" data-il8n-title="w-balanced-title"&gt;Balanced&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-blast"&nbsp; &nbsp; &nbsp; &nbsp;class="boldlabel-check noshow"&gt; &lt;b title="Weapon deals its damage in X meters.&nbsp; Roll Hit/Damage separately." data-il8n="w-blast" data-il8n-title="w-blast-title"&gt;Blast&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-defensive"&nbsp; &nbsp;class="boldlabel-check noshow"&gt; &lt;b title="Gain +15 bonus to Tests to Parry but -10 Penalty when used to attack." data-il8n="w-defensive" data-il8n-title="w-defensive-title"&gt;Defensive&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-flame"&nbsp; &nbsp; &nbsp; &nbsp;class="boldlabel-check noshow"&gt; &lt;b title="Deals damage in a 30 degree cone out to the limit of the range.&nbsp; No roll to hit required.&nbsp; Those struck must succeed an Ag Test or take damage normally and must make a second Ag Test or catch fire.&nbsp; Cover does not protect against these attacks.&nbsp; Flame weapons always hit the BODY and are considered to have JAMMED on an unmodified 9 on the damage dice." data-il8n="w-flame" data-il8n-title="w-flame-title"&gt;Flame&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-flexible"&nbsp; &nbsp; class="boldlabel-check noshow"&gt; &lt;b title="Cannot be Parried." data-il8n="w-flexible" data-il8n-title="w-flexible-title"&gt;Flexible&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-hotshot"&nbsp; &nbsp; &nbsp;class="boldlabel-check noshow"&gt; &lt;b title="" data-il8n="w-hotshot" data-il8n-title="w-hotshot-title"&gt;Hotshot&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-inaccurate"&nbsp; class="boldlabel-check noshow"&gt; &lt;b title="Gain no bonus to hit when using the AIM action." data-il8n="w-inaccurate" data-il8n-title="w-inaccurate-title"&gt;Inaccurate&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-overheats"&nbsp; &nbsp;class="boldlabel-check noshow"&gt; &lt;b title="Roll an OVERHEAT mishap on an unmodified 91+ on the HIT dice." data-il8n="w-overheats" data-il8n-title="w-overheats-title"&gt;Overheats&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-power_field" class="boldlabel-check noshow"&gt; &lt;b title="Weapon has increased Penetration.&nbsp; All non-powered weapons have a 75% chance to break when parrying powered weapons." data-il8n="w-powered" data-il8n-title="w-powered-title"&gt;Power Field&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-primitive"&nbsp; &nbsp;class="boldlabel-check noshow"&gt; &lt;b title="Defenders` armor is doubled against Primitive Weapons." data-il8n="w-primitive" data-il8n-title="w-primitive-title"&gt;Primitive&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-recharge"&nbsp; &nbsp; class="boldlabel-check noshow"&gt; &lt;b title="Weapon requires 1 round to recharge (it can only be fired once every two rounds)." data-il8n="w-recharge" data-il8n-title="w-recharge-title"&gt;Recharge&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-reliable"&nbsp; &nbsp; class="boldlabel-check noshow"&gt; &lt;b title="If the weapon JAMS roll 1d10.&nbsp; The weapon JAMS only on a natural 10, otherwise treat as a normal miss." data-il8n="w-reliable" data-il8n-title="w-reliable-title"&gt;Reliable&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-sanctified"&nbsp; class="boldlabel-check noshow"&gt; &lt;b title="(Blood of Martyrs) Denies Daemonic creatures their double Toughness bonus when they soak damage." data-il8n="w-sanctified" data-il8n-title="w-sanctified-title"&gt;Sanctified&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-scatter"&nbsp; &nbsp; &nbsp;class="boldlabel-check noshow"&gt; &lt;b title="If fired within Point-Blank range, gain an extra hit for each 2 degrees of success.&nbsp; All Armor Points are Doubled when firing at long or extreme range." data-il8n="w-scatter" data-il8n-title="w-scatter-title"&gt;Scatter&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-shocking"&nbsp; &nbsp; class="boldlabel-check noshow"&gt; &lt;b title="If target takes at least 1 pt. of damage (after soak), they must succeed a Toughness Test (with a +10 for each point of armor in that location).&nbsp; If they fail the Test, they are stunned for a number of rounds equal to half the damage they took." data-il8n="w-shocking" data-il8n-title="w-shocking-title"&gt;Shocking&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-smoke"&nbsp; &nbsp; &nbsp; &nbsp;class="boldlabel-check noshow"&gt; &lt;b title="Deals no damage by instead creates a cloud of smoke 3d10 meters in diameter from the point of impact.&nbsp; This lasts for 2d10 rounds (less in adverse weather)." data-il8n="w-smoke" data-il8n-title="w-smoke-title"&gt;Smoke&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-snare"&nbsp; &nbsp; &nbsp; &nbsp;class="boldlabel-check noshow"&gt; &lt;b title="On a successful hit, Target must make an Ag Test or be immobilized.&nbsp; To break free, they must succeed a STR or Ag Test.&nbsp; Target is considered helpless until they escape." data-il8n="w-snare" data-il8n-title="w-snare-title"&gt;Snare&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-storm"&nbsp; &nbsp; &nbsp; &nbsp;class="boldlabel-check noshow"&gt; &lt;b title="(Blood of Martyrs) Doubles the number of hits for each shot fired.&nbsp; Every degree of success (for full auto) or two degrees (for semi-auto) up to the listed fire rate results in two hits even when firing single shots." data-il8n="w-storm" data-il8n-title="w-storm-title"&gt;Storm&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-tearing"&nbsp; &nbsp; &nbsp;class="boldlabel-check noshow"&gt; &lt;b title="Roll damage twice and take the highest." data-il8n="w-tearing" data-il8n-title="w-tearing-title"&gt;Tearing&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-toxic"&nbsp; &nbsp; &nbsp; &nbsp;class="boldlabel-check noshow"&gt; &lt;b title="Anyone who takes damage from this weapon (after soak) must succeed a Toughness Test (-5 for each point of damage taken) or take an immediate 1d10 points of impact damage to the target with no reduction from armor or toughness." data-il8n="w-toxic" data-il8n-title=""&gt;Toxic&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-unbalanced"&nbsp; class="boldlabel-check noshow"&gt; &lt;b title="Suffer a -10 Penalty when Parrying." data-il8n="w-unbalanced" data-il8n-title="w-unbalanced-title"&gt;Unbalanced&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-unreliable"&nbsp; class="boldlabel-check noshow"&gt; &lt;b title="Jams on a 91+, even if fired on Semi- or Full-Auto." data-il8n="w-unreliable" data-il8n-title="w-unreliable-title"&gt;Unreliable&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-unstable"&nbsp; &nbsp; class="boldlabel-check noshow"&gt; &lt;b title="Deals variable damage.&nbsp; Roll a 1d10.&nbsp; 1: Half Damage; 2-9: Normal Damage; 10: Double Damage." data-il8n="w-unstable" data-il8n-title="w-unstable-title"&gt;Unstable&lt;/b&gt;&lt;/label&gt; &lt;label class="sheet-inlineblock"&gt;&lt;input type="checkbox" value="1" name="attr_q-unwieldy"&nbsp; &nbsp; class="boldlabel-check noshow"&gt; &lt;b title="Cannot be used to Parry." data-il8n="w-unwieldy" data-il8n-title="w-unwieldy-title"&gt;Unwieldy&lt;/b&gt;&lt;/label&gt; &lt;/div&gt; &lt;!-- REPEATING WEAPON ATTACK/DAMAGE MACROS --&gt; &lt;div class="sheet-sect sheet-expand"&gt; &lt;input type="checkbox" class="sheet-showarrow sheet-macro-text-show" title="Click to expand" data-i18n-title="showsect-cmd" aria-label="Show Macro Text" name="attr_macro-text-show" value="1"/&gt; &lt;label class="sheet-showsect sheet-macro-text-showlabel" data-i18n="macro-text"&gt;Macro Text&lt;/label&gt; &lt;input type="checkbox" class="sheet-showarrow sheet-misc-attack-show" name="attr_misc-attack-show" value="1" checked title="Misc Weapon &amp; attack details"/&gt; &lt;label class="sheet-showsect sheet-misc-attack-showlabel" data-i18n="miscellaneous-abbrv"&gt;Misc Details&lt;/label&gt; &lt;input type="checkbox" class="sheet-showarrow sheet-id-show" title="Click to expand" data-i18n-title="showsect-cmd" aria-label="Show Row ID" name="attr_ids-show" value="1"/&gt; &lt;label class="sheet-showsect sheet-id-showlabel" data-i18n="identification-abbrv"&gt;ID&lt;/label&gt; &lt;div class="sheet-cheat"&gt;&lt;/div&gt; &lt;div class="sheet-macro-text" style="width:100%;height:auto !important;clear:both;"&gt; &lt;label class="sheet-small-label2" style="width:100%;height:auto !important;margin-left:0;margin-right:0;padding-left:2px;padding-right:2px;"&gt; &lt;span data-i18n="full-macro"&gt;Full Macro:&lt;/span&gt; &lt;textarea class="sheet-macro-text" title="@{repeating_weapon_$X_wHitRoll}" name="attr_wHitRoll"&gt;!scriptcard {{ --/| === ScriptCard Layout for Attack Rolls === |\-- --/| === Version 0.1a&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=== |\-- --/| === Date: 05/03/2022&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=== |\-- --/| I have tried [*R:name] [*R&gt;name] @{name} @{repeating_weapon_$X_name} @{repeating_weapon_0_name} --/| @{repeating_weapon_0_name} actually gives the correct value, but I'd have to hard code each row individually, which I dont think.. --/| is possible. So I continue --#title|Attack Name [*R:name] --#titlecardbackground|#993333 --#leftsub|LEFT SUB --#rightsub|RANGE m [AMMO/AMMO^] --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --#emoteText|[*S:t-name] attacks [*T:t-name] --/| === Roll Queries and Variables --&amp;AtkMod|?{Modifier|0} --&amp;AimType|?{Aim | No aim (+0),+0 | Half aim (+10),+10| Full aim (+20),+20} --&amp;RangeType|?{Range | Point Blank (+30),+30 | Short Range (+10),+10 | Standard range (+0),+0 | Long Range (-10),-10 | Extreme Range (-30),-30} --&amp;RoFType|?{Rate of Fire/Attack Type| Standard (+10),+10 | Semi auto (+0),+0 | Full Auto (-10),-10 | Called Shot (-20),-20 | Suppressing Fire (-20),-20} --=AtkTarget|[*S:BS] [BS] + [&amp;AimType] [Aim] + [&amp;RangeType] [Range] + [&amp;RoFType] + [Rate of Fire] + [&amp;AtkMod] [Modifier] --=AtkRoll|1d100 --&amp;BodyHit|Null --=DegSucess|[$AtkTarget] - [$AtkRoll] \ 10 --/| === Roll Details Tables --+|[c]● Roll Details ●[/c] --+[c][t border=2 width=95% align=center][tr][td][b]Skill&nbsp; &nbsp; [/b][/td][td][b]Aim&nbsp; &nbsp; &nbsp; [/b][/td][td][b]Range&nbsp; &nbsp; [/b][/td][td][b]RoF&nbsp; &nbsp; &nbsp; [/b][/td][td][b]Modifier [/b][/td][/tr][tr][td][*S:BS][/td][td][&amp;AimType][/td][td][&amp;RangeType][/td][td][&amp;RoFType][/td][td][&amp;AtkMod][/td][/tr][/t][/c]| --+|[c][t border=2 width=95% align=center][tr][td][b]Total&nbsp; [/b][/td][td][b]Target [/b][/td][/tr][tr][td][$AtkRoll]&nbsp; &nbsp;[/td][td][$AtkTarget] [/td][/tr][/t][/c] --/| ====== Check if AttackRoll is less than the test THRESHOLD --?[$AtkRoll.Total] -le [$AtkTarget.Total]|Success --?[$AtkRoll.Total] -gt [$AtkTarget.Total]|Failure --:Success| --+[c][#3FB315]HIT! ([$DegSucess.Total])[/#][/c]| --^Done| --:Failure| --+[c][#B31515]MISS! ([$DegSucess.Total])[/#][/c]| --^Done| --:Jam| --+[c]JAM![/c]| --^Done| --:Done| --?[$AtkRoll] -lt 10|[ --&amp;rollStr|0[$AtkRoll.Raw] --]|[ --&amp;rollStr|[$AtkRoll.Raw] --]| --~len|string;length;[&amp;rollStr] --%i|[$len];1;-1 --~s|string;substring;[&amp;i];1;[&amp;rollStr] --&amp;revStr|+[&amp;s] --%| --=revRoll|[&amp;revStr] --/| === Out of Range Values Included for Debugging === --?[$revRoll] -le 0|&gt;SetHitLocation;Error - Out of Range --?[$revRoll] -le 10|&gt;SetHitLocation;Head --?[$revRoll] -ge 11 -and -le 20|&gt;SetHitLocation;Right Arm --?[$revRoll] -ge 21 -and -le 30|&gt;SetHitLocation;Left Arm --?[$revRoll] -ge 31 -and -le 70|&gt;SetHitLocation;Body --?[$revRoll] -ge 71 -and -le 85|&gt;SetHitLocation;Right Leg --?[$revRoll] -ge 86|&gt;SetHitLocation;Left Leg --?[$revRoll] -ge 101|&gt;SetHitLocation;Error - Out of Range --+[c][b][#3FB315][&amp;BodyHit][/#][/b][/c]| --X| End Macro --:PROCEDURES| --:SetHitLocation| accepts hit location as parameter &nbsp; &nbsp; --&amp;BodyHit|[%1%] --&lt;| }} &lt;/textarea&gt; &lt;/label&gt; &lt;/div&gt; &lt;div class="sheet-misc-attack"&gt; &lt;label class="sheet-small-label2"&gt; &lt;select name="attr_wCraftsmanship"&gt; &lt;option selected data-i18n="select-default"&gt;• Select&lt;/option&gt; &lt;option data-i18n="craftsmanship-poor"&gt;Poor&lt;/option&gt; &lt;option data-i18n="craftsmanship-common"&gt;Common&lt;/option&gt; &lt;option data-i18n="craftsmanship-good"&gt;Good&lt;/option&gt; &lt;option data-i18n="craftsmanship-best"&gt;Best&lt;/option&gt; &lt;option data-i18n="craftsmanship-mastercrafted"&gt;Mastercrafted&lt;/option&gt; &lt;option data-i18n="craftsmanship-blank"&gt;&amp;bsp;&amp;nbsp;&lt;/option&gt; &lt;option data-i18n="craftsmanship-relic"&gt;Relic&lt;/option&gt; &lt;/select&gt;&lt;span data-i18n="craftsmanship"&gt;Craftsmanship&lt;/span&gt; &lt;/label&gt; &lt;label class="sheet-small-label2 sheet-use-size-only sheet-nondual-sect"&gt; &lt;input type="checkbox" name="attr_carried" style="width: 100%;" title="@{repeating_weapon_$X_carried}" value="1" CHECKED&gt; &lt;span data-i18n-title="carried" data-i18n="carried" title="Checked means the weapon is counted towards weight."&gt;Carried&lt;/span&gt; &lt;/label&gt; &lt;label class="sheet-small-label2"&gt; &lt;input type="number" name="attr_weight" class="sheet-weight" title="@{repeating_weapon_$X_weight}" value="0"&gt; &lt;span data-i18n="weight-abbrv"&gt;Weight (kg)&lt;/span&gt; &lt;/label&gt; &lt;label class="sheet-small-label2"&gt; &lt;select name="attr_wAvailability"&gt; &lt;option selected data-i18n="select-default"&gt;• Select&lt;/option&gt; &lt;option data-i18n="availability-abundant"&gt;Abundant&lt;/option&gt; &lt;option data-i18n="availability-plentiful"&gt;Plentiful&lt;/option&gt; &lt;option data-i18n="availability-common"&gt;Common&lt;/option&gt; &lt;option data-i18n="availability-average"&gt;Average&lt;/option&gt; &lt;option data-i18n="availability-scarce"&gt;Scarce&lt;/option&gt; &lt;option data-i18n="availability-rare"&gt;Rare&lt;/option&gt; &lt;option data-i18n="availability-veryrare"&gt;Very Rare&lt;/option&gt; &lt;option data-i18n="availability-unique"&gt;Unique&lt;/option&gt; &lt;/select&gt;&lt;span data-i18n="gAvailability"&gt;Availability&lt;/span&gt; &lt;/label&gt; &lt;/div&gt; &lt;div class="sheet-repeating-id"&gt; &lt;span data-i18n="identification-abbrv"&gt;ID&lt;/span&gt;: &lt;span class="sheet-selectable" name="attr_row_id" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- I think this is unpaired --&gt; &lt;div class="sheet-table"&gt; &lt;span class="sheet-table-cell sheet-left" style="width: 49%"&gt;&lt;/span&gt; &lt;span class="sheet-table-cell sheet-right" style="width: 11% ; min-width: 3.5em"&gt;&lt;b&gt;Total weight:&lt;/b&gt;&lt;input title="@{weap_total_weight}" type="number" name="attr_weap_total_weight" value="0" class="sheet-calc" readonly="readonly"&gt;&lt;b&gt;lbs.&lt;/b&gt;&lt;/span&gt; &lt;/div&gt; Obviously, much of the code is not relevant.&nbsp; But you get the idea.
1653106996
GiGs
Pro
Sheet Author
API Scripter
It looks like you are building the ScriptCard macro into the sheet itself. This isn't relevant to your question - are you planning to make this sheet publically available on the GitHub repo? If so, it's best to have API calls hidden behind a config setting, because most of the userbase don't have a Pro GM and cant benefit from that feature.
1653107370

Edited 1653107645
GiGs
Pro
Sheet Author
API Scripter
--/| I have tried [*R:name] [*R&gt;name] @{name} @{repeating_weapon_$X_name} @{repeating_weapon_0_name} --/| @{repeating_weapon_0_name} actually gives the correct value, but I'd have to hard code each row individually, which I dont think.. --/| is possible. It is possible to hard code the row id for each row automatically using getSectionIDs (if you need to - as Kraynic said earlier, you shouldn't need to). Use a hidden input, and when the row is created or when anything changes in the repeating section (a bit more intensive but probably more reliable), update the hidden input with the row id. Then in your scriptcard you can use this row id whenever you need to. To check Kraynic's method: which attributes are you trying to get the values of from the repeating section?
It looks like you are building the ScriptCard macro into the sheet itself. This isn't relevant to your question - are you planning to make this sheet publically available on the GitHub repo? If so, it's best to have API calls hidden behind a config setting, because most of the userbase don't have a Pro GM and cant benefit from that feature. This sheeet is exclusively for my use; although, if the person who maintains the Dark Heresy character sheet wants my code, I'd be happy to share.&nbsp; Also that is why I use macrotext areas, that way I can make edits and tweaks without needing to reupload the sheet every single time (saves a ton of time).&nbsp; It also means that I can swap the "value" of the roll button depending on any options I wish to add in a later config section.&nbsp; For example, there are some people who don't like using targeted attack macros, I could adjust it so it doesnt target the token (although, for dark heresy that wouldn't really work, because you need information from your target to determine the body part, soak and critical effect). GiGs said: --/| I have tried [*R:name] [*R&gt;name] @{name} @{repeating_weapon_$X_name} @{repeating_weapon_0_name} --/| @{repeating_weapon_0_name} actually gives the correct value, but I'd have to hard code each row individually, which I dont think.. --/| is possible. It is possible to hard code the row id for each row automatically using getSectionIDs (if you need to - as Kraynic said earlier, you shouldn't need to). Use a hidden input, and when the row is created or when anything changes in the repeating section (a bit more intensive but probably more reliable), update the hidden input with the row id. Then in your scriptcard you can use this row id whenever you need to. That is an awesome idea, how does one do this?&nbsp; I assume with sheet workers?&nbsp; I dont really know anything about how to use sheet workers. To check Kraynic's method: which attributes are you trying to get the values of from the repeating section? In the example shown, I am only&nbsp; trying to pull the name of the weapon, at least until I get a handle on how to pull any/all attributes.&nbsp; Once I learn how, I can use a larger number of attributes to do what I need.&nbsp; So in short @{repeating_weapon_$0_name} only for the moment.&nbsp; In the future, practically all of them will be used.
1653120648

Edited 1653120664
GiGs
Pro
Sheet Author
API Scripter
Toby said: This sheeet is exclusively for my use; That makes sense - I have a few sheets I haven't shared that have similar "for my own use" features. Regarding embedding the row id: yes, you need to use a sheet worker. It's late for me, I'll post an example tomorrow, though I think there's some sheets on the github repo that use the technique so if you're impatient you can search there :) As Kraynic suggested, @{name} should automatically get the proper value. But there are some reserved names that don't work properly - name might be one of them. Here's two things to test (temporary changes for testing purposes): Change the attribute name to anything other than name Change the wHitRoll textarea to just an attribute call, to see what is happening: &lt; textarea class = "sheet-macro-text" title = "@{repeating_weapon_$X_wHitRoll}" name = "attr_wHitRoll" &gt; @{name}&lt;/textarea&gt; Then when you click the button see what value is being called? Also, I wonder do you have another attribute named @{name} anywhere else in the sheet? If so, this might be causing an issue.
GiGs said: Toby said: This sheeet is exclusively for my use; That makes sense - I have a few sheets I haven't shared that have similar "for my own use" features. Regarding embedding the row id: yes, you need to use a sheet worker. It's late for me, I'll post an example tomorrow, though I think there's some sheets on the github repo that use the technique so if you're impatient you can search there :) As Kraynic suggested, @{name} should automatically get the proper value. But there are some reserved names that don't work properly - name might be one of them. Here's two things to test (temporary changes for testing purposes): Change the attribute name to anything other than name Change the wHitRoll textarea to just an attribute call, to see what is happening: &lt; textarea class = "sheet-macro-text" title = "@{repeating_weapon_$X_wHitRoll}" name = "attr_wHitRoll" &gt; @{name}&lt;/textarea&gt; Then when you click the button see what value is being called? Also, I wonder do you have another attribute named @{name} anywhere else in the sheet? If so, this might be causing an issue. Well, I kinda feel like an idiot.&nbsp; Changing the weapon name attribute from _name to _atkname seemed to work.&nbsp; How could I have missed this?&nbsp; Donno, but its annoying and embarrassing I will see if it fully solves my problem, but I need a bit of a break. Thank you, and I will keep you posted.
1653172887
GiGs
Pro
Sheet Author
API Scripter
Toby said: Changing the weapon name attribute from _name to _atkname seemed to work.&nbsp; How could I have missed this? Yay! I've never actually used "name" for an attribute name, purely because I worried it wouldn't work properly. I guess at some point I should have tested it. Thanks for being the unwitting guinea pig :)