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

sheet worker not working

can anybody explain to me why this very simple sheet worker isn't running? i've looked over all the code and don't see any reason why it wouldn't. it won't trigger when i change any of those attributes <script type="text/worker"> //Set ring and header for skill approaches on("change:artisanskillapproach change:martialskillapproach change:scholarskillapproach change:socialskillapproach change:tradeskillapproach change:voidring change:earthring change:firering change:waterring change:airring", function(changeevent) {     console.log("===SHEET WORKER=== change detected. Source Attribute:" changeevent.sourceAttribute); }); </script>
1563752859
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
What is the html that is associated with this sheet? Do you have other script tags in the code? and finally, do you get any errors in the developer inspector?
There are no other script tags and no errors when opening or doing anything on a sheet. rest of the code below: <div class="whole-sheet"> <!--Is the Sheet for the Player or GM?--> <input type="radio" name="attr_gmplayersheet" class="sheet-switch sheet-switch-player-sheet" value="1" checked="checked"> <span class="sheet-switch-label">PLAYER</span> <input type="radio" name="attr_gmplayersheet" class="sheet-switch sheet-switch-npc-sheet" value="2"> <span class="sheet-switch-label">NPC</span> <input type="radio" name="attr_gmplayersheet" class="sheet-switch sheet-switch-gm-sheet" value="3"> <span class="sheet-switch-label">GM</span> <input type="radio" name="attr_gmplayersheet" class="sheet-switch sheet-switch-court-sheet" value="4"> <span class="sheet-switch-label">COURT</span> <div class="sheet-tab-player-sheet sheet-tab"> <h3 class="sheet-section-header">Basic Information</h3> <div class="sheet-subheader-content"> <table class="sheet-character-table"> <tr> <td colspan="3"><input type="text" name="attr_CharacterName"></td> <td colspan="2"><input type="text" name="attr_PlayerName"></td> </tr> <tr> <td colspan="3"><span class="sheet-info-label">Character Name</span></td> <td colspan="2"><span class="sheet-info-label">Player Name</span></td> </tr> <tr> <td colspan="1"><input type="text" name="attr_Clan"></td> <td colspan="1"><input type="text" name="attr_Family"></td> <td colspan="2" width="320px"><input type="text" name="attr_School"></td> <td colspan="1"><input type="number" step="1" max="6" min="1" value="1" name="attr_SchoolRank"></td> </tr> <tr> <td colspan="1"><span class="sheet-info-label">Clan</span></td> <td colspan="1"><span class="sheet-info-label">Family</span></td> <td colspan="2"><span class="sheet-info-label">School</span></td> <td colspan="1"><span class="sheet-info-label">School Rank</span></td> </tr> <tr> <td colspan="5"><input type="text" name="attr_CharacterTitles"></td> </tr> <tr> <td colspan="5"><span class="sheet-info-label">Titles</span></td> </tr> </table> </div> <!--Character Basic Information --> <h3 class="sheet-section-header">Basic Statistics</h3> <div class="sheet-subheader-content"> <table> <tr> <td colspan="6" rowspan="7" class="sheet-rings"><input type="number" step="1" min="0" value="0" name="attr_EarthRing"><input type="number" step="1" min="0" value="0" name="attr_AirRing"><br \><input type="number" step="1" min="0" value="0" name="attr_WaterRing"><input type="number" step="1" min="0" value="0" name="attr_FireRing"><br \><input type="number" step="1" min="0" value="0" name="attr_VoidRing"></td> <td class="sheet-circle-input" colspan="1"><input type="number" step="1" min="0" value="0" name="attr_CharacterHonor"></td> <td class="sheet-circle-input" colspan="1"><input type="number" step="1" min="0" value="0" name="attr_CharacterGlory"></td> <td class="sheet-circle-input" colspan="1"><input type="number" step="1" min="0" value="0" name="attr_CharacterStatus"></td> </tr> <tr> <td class="sheet-circle-label" colspan="1"><span>Honor</span></td> <td class="sheet-circle-label" colspan="1"><span> Glory</span></td> <td class="sheet-circle-label" colspan="1"><span>Status</span></td> </tr> <tr> <td><span class="sheet-combat-stats-label">ENDURANCE</span><br \><span class="sheet-combat-stats-sublabel">(Earth + Fire) x 2</span></td> <td><input class="sheet-combat-stats" type="number" step="1" min="0" value="0" name="attr_CharacterFatigue"><span class="sheet-combat-stats-label">    /</span><br \><span class="sheet-combat-stats-sublabel">   Fatigue</span></td> <td><input class="sheet-combat-stats" type="number" step="1" min="0" value="0" name="attr_CharacterFatigue_max"><br \> </td> </tr> <tr> <td><span class="sheet-combat-stats-label">COMPOSURE</span><br \><span class="sheet-combat-stats-sublabel">(Earth + Water) x 2</span></td> <td><input class="sheet-combat-stats" type="number" step="1" min="0" value="0" name="attr_CharacterCompsure"><span class="sheet-combat-stats-label">    /</span><br \><span class="sheet-combat-stats-sublabel">   Strife</span></td> <td><input class="sheet-combat-stats" type="number" step="1" min="0" value="0" name="attr_CharacterCompsure_max"><br \> </td> </tr> <tr> <td><span class="sheet-combat-stats-label">VOID</span></td> <td><input class="sheet-combat-stats" type="number" step="1" min="0" value="0" name="attr_CharacterVoidPoints"><span class="sheet-combat-stats-label">    / </span></td> <td><input class="sheet-combat-stats" type="number" step="1" min="0" value="0" name="attr_CharacterVoidPoints_max"></td> </tr> <tr> <td><span class="sheet-combat-stats-label">FOCUS</span><br \><span class="sheet-combat-stats-sublabel">(Air + Fire)</span></td> <td colspan="2"><input class="sheet-combat-stats" type="number" step="1" min="0" value="0" name="attr_CharacterFocus"></td> </tr> <tr> <td><span class="sheet-combat-stats-label">VIGILANCE</span><br \><span class="sheet-combat-stats-sublabel">(Air + Water) / 2</span></td> <td colspan="2"><input class="sheet-combat-stats" type="number" step="1" min="0" value="0" name="attr_CharacterVigilance"></td> </tr> <tr> </tr> </table> </div><!--Character Basic Information --> <div class="sheet-player-sheet-tabs"> <input type="radio" name="attr_charsheettab" class="sheet-switch sheet-tab-switch-narrative" value="1" checked="checked"> <span class="sheet-switch-label">NARRATIVE</span> <input type="radio" name="attr_charsheettab" class="sheet-switch sheet-tab-switch-combat" value="2"> <span class="sheet-switch-label">COMBAT</span> <input type="radio" name="attr_charsheettab" class="sheet-switch sheet-tab-switch-experience" value="3"> <span class="sheet-switch-label">EXPERIENCE</span> <input type="radio" name="attr_charsheettab" class="sheet-switch sheet-tab-switch-notes" value="4"> <span class="sheet-switch-label">NOTES</span> <div class="sheet-tab-character-narrative sheet-tab"> NARRATIVE <div class="sheet-ninjo">Ninjo<textarea class="sheet-ninjogiri" name="attr_ninjo"></textarea></div> <div class="sheet-giri">giri<textarea class="sheet-ninjogiri" name="attr_giri"></textarea></div> <div class="sheet-skills-list"> <table> <tr><th>Artisan Skills</th><th>Ranks</th><th> Modifiers (?) </th><th> <select name="attr_artisanskillapproach"> <option value="None">-Select Approach</option> <option value="Refine">Refine</option> <option value="Restore">Restore</option> <option value="Invent">Invent</option> <option value="Adapt">Adapt</option> <option value="Attune">Attune</option> </select> </th></tr> <tr> <td>Aesthetics</td> <td><input type="number" class="sheet-skill-rank" name="attr_rankAesthetics"></intput></td> <td><input type="text" name="attr_modAesthetics"></td> <td><button type="roll" value="!l5r @{rankAesthetics}s @{modAesthetics} @{skillRingValue}r {{header=Aesthetics}} {{subheader=@{character_name}}} {{approach=@{artisanSkillapproach}}} {{headerring=@{skillRing}}}" name="act_skillRoll"></button> </td> </tr> </table> <table> <tr><th>Martial Skills</th><th>Ranks</th><th> Modifiers (?) </th><th> <select name="attr_martialSkillApproach"> <option value="None">-Select Approach</option> <option value="Feint">Feint</option> <option value="Withstand">Withstand</option> <option value="Overwhelm">Overwhelm</option> <option value="Shift">Shift</option> <option value="Sacrifice">Sacrifice</option> </select> </th></tr> </table> <table> <tr><th>Scholar Skills</th><th>Ranks</th><th> Modifiers (?) </th><th> <select name="attr_scholarSkillApproach"> <option value="None">-Select Approach</option> <option value="Analyze">Analyze</option> <option value="Recall">Recall</option> <option value="Theorize">Theorize</option> <option value="Survey">Survey</option> <option value="Sense">Sense</option> </select> </th></tr> </table> <table> <tr><th>Social Skills</th><th>Ranks</th><th> Modifiers (?) </th><th> <select name="attr_socialSkillApproach"> <option value="None">-Select Approach</option> <option value="Trick">Trick</option> <option value="Reason">Reason</option> <option value="Incite">Incite</option> <option value="Charm">Charm</option> <option value="Enlighten">Enlighten</option> </select> </th></tr> </table> <table> <tr><th>Trade Skills</th><th>Ranks</th><th> Modifiers (?) </th><th> <select name="attr_tradeSkillApproach"> <option value="None">-Select Approach</option> <option value="Con">Con</option> <option value="Produce">Produce</option> <option value="Innovate">Innovate</option> <option value="Exchange">Exchange</option> <option value="Subsist">Subsist</option> </select> </th></tr> </table> </div> </div><!--end narrative tab--> <div class="sheet-tab-character-combat sheet-tab"> COMBAT </div><!--end combat tab--> <div class="sheet-tab-character-experience sheet-tab"> EXP </div><!--end experience tab--> <div class="sheet-tab-character-notes sheet-tab"> NOTES </div><!--end notes sheet--> </div><!--End character sheet subtabs --> </div><!--End character sheet--> <div class="sheet-tab-npc-sheet sheet-tab"> NPC </div><!--End npc sheet--> <div class="sheet-tab-gm-sheet sheet-tab"> GM </div><!--End gm sheet--> <div class="sheet-tab-court-sheet sheet-tab"> COURT </div><!--End court sheet--> </div> <!--End whole sheet--> <rolltemplate class="sheet-rolltemplate-l5r5e"> <div class="sheet-template-container"> {{#headerring}}<div class="sheet-{{headerring}}-header"><span class="sheet-rolltemplate-header">{{header}}</span><span class="sheet-inverted">{{technique}}</span><br \><span class="sheet-rolltemplate-subheader">{{subheader}}</span></div>{{/headerring}} {{^headerring}}<div class="sheet-noring-header"><span class="sheet-rolltemplate-header">{{header}}</span><span class="sheet-notinverted">{{technique}}</span><br \><span class="sheet-rolltemplate-subheader">{{subheader}}</span></div>{{/headerring}} {{#flavor}}<div class="sheet-rolltemplate-row"><div class="sheet-rolltemplate-flavor">{{flavor}}</div></div>{{/flavor}} {{#category}}<div class="sheet-rolltemplate-row"><div class="sheet-rolltemplate-left">Weapon Category:</div><div>{{category}}</div></div>{{/category}} {{#range}}<div class="sheet-rolltemplate-row"><div class="sheet-rolltemplate-left">Range:</div><div>{{range}}</div></div>{{/range}} {{#damage}}<div class="sheet-rolltemplate-row"><div class="sheet-rolltemplate-left">Damage: </div><div>{{damage}}</div></div>{{/damage}} {{#deadliness}}<div class="sheet-rolltemplate-row"><div class="sheet-rolltemplate-left">Deadliness: </div><div>{{deadliness}}</div></div>{{/deadliness}} {{#cost}}<div class="sheet-rolltemplate-row"><div class="sheet-rolltemplate-left">Cost: </div><div>{{cost}}</div></div>{{/cost}} {{#rarity}}<div class="sheet-rolltemplate-row"><div class="sheet-rolltemplate-left">Rarity: </div><div>{{rarity}}</div></div>{{/rarity}} {{#grips}}<div class="sheet-rolltemplate-miniheader"><div>Grips:</div></div> <div class="sheet-rolltemplate-row"><div >{{grips}}</div></div>{{/grips}} {{#qualities}}<div class="sheet-rolltemplate-miniheader"><div>Qualities:</div></div> <div class="sheet-rolltemplate-row"><div >{{qualities}}</div></div>{{/qualities}} {{#initbonus}}<div class="sheet-rolltemplate-row"><div class="sheet-rolltemplate-left">Initiative Bonus: </div><div>{{initbonus}}</div></div>{{/initbonus}} {{#inittotal}}<div class="sheet-rolltemplate-row"><div class="sheet-rolltemplate-left">Initiative Total: </div><div>{{inittotal}}</div></div>{{/inittotal}} {{#activation}}<div class="sheet-rolltemplate-miniheader"><div>Activation:</div></div> <div class="sheet-rolltemplate-row"><div >{{activation}}</div></div>{{/activation}} {{#effects}}<div class="sheet-rolltemplate-miniheader"><div>Effects:</div></div> <div class="sheet-rolltemplate-row"><div >{{effects}}</div></div>{{/effects}} {{#enhancements}}<div class="sheet-rolltemplate-miniheader"><div>Enhancement Effects:</div></div> <div class="sheet-rolltemplate-row"><div >{{enhancements}}</div></div>{{/enhancements}} {{#burst}}<div class="sheet-rolltemplate-miniheader"><div>Burst Effects:</div></div> <div class="sheet-rolltemplate-row"><div >{{burst}}</div></div>{{/burst}} {{#opportunities1}}<div class="sheet-rolltemplate-opportunity"><div>New Opportunities</div></div> <div class="sheet-rolltemplate-row"><div >{{ocost1}}: {{opportunities1}}</div></div>{{/opportunities1}} {{#opportunities2}}<div><div >{{ocost2}}: {{opportunities2}}</div></div>{{/opportunities2}} {{#opportunities3}}<div><div >{{ocost3}}: {{opportunities3}}</div></div>{{/opportunities3}} {{#opportunities4}}<div><div >{{ocost4}}: {{opportunities4}}</div></div>{{/opportunities4}} {{#opportunities5}}<div><div >{{ocost5}}: {{opportunities5}}</div></div>{{/opportunities5}} {{#modifiers}}<div class="sheet-rolltemplate-miniheader"><div>Modifiers:</div></div> <div><div >{{modifiers}}</div></div>{{/modifiers}} {{#allprops() headerring header subheader technique flavor category range damage deadliness cost rarity grips qualities initbonus inittotal activation effects enhancements burst modifiers ring skill opportunities1 opportunities2 opportunities3 opportunities4 opportunities5 headering ocost1 ocost2 ocost3 ocost4 ocost5}}<div class="sheet-rolltemplate-row"><div class="sheet-rolltemplate-left">{{key}}: </div><div>{{value}}</div></div>{{/allprops() headerring header subheader technique flavor category range damage deadliness cost rarity grips qualities initbonus inittotal activation effects enhancements burst modifiers ring skill opportunities1 opportunities2 opportunities3 opportunities4 opportunities5 headering ocost1 ocost2 ocost3 ocost4 ocost5}} {{#ring}}<div class="sheet-rolltemplate-row"><div class="sheet-rolltemplate-left">Ring: </div><div>{{ring}}</div></div>{{/ring}} {{#skill}}<div class="sheet-rolltemplate-row"><div class="sheet-rolltemplate-left">Skill: </div><div>{{skill}}</div></div>{{/skill}} </div> </rolltemplate>
1563757065
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ah, if you have multiple <script> tags, that's most likely the problem. All sheetworkers should be in a single <script> tag. Also, as a best practice, I'd recommend changing your attribute naming scheme if you aren't too deep into the sheet design yet; using underscores to space out words makes attribute names more readable by us lowly humans than having concatenated names.
hmm, i don't see any other stray script tags anywhere.... i originally had more inside the script and it was working, then i changed the on() event a little bit and it stopped working..i took everything else out just to try to get the event to trigger and it won't, but I don't see anything wrong with the arguments
1563757976

Edited 1563758709
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
oh, sorry, I misread your previous post. For some reason I read that you had multiple script tags. I'd recommend checking your developer console for a syntaxerror or referenceerror that is preventing the sheetworkers form booting up. EDIT: Yep, you've got a syntaxerror being triggered by your sheetworker code. The closure compiler makes it easy to find exactly where these are coming from. From feeding it through that, here's where your error is: <script type="text/worker"> //Set ring and header for skill approaches on("change:artisanskillapproach change:martialskillapproach change:scholarskillapproach change:socialskillapproach change:tradeskillapproach change:voidring change:earthring change:firering change:waterring change:airring", function(changeevent) {     //Prevous version     console.log("===SHEET WORKER=== change detected. Source Attribute:" changeevent.sourceAttribute);     //Corrected Version     console.log(`===SHEET WORKER=== change detected. Source Attribute:${changeevent.sourceAttribute}`); }); </script> The problem was that you needed to concatenate strings together, you can't just put them one after the other. In my corrected version I switched to using a template literal syntax which makes for a more readable concatenation.
1563771139
Finderski
Pro
Sheet Author
Compendium Curator
The other way to concatenate that would be: console.log("===SHEET WORKER=== change detected. Source Attribute:" + changeevent.sourceAttribute);
Awesome, that was the issue. I'm not sure why I missed the + there, lol. that closure compiler looks super helpful, i need to start using that :p