
Is it happy dance time? Riley rolled out that change you needed.
Gary W. said:
When you say reliable are you speaking of time to do or it just never gets done? I have noticed the API seem very, very slow to load today in general.
eventInfo.sourceType === 'api' || eventInfo.sourceType === 'player'I changed everything to the above.
Vince said:
So, it looks like the api script must include the code needed to send source "player" to the sheet in order for sheet workers to recognize the change?
on("change:recalc1 change:migrate1", TAS.callback(function eventRecaluateSheet(eventInfo) { TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType); if (eventInfo.sourceType === "player" || eventInfo.sourceType === "api") { checkForUpdate(); } }));but even changing recalc1 "!setattr --sel --recalc1|1" doesn't fire an event.
Vince said:
Thanks Jakob. I can't seem to get any event detection from sheet workers using the script. ;-(
I can see the changes that Chris has made,
exampleon("change:recalc1 change:migrate1", TAS.callback(function eventRecaluateSheet(eventInfo) { TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType); if (eventInfo.sourceType === "player" || eventInfo.sourceType === "api") { checkForUpdate(); } }));but even changing recalc1 "!setattr --sel --recalc1|1" doesn't fire an event.
Thanks!Sudain said:
When you guys get this all sorted out I hope you can provide a nice example to reference. I'm hoping to map token bars to things like 'Channel Energy' or 'Arcane Pool' points.
Thank you again for all your hard work!
Sudain said:
Ah, maybe I'm doing it wrong. :)
The intent is to have the players tokens mapped to their character sheets (or represent those sheets). Then have HP connected to the green bar(arbitrary), and then other class specific features they need to keep track of mapped to the other two bars. Mostly to help me the GM realize that "hey, they are low on resources." or "That barbarian is out of rages for the day, but he said he just raged... interesting..." That's the end goal, and maybe I'm getting my mods mixed up as you said. :D
This is what I use to setup tokens for PCs:Sudain said:
Ah, maybe I'm doing it wrong. :)
The intent is to have the players tokens mapped to their character sheets (or represent those sheets). Then have HP connected to the green bar(arbitrary), and then other class specific features they need to keep track of mapped to the other two bars. Mostly to help me the GM realize that "hey, they are low on resources." or "That barbarian is out of rages for the day, but he said he just raged... interesting..." That's the end goal, and maybe I'm getting my mods mixed up as you said. :D
Edit: I am mixing up tokenmod and this one. I do use this one extensively when creating monsters with roll queries. This has saved me a great deal of time creating the monsters, though the sheet updates have reset several key variables (like ac) on monsters over time. But that's an issue for a different thread. :D
!token-mod {{ --on showname light_hassight showplayers_name showplayers_bar1 showplayers_bar2 showplayers_bar3 showplayers_aura1 showplayers_aura2 --off isdrawing --set represents|"?{Character Name}" bar1_link|AC bar2_link|Speed bar3_link|HP light_radius|5 light_dimradius|=-5 }}Does that cover your use case?
Very handy! It may be a weird side effect of my sheet (customized from Diana's D&D 3.5 one), but does barx_link not work for autocalc fields? My armorclass field does not show on the bar after running this. I have changed the above to match the Attribute names in my sheet, and armorclass displays in the sheet. I can manually link the bar to armorclass just fine. My speed and hitpoints fields are just straight text inputs and TokenMod adds them with no problem.The Aaron said:
This is what I use to setup tokens for PCs:!token-mod {{ --on showname light_hassight showplayers_name showplayers_bar1 showplayers_bar2 showplayers_bar3 showplayers_aura1 showplayers_aura2 --off isdrawing --set represents|"?{Character Name}" bar1_link|AC bar2_link|Speed bar3_link|HP light_radius|5 light_dimradius|=-5 }}
Any change? Does it work now?Vince said:
Thanks Jakob. I can't seem to get any event detection from sheet workers using the script. ;-(
[...]
but even changing recalc1 "!setattr --sel --recalc1|1" doesn't fire an event.
Vince said:
Still the same. I can see the recalc button change state, but the console log never shows the recalc event detection so sheet workers appear to have no clue anything has changed.
Not sure what's wrong. I believe Chris has made the proper changes and I can see some info in the API log about the PF sheet. There are no errors and the ChatSetattr seems ti be functioning fine other than the sheet not recognizing the event. I'm using 1.2 from github.Jakob said:
Vince said:
Still the same. I can see the recalc button change state, but the console log never shows the recalc event detection so sheet workers appear to have no clue anything has changed.
That's a shame, it works just fine for me with the Shaped sheet.
"ReferenceError: performance is not defined"Thoughts? Is this completely a sheet issue? Thanks
"ReferenceError: performance is not defined\n at Array.TAS_CALLSTACK_1 (eval at <anonymous> (eval at <anonymous> (evalmachine.<anonymous>:282:6)), <anonymous>:3:99)\n at self.trigger (evalmachine.<anonymous>:77:37)\n at messageHandler (evalmachine.<anonymous>:285:11)\n at process.<anonymous> (/home/node/d20-api-server/node_modules/tiny-worker/lib/worker.js:68:55)\n at emitTwo (events.js:100:13)\n at process.emit (events.js:185:7)\n at handleMessage (internal/child_process.js:695:10)\n at Pipe.channel.onread (internal/child_process.js:440:11)"
var performance = performance || {now:_.now};or switch to vanilla TAS.
callstack = getCallstack(); callstack.shift(); return (function (cb, ctx, cs, lbl) { var ctxref = registerCallstack(cs, lbl); /*jshint -W054 */ var performance = performance || {now:_.now}; return new Function('cb', 'ctx', 'TASlog', "return function TAS_CALLSTACK_" + ctxref + "(){" + "TASlog('Entering: '+(cb.name||'(anonymous function)'));" + "var t0 = performance.now();cb.apply(ctx||{},arguments);var t1 = performance.now();" + "TASlog('Exiting: '+(cb.name||'(anonymous function)')+' (took '+Number(Math.round((t1-t0)+'e3')+'e-3')+' ms)');" + "};")(cb, ctx, log); /*jshint +W054 */ } (callback, context, callstack, label));API log(the last two lines only happen when I run **!setattr --sel --recalc1|1** )
"ReferenceError: performance is not defined" "ReferenceError: performance is not defined\n at Array.TAS_CALLSTACK_1 (eval at <anonymous> (eval at <anonymous> (evalmachine.<anonymous>:282:6)), <anonymous>:3:99)\n at self.trigger (evalmachine.<anonymous>:77:37)\n at messageHandler (evalmachine.<anonymous>:285:11)\n at process.<anonymous> (/home/node/d20-api-server/node_modules/tiny-worker/lib/worker.js:68:55)\n at emitTwo (events.js:100:13)\n at process.emit (events.js:185:7)\n at handleMessage (internal/child_process.js:695:10)\n at Pipe.channel.onread (internal/child_process.js:440:11)"
I guess I was expecting to see the same browser's console log output of sheet worker activity regardless if the sheet was triggered by an API script. I assume I was wrong? ;-PThe Aaron said:
So, that's to be expected if it runs in the API, right?
If you manually change things on the sheet in the game, does it log to the console?
!setattr --sel --repeating_buff_$0_buff-enable_toggle|[[1-(1*@{repeating_buff_$0_buff-enable_toggle})]]
!setattr --sel --repeating_buff_$0_buff-enable_toggle|[[1-(1*@{selected|repeating_buff_$0_buff-enable_toggle})]]
Who says? You must have been talking to Stephen...The Aaron said:
Hey, I can't do everything for you... =D
!setattr --evaluate --repeating_buff_$0_buff-enable_toggle|1-%repeating_buff_$0_buff-enable_toggle%Just need to add a targeting option.
ReferenceError: charid is not defined ReferenceError: charid is not defined at _.each._.each._.chain.map._.chain.filter.charIDList (apiscript.js:1964:41) at eval (eval at (/home/node/d20-api-server/api.js:146:34), :65:16) at Object.publish (eval at (/home/node/d20-api-server/api.js:146:34), :70:8) at /home/node/d20-api-server/api.js:1489:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) at Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:111:400The macros i am trying to get to work are as follows, but i get errors of the sort from any command using --charid
!setattr --charid @{character_id} --mod --repeating_item_-<An ID>_qty|-1