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