Maybe I'm misunderstanding something -- and i apologize if I am -- but I thought that if I updated a character attribute with the setWithWorker() function, I could implement the onSheetWorkerCompleted() function to make sure something ran after the attribute was set. However, that function only seems to run when I spin up my sandbox, not when I use the setWithWorker() function to set my character's attribute. Imagine that when you set Attr1 on the character sheet, Attr2 & Attr3 are updated by the character sheet. I want to set Attr1, then collect the results from 2 & 3. That doesn't seem to be working. Here is the relevant code: var scriptName = scriptName || (function () { 'use strict',
...
onSheetWorkerCompleted(function () { log('AFTER THE SHEET WORKER'); /* do all the things*/ }),
processInput = function(msg) { ... targetLocation = "..."; // validated user input var attr = findObjs({ _type: 'attribute', _characterid: heroll.theSpeaker.id, name: "radio_target" })[0]; attr.setWithWorker({ current: Object.keys(radioTargetTable).find(key => radioTargetTable[key] === targetLocation) }); ... },
...
}()); I searched the forum and found this thread that talked about using semaphore to solve a similar issue, but I wanted to understand the problem before I went to that length. This has to be a common requirement for scripts, right?