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

Can Sheetworkers roll initative?

1708669339
Cc
Pro
Sheet Author
Hi! I needed to use sheetworkers for a bunch of if scenarios when rolling, and I'm not sure how to make the result of a sheetworker roll count as an initiative roll to be sent to the initiative tracker. The roll is [[[[floor(@{gracetotal})]]d6]]. Thanks for any help!
1708672860
GiGs
Pro
Sheet Author
API Scripter
If you are doing sheet worker calculations and want to send a roll to chat (which includes initiative rolls), you'll need to use Custom Roll Parsing. I don't know about anyone else, but I cannot guess what that would look like without seeing your existing sheet worker. An initiative roll is just like any other roll sent to chat, just add &{tracker} to the end of the roll.
1708673693
Cc
Pro
Sheet Author
GiGs said: If you are doing sheet worker calculations and want to send a roll to chat (which includes initiative rolls), you'll need to use Custom Roll Parsing. I don't know about anyone else, but I cannot guess what that would look like without seeing your existing sheet worker. An initiative roll is just like any other roll sent to chat, just add &{tracker} to the end of the roll. This is the output when I add &{tracker} to the end: This is the main roll: startRoll("&{template:init} {{name=Test}} {{rollinit=[[[[@{gracetotal}]]d6s]] &{tracker}}}", (results) => { This is the full script: <script type="text/worker">     on('clicked:init', (info) => {           getAttrs(["gracetotal","gracereroll"], function(values) {                 startRoll("&{template:init} {{name=Test}} {{rollinit=[[[[@{gracetotal}]]d6s]] &{tracker}}}", (results) => {             const total = results.results.rollinit.result;             });         if(values.gracereroll == "1") {             startRoll("&{template:initreroll} {{name=Reroll}} {{rollinitreroll=[[1d6]]}}", (results) => {             const reroll = results.results.rollinitreroll.result;         });}         });     }); </script>
1708673832
Cc
Pro
Sheet Author
Picture didn't appear, the output said: Initiative 13&{tracker}
1708706577

Edited 1708706639
GiGs
Pro
Sheet Author
API Scripter
&(tracker} only works when you have a token selected, and you have to place it in the roll , like this {{rollinit=[[[[@{gracetotal}]]d6s &{tracker}]] }} I don't see what you are using a sheet worker for there. What are you trying to do?
1708710393

Edited 1708710797
GiGs
Pro
Sheet Author
API Scripter
To be clear, unless you're doing something else, you don't need a sheet worker. A simple rollbutton would replace your current action button: <button type="roll" name="roll_init" value="&{template:init} {{name=Test}} {{rollinit=[[[[@{gracetotal}]]d6s &{tracker}]] }}">Initiative</button> <button type="roll" name="roll_init_reroll" value="&{template:initreroll} {{name=Reroll}} {{rollinitreroll=[[[[@{gracetotal}]]d6s &{tracker}]] }}">Initiative</button> I wonder whyyou are using two different rolltemplats there. It seems like you could probably be using the same template unless the rolls are presented very differently.
1708711108
Cc
Pro
Sheet Author
Worked! Thank you!
1708711596
Cc
Pro
Sheet Author
GiGs said: To be clear, unless you're doing something else, you don't need a sheet worker. A simple rollbutton would replace your current action button: <button type="roll" name="roll_init" value="&{template:init} {{name=Test}} {{rollinit=[[[[@{gracetotal}]]d6s &{tracker}]] }}">Initiative</button> <button type="roll" name="roll_init_reroll" value="&{template:initreroll} {{name=Reroll}} {{rollinitreroll=[[[[@{gracetotal}]]d6s &{tracker}]] }}">Initiative</button> I wonder whyyou are using two different rolltemplats there. It seems like you could probably be using the same template unless the rolls are presented very differently. Rerolls are conditional in this system, and I'm looking to make a character sheet that automates/simplifies the game process of a Hollow Knight TTRPG system. So I only want rerolls to occur & appear in chat if a player meets the condition to reroll.
1708713941
GiGs
Pro
Sheet Author
API Scripter
It looks like you are relying on them pressing a "reroll" button, so it seems to me like you could just replace that with a button that actually does the reroll.