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

Savage Worlds DealInit API script

Hey all, Up until the update, I had been having tremendous success with the DealInit script for Savage Worlds and dealing turn order. Since then, I've had to do a workaround. Anybody know of another SW deal init script that works? Thanks in advance!
1652921154
Pat
Pro
API Scripter
What type of problems are you having?  I wrote the script - maybe I can help if I can have a few more details
1652967909

Edited 1652968126
OMG Pat, you could be my hero!!! Here is what I'm getting: For reference, the error message generated was: TypeError: Cannot read property 'get' of undefined TypeError: Cannot read property 'get' of undefined at getInitiativeEdges (apiscript.js:937:62) at dealInitiative (apiscript.js:1385:7) at handleInput (apiscript.js:1545:7) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:168:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:168:1), <anonymous>:70:8) at /home/node/d20-api-server/api.js:1737: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)
1653054908
Pat
Pro
API Scripter
Let's give the below a try first.  If that doesn't work, please walk me thru the steps you take before you encounter the error. The most common help request I get is for debugging this API Crash error: TypeError: Cannot read property 'get' of undefined at getInitiativeEdges (apiscript.js:523:66) at dealInitiative (apiscript.js:968:10) This type of problem occurs when the TurnOrder is not "flushed" between sessions or pages. Roll20 does a poor job of managing the Turn Order data structure across pages or sessions. By "Flush" I mean: Open Turn Order => Poke Blue Gear Button => Poke Red "Remove all Turns" button My workflow, when I use the script is like this: New Roll20 session or New Page => Clear Turn Order: !deal-init --clearTurnOrder New Encounter: !deal-init --reset New Round: !deal-init Someone Spends a Benny to Draw a New Card: !deal-init --deal2chat (then I just manually move them around in the TurnOrder) etc.
Ha, I think you've fixed it! I will keep the clear turn order in mind. I greatly appreciate that man!!!! We play tonight so I will let you know if we encounter any other issues.
1653168105
Pat
Pro
API Scripter
Excellent! I personally use these macros to call the script: "New Scene" !deal-init --reset "New Round" !deal-init "Deal Only To" !deal-init --onlyto --?{Enter name to deal to|string} "Benny a New Card" !deal-init --deal2chat "Clear Turn Order" !deal-init --clearTurnOrder Good luck in tonight's game!
Complete success Pat, thank you a thousand times over!!!