Hello again, I have a reoccuring problem with my script cards that I simply cannot get around. I have my scriptcard code contained in a <textarea> on my character sheet (if that matters). And, although my code works when tested by copy/pasting it directly into the <textarea>. If I try and save it to the character sheet of the page and use it, the scriptcards code simply does not update the text area. Additionally, if I try and delete the code and reset everything it truncates the code.. It seems like the sheet is striping out what it feels are html entities. And no matter what I do (escape codes, named codes JS escape codes). It wont include the proper code. It is beyond frustrating because, I simply cannot copy/past the correct code into the text area one by one because it is in a repeating section for weapons.. and well most characters/npcs have more than one weapon and that would simply take foreeeever. The scriptcard code is as follows: !scriptcard {{ --/| === ScriptCard Layout for Combined Hit/Damage === |\-- --/| === Version 1.0 === |\-- --/| === Date: 08/09/2023 === |\-- --/| Local Variables --|\ --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --/| ===== Roll Queries / Information Lookup =========== |\ --&AimType|?{Aim | No aim (+0),+0 | Half aim (+10),+10| Full aim (+20),+20} --&RoFType|?{Rate of Fire/Attack Type| Standard (+0),+0 | Semi auto (+10),+10 | Full Auto (+20),+20 | Called Shot (-20),-20 | Suppressing Fire (-20),-20} --&AtkMod|?{Modifier|0} --/| ===== Convert RQ Value into int variables --=AtkModNum|[&AtkMod] --=AimTypeNum|[&AimType] --=RangeNum|[&RangeType] --=RoFNum|[&RoFType] --/| ===== Strings =========== |\ --&AtkName|@{atkName} --&WeapNotes|@{notes} --&DamageMod|@{damagemod} --&TotalDam|@{damage}!+@{damagemod} --/| ===== Numbers =========== |\ --=AtkType|0 --=DmgPen|@{penetration} --=clip|@{clip} --=clipMax|@{clip|max} --/| ====== Damage Calculations |\ --&DamMod|@{damageMod} --&RollBase|@{damage} --&Count|[&RollBase(before,d)] --&DieType|[&RollBase(after,d)] --&TearingRoll|[=[&Count]*2]d[&DieType]kh[&Count]!+[&DamMod] --=TearingDamage|[&TearingRoll] --&NormalRoll|[=[&Count]]d[&DieType]! --=NormalDamage|[&NormalRoll]+[&DamMod] --/| ====== Damage Output Debug Text & Console Log ======= |\ --/| +Count|[&Count] d [b] Die Type [/b][&DieType] --/| +TearingRoll|[&TearingRoll] --/| +Tearing Damage|[$TearingDamage] --/| +Normal Damage |[$NormalDamage] --/|[b]Console Log (Hit/Dam Combined): Count [&Count] d [b] Die Type [/b] [&DieType] --/|[b]Console Log (Hit/Dam Combined): [b]Tearing Roll[/b] [&TearingRoll] [b]Tearing Damage[/b] [&TearingDamage] --/|[b]Console Log (Hit/Dam Combined): [b]Normal Damage[/b] [&NormalDamage] --/| Toughness --=TBon|[*T:tou-mod] --/| Unnatural Toughness --=UnTBon|[*T:tou-unnatural-mod] --/| Unnatural Toughness Bonus minus regular toughness (for display and math) --=UnTOnly|[*T:tou-unnatural-only] --/| Daemonic Toughness --=DaeTBon|[*T:tou-daemonic] --=HAV|[*T:headArmourvalue] --=LAAV|[*T:LeftArmArmourvalue] --=BAV|[*T:BodyArmourvalue] --=RAAV|[*T:RightArmArmourvalue] --=LLAV|[*T:LeftLegArmourvalue] --=RLAV|[*T:RightLegArmourvalue] --=HSoak|[*T:armor-head-soak] --=LASoak|[*T:armor-leftarm-soak] --=BSoak|[*T:armor-body-soak] --=RASoak|[*T:armor-rightarm-soak] --=LLSoak|[*T:armor-leftleg-soak] --=RLSoak|[*T:armor-rightleg-soak] --=HCrit|[*T:headCritDam] --=LACrit|[*T:LeftArmCritDam] --=BCrit|[*T:BodyCritDam] --=RACrit|[*T:RightArmCritDam] --=LLCrit|[*T:LeftLegCritDam] --=RLCrit|[*T:RightLegCritDam] --=HCritM|[*T:headCritDam^] --=LACritM|[*T:LeftArmCritDam^] --=BCritM|[*T:BodyCritDam^] --=RACritM|[*T:RightArmCritDam^] --=LLCritM|[*T:LeftLegCritDam^] --=RLCritM|[*T:RightLegCritDam^] --/| ===== Weapon Proficiency Full Display =========== |\ --?@{wProficiency} -eq Yes|Yes --?@{wProficiency} -eq No|No --:Yes| --&wProficiency|Yes --^wProficiencyDisplayDone| --:No| --&wProficiency|No --^wProficiencyDisplayDone| --:wProficiencyDisplayDone| --/| ===== Weapon Damage TYPE Code =========== |\ --?@{wType} -eq E|E --?@{wType} -eq I|I --?@{wType} -eq R|R --?@{wType} -eq X|X --?@{wType} -eq N|N --:E| --&DmgTypeDisplay|Energy --^DMGTypeDone| --:I| --&DmgTypeDisplay|Impact --^DMGTypeDone| --:R| --&DmgTypeDisplay|Rending --^DMGTypeDone| --:X| --&DmgTypeDisplay|Explosive --^DMGTypeDone| --:N| --&DmgTypeDisplay|None --^DMGTypeDone| --:DMGTypeDone| --/| ===== Weapon CLASS Code =========== |\ --?@{wClass} -eqi basic|Basic --?@{wClass} -eqi heavy|Heavy --?@{wClass} -eqi melee|Melee --?@{wClass} -eqi pistol|Pistol --?@{wClass} -eqi thrown|Thrown --:Basic| --&wClassDisplay|Basic --&AtkType|[*S:bs-base] [BS] --^wClassDisplayDone| --:Heavy| --&wClassDisplay|Heavy --&AtkType|[*S:bs-base] [BS] --^wClassDisplayDone| --:Melee| --&wClassDisplay|Melee --&AtkType|[*S:ws-base] [WS] --&MeleePenalty|-30 --^wClassDisplayDone| --:Pistol| --&wClassDisplay|Pistol --&AtkType|[*S:bs-base] [BS] --^wClassDisplayDone| --:Thrown| --&wClassDisplay|Thrown --&AtkType|[*S:bs-base] [BS] --^wClassDisplayDone| --:wClassDisplayDone| --/| ===== Functions =========== |\ --~sqRange|distance;@{selected|token_id};@{target|token_id} --=Range|[$sqRange] [Squares] * 1 [meters] --?[$Range] -le 3|RngPB --?[$Range] -ge 3 -and [$Range] -le @{range-s}|RngShort --?[$Range] -ge @{range-s} -and [$Range] -le @{range-n}|RngNormal --?[$Range] -ge @{range-n} -and [$Range] -le @{range-m}|RngMed --?[$Range] -ge @{range-m} -and [$Range] -le @{range-l}|RngLong --?[$Range] -ge @{range-e}|RngExtreme --:RngPB| --&AtkRange|30+[&MeleePenalty] [Point Blank] --&RngDisplay|Point Blank --^RngDone|Done --:RngShort| --&AtkRange|10 [Short] --^RngDone|Done --&RngDisplay|Short --:RngNormal| --&AtkRange|0 [Normal] --&RngDisplay|Normal --^RngDone|Done --:RngMed| --&AtkRange|0 [Medium] --&RngDisplay|Medium --^RngDone|Done --:RngLong| --&AtkRange|-10 [Long] --&RngDisplay|Long --^RngDone|Done --:RngExtreme| --&AtkRange|-30 [Extreme] --&RngDisplay|Extreme --^RngDone|Done --:RngDone| --/| ============== DAMAGE CALCULATIONS ========== --/| === DAMAGE CALCULATIONS === --=DmgPen|@{penetration} --=LocPen|[$LocAV] - [$DmgPen] {MIN:0} --/| ======== Sheet Workers Title/Subtitle Code ======== |\ --#title|@{atkName} --#titlecardbackground|#993333 --#leftsub|[$Range] m. [&RngDisplay] --#rightsub|Ammo @{clip}/@{clip|max} --#emoteText|[*S:t-name] attacks [*T:t-name] --/| ===== Special Qualites that effect the attack roll ====== |\ --/| ===== Tearing QUALITY =========== |\ --?@{q-tearing} -eq 1|Tearing --?@{q-tearing} -eq 0|NoTearing --:Tearing| --&DmgTearing| --&FinalDamage|[$TearingDamage] --^TearingDone| --:NoTearing| --&DmgTearing|0 --&FinalDamage|[$NormalDamage] --^TearingDone| --:TearingDone| --=DmgTearing|[&DmgTearing] --/| ===== Inaccurate QUALITY =========== |\ --/| @@ DETAILS: This overides the AIMTYPE variable to ZERO (0) instead of adding a new component to the AtkTarget string. --?@{q-inaccurate} -eq 1|Inaccurate --?@{q-inaccurate} -eq 0|NoInaccurate --?@{q-defensive} -eq 1|Defensive --?@{q-defensive} -eq 0|NoDefensive --:Inaccurate| --&AimType|0 --^InaccurateDone| --:NoInaccurate| --^InaccurateDone| --:InaccurateDone| --?@{q-defensive} -eq 1|Defensive --?@{q-defensive} -eq 0|NoDefensive| --:Defensive| --&AtkDefensive|-10 [Defensive] --^DefensiveDone| --:NoDefensive| --&AtkDefensive|0 --^DefensiveDone| --:DefensiveDone| --=AtkTarget|[&AtkType] + [&AimType] [Aim] + [&AtkAccurate] [Accuracy] + [&AtkRange] + [&RoFType] [Rate of Fire] + [&AtkDefensive] + [&AtkMod] [Modifier] --=AtkRoll|1d100 --&BodyHit|Null --=DegSuccess|[$AtkTarget] - [$AtkRoll] \ 10 --&DegSuccessText|[$DegSuccess] --\|[b]Console Log (Hit/Dam Combined): Degrees of Success [b]Text[/b] [&DegSuccessText] [b]Number[/b] [$DegSuccess.Total] --/| +Deg of Success| Text [&DegSuccessText] Number [$DegSuccess.Total] --/| @@@ FINAL DAMAGE ROLL ===================================== |\ --=TotalSoak|[$TBon] + [$LocPen] --=FinalDamRoll|@{damage}!+@{damagemod} --/| === WEAPON DETAILS === --+|[c]● Weapon Details ●[/c] --+[t border=1 width=100%][tr][td][c]Class[/c][/td][td][c]Type[/c][/td][td][c]Damage[/c][/td][td][c]Pen[/c][/td][/tr][tr][td][c][&wClassDisplay][/c][/td][td][c][&DmgTypeDisplay][/c][/td][td][c]@{damage}[/c][/td][td][c][$DmgPen][/c][/td][/tr][/t]| --/| === 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][&AtkType][/td][td][&AimType][/td][td][&AtkRange][/td][td][&RoFType][/td][td][&AtkMod][/td][/tr][/t][/c]| --/| ======= Test Output for Debugging (Hide When Code is Complete) ======== --+|[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] --/| ====== Count the Number of Allowed Attacks --/| The Rate of fire is 1 + [Rate of Fire Modifier] + [Scatter Modifier] * [Storm Weapon Modifier] --/| Rate of Fire Mods -> --/| Automatic = 1 per 1 degrees of success --/| Semi-Automatic = 1 per 2 degrees of success --/| Point-Blank + Scatter = Base * 2 --/| Storm (Blood of Martyrs) = Base * 2 (Doubles the Number of Shots Fired) --/| The number of extra shots fired is cannot exceed the number of rounds in the gun (its overall rate of fire) or charge capacity for energy weapons. --/| Regardless of successful hits the amount of ammo expended is 1 per shot fired. --/| ====== Check And Assign Number of Attacks based on rate of fire. --/| Number of Attacks - Addititve --?[$RoFNum] -le 0|NoExtra --?[$RoFNum] -eq 10 -and [$DegSuccess.Total] -ge 0|SemiAuto --?[$RoFNum] -eq 20 -and [$DegSuccess.Total] -ge 0|FullAuto --:SemiAuto| --=MaxAtk|@{rof2} --=RoFMod|[$DegSuccess.Total] [Successes] / 2 {CEIL} {MAX:@{rof2}} [Semi Auto] --^RoFDone| --:FullAuto| --=MaxAtk|@{rof3} --=RoFMod|[$DegSuccess.Total] [Successes] / 1 {CEIL} {MAX:@{rof3}} [Full Auto] --^RoFDone| --/| Reserved for possible Future Use and Error Checking --:NoExtra| --=MaxAtk|@{rof1} --=RoFMod|0 [No Extra Attacks] --^RoFDone| --:RoFDone| --/| ====== Check if the number of sucesses is at least 0 (a non-negative number) --?[$DegSuccess.Total] -le -1|DegDone --?[$DegSuccess.Total] -ge 0|Continue --:Continue| --=NumAtkBase|1 --^DegDone| --/| ==== Reserved for possible Future Use and Error Checking --:DegError| --^DegDone| --:DegDone| --/| Number of Attacks - Multiplicative --=NumAtks|[$NumAtkBase.Total] [Base] + [$RoFMod.Total] [Rate of Fire] --/| ====== Check and assign number of attacks based on SCATTER and RANGE. --/| @@ DETAILS: It is set to "30" because the output of the Roll Query is +30, as in thats how much the bonus to hit is. --/| @@ DETAILS: The equation basically is checking if the range is Point Blank and is Scatter selected. --?[$RangeNum] -ge 30 -and @{q-scatter} -eq 1|Scatter --?[$RangeNum] -lt 30 -or @{q-scatter} -eq 0|NoScatter --:Scatter| --=NumAtkScatter|[$NumAtks] * 2 --^ScatterDone| --:NoScatter| --=NumAtkScatter|0 --^ScatterDone| --:ScatterDone| --/| ====== Check and assign number of attacks based on STORM --?@{q-storm} -eq 1|Storm --?@{q-storm} -eq 0|NoStorm --:Storm| --=MaxAtk|[$MaxAtk]*2 --=NumAtkStorm|[$NumAtks] * 2 --^StormDone| --:NoStorm| --=NumAtkStorm|0 --^StormDone| --:StormDone| --+[c] ● Number of HITS ●[/c]| --=NumAtksTotal|[$RoFMod] [RoF] + [$NumAtkBase.Total] [Base] + [$NumAtkScatter] [Scatter] + [$NumAtkStorm] [Storm] {MAX:[$MaxAtk]} --/| +Num|[$RoFMod] [RoF] + [$NumAtkBase.Total] [Base] + [$NumAtkScatter] [Scatter] + [$NumAtkStorm] [Storm] = --+|[c][b][$NumAtksTotal.Total][/b][/c] --/| ===== ACCURATE QUALITY =========== |\ --=AccuracyNumDice|[$DegSuccess] / 2 {MAX:2} --=AccuracyNumDice|[$AccuracyNumDice] {ROUND} --?[$AimTypeNum] -gt 0 -and @{q-accurate} -eq 1|Accurate --?[$AimTypeNum] -eq 0 -or @{q-accurate} -eq 0|NoAccurate --:Accurate| --=DmgAccurate|[$AccuracyNumDice]d10! --^AccurateDone| --/| Fail Catch not working..... --:NoAccurate| --=DmgAccurate|0 --^AccurateDone| --:AccurateDone| --&AccuracyDmgFinal|[$DmgAccurate] --/| ====== 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! ([$DegSuccess.Total])[/#][/c]| --^Done| --:Failure| --+[c][#B31515]MISS! ([$DegSuccess.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] --<| --?[$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" --:PROCEDURES| --:SetHitLocation| accepts hit location as parameter --?"[&BodyHit]" -eqi "Head"|H --?"[&BodyHit]" -eqi "Left Arm"|LA --?"[&BodyHit]" -eqi "Body"|B --?"[&BodyHit]" -eqi "Right Arm"|RA --?"[&BodyHit]" -eqi "Left Leg"|LL --?"[&BodyHit]" -eqi "Right Leg"|RL --:H| --&LocDisplay|Head --=LocAV|[$HAV] --=LocSoak|[$HSoak] --^LocationDone| --:LA| --&LocDisplay|Left Arm --=LocAV|[$LAAV] --=LocSoak|[$LASoak] --^LocationDone| --:RA| --&LocDisplay|Right Arm --=LocAV|[$RAAV] --=LocSoak|[$RASoak] --^LocationDone| --:B| --&LocDisplay|Body --=LocAV|[$BAV] --=LocSoak|[$BSoak] --^LocationDone| --:LL| --&LocDisplay|Left Leg --=LocAV|[$LLAV] --=LocSoak|[$LLSoak] --^LocationDone| --:RL| --&LocDisplay|Right Leg --=LocAV|[$RLAV] --=LocSoak|[$RLSoak] --^LocationDone| --:LocationDone| --&BodyHit|[%1%] --<| --+[c] ● [&LocDisplay] ●[/c]| --+[t border=1 width=100%] [tr] [td][c]Toughness[/c][/td] [td][c]Armor[/c][/td] [td][c]<span class="tooltip" title="Penetration subtracts from armor only.">Pen</span>[/c][/td] [td][c]Soak[/c][/td] [/tr] [tr] [td][c][$TBon]+[$UnTOnly]+[$DaeTBon][/c][/td] [td][c] [$LocAV] [/c][/td] [td][c][$DmgPen][/c][/td] [td][c][$TotalSoak][/c][/td] [/tr] [/t]| --+[c] ● DMG Details ●[/c]| --+[t border=1 width=100%] [tr] [td][c]Base[/c][/td] [td][c]Accuracy[/c][/td] [td][c]Extra[/c][/td] [td][c]xx[/c][/td] [/tr] [tr] [td][c][&FinalDamage][/c][/td] [td][c][&AccuracyDmgFinal] [/c][/td] [td][c][&FinalExtraDam][/c][/td] [td][c]xx[/c][/td] [/tr] [/t]| --:PAGE DETAILS| --#activepage|[*C:playerpageid] --=pageGridSize|[*P:snapping_increment] --=pageScaleNumber|[*P:scale_number] --:DISTANCE CALCULATIONS| --~distToCenter|distance;[*S:t-id];[*T:t-id] --=sourceW|[*S:t-width] / 70 / [$pageGridSize] --=targetW|[*T:t-width] / 70 / [$pageGridSize] -->GetDistModS|[$sourceW] -->GetDistModT|[$targetW] --=closestDist|[$distToCenter] - [$distModS] - [$distModT] --X| end macro --:PROCEDURES| --:GetDistModS| source token size, (calculates squares from center to edge) --=a|[%1%] \ 2 --=b|[%1%] % 2 --?[$b] -eq 0|=b;-1|=b;0 --=distModS|[$a] + [$b] --<| --:GetDistModT| target token size, (calculates squares from center to edge) --=a|[%1%] \ 2 --=b|[%1%] % 2 --?[$b] -eq 0|=b;-1|=b;0 --=distModT|[$a] + [$b] &#45;&#45;&#60&#124; }} Please, I really need help with this as it completely breaks my character sheet and prevents me from updating, fixing or making any kind of changes.