I should start by saying that I'm still very much a novice when it comes to all of this, and thank you once again to all of the experts here. I genuinely don't know what I would do with out you. That aside, I'm attempting to use custom roll parsing for a roll within the modified Fallout VnD PnP sheet I'm working on, specifically to handle queries pertaining to whether an attack is Targeted or Not Targeted, and providing relevant values depending on the selection, as this was a lot for a standard macro to handle, at least as far as I could tell. The "Non Targeted" works without issue. However, when selecting "Yes" for the targeted, and selecting the targeted area, as in "head," I'm left with a syntax error in the console that I can't quite figure out. The Sheet Worker and an image of the syntax error are below. <script type="text/worker"> const targetAreaData = { head: { penalty: "60", effect: "LR -3; 15 True; Dazed for one turn" }, torso: { penalty: "20", effect: "LR -2; 5 True; Knocked Down" }, arm: { penalty: "40", effect: "LR -1; 10 True" }, leg: { penalty: "40", effect: "LR -1; 10 True" }, groin: { penalty: "60", effect: "LR -4; 20 True; 10 Bleed" } }; on('clicked:roll', () => { startRoll("!{{template:default}}{{targeted=![[?{Is the attack targeted?|No,0|Yes,1}]]}}", question => { console.log("Targeted query response:", question); const isTargeted = question.results.targeted.result; if (isTargeted) { startRoll(`!{{template:default}}{{targetArea=![[?{Attack Type|head|torso|arm|leg|groin}]]}}`, targetAreaResponse => { console.log("Target area response:", targetAreaResponse); const targetArea = targetAreaResponse.results.targetArea.result; const { penalty, effect } = targetAreaData[targetArea]; const rollStringTargeted = `&{template:weapon} {{char-name=@{character_name}}} {{name=@{weapon_name-1}}} {{selected-skill=@{selected_skill_name}}} {{wpn-skill=[[@{weapon_select-1}]]}} {{roll=[[${penalty}]] [Trgt Penalty] + [[?{Trgt Mod|0}]][Trgt Mod]) - ([[?{Hit Chance|0}]][Hit Chance]) + ([[?{Armor Class|0}]][AC] + [[@{ac_reduction-1}]][AC Reduc.]) + 1d100cs<[[{[[@{critical_chance} + (?{Crit Bonus|0})]],50}kl1]]cf>[[{[[90+@{luck_base}]],100}kl1]]}} {{Dmg=[[@{weapon_damage-1}cs0cf0]]}} {{DT=@{dt_reduction-1}}} {{Dmg Type=@{weapon_damage_type-1}}} {{notes=@{weapon_notes-1}}} {{Location Effect=${effect}}}`; console.log("Roll string targeted:", rollStringTargeted); startRoll(rollStringTargeted, roll => { finishRoll(roll.rollId); }); }); } else { const rollStringNonTargeted = `&{template:weapon} {{char-name=@{character_name}}} {{name=@{weapon_name-1}}} {{selected-skill=@{selected_skill_name}}} {{wpn-skill=[[@{weapon_select-1}]]}} {{roll=[[0 - ([[?{Hit Chance|0}]][Hit Chance]) + ([[?{Armor Class|0}]][AC] + [[@{ac_reduction-1}]][AC Reduc.]) + 1d100cs<[[{[[@{critical_chance} + (?{Crit Bonus|0})]],50}kl1]]cf>[[{[[90+@{luck_base}]],100}kl1]]]]}} {{Dmg=[[@{weapon_damage-1}cs0cf0]]}} {{DT=@{dt_reduction-1}}} {{Dmg Type=@{weapon_damage_type-1}}} {{notes=@{weapon_notes-1}}}`; console.log("Roll string non-targeted:", rollStringNonTargeted); startRoll(rollStringNonTargeted, roll => { finishRoll(roll.rollId); }); } }); }); </script> I've tried using console logs for debugging, as you can see, but
everything cuts off as soon as I've selected a targeted area and
continued. In this particular test I selected "groin," which is
presumably the syntax error 'g' mentioned. Again, I'm completely at a
loss for where it's falling short, but I figured more experience eyes
might be able to tell where I messed up. Thank you once again for any help provided!