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

GroupInitiative and Advantage/Disadvantage

So I read through this very informative thread (<a href="https://app.roll20.net/forum/post/12177010/script-update-groupinitiative-now-with-beacon-sheet-support" rel="nofollow">https://app.roll20.net/forum/post/12177010/script-update-groupinitiative-now-with-beacon-sheet-support</a>) and see it's possible to create multiple configurations in GroupInitiative to reflect normal, advantage, or disadvantage D&amp;D (2024) rolls.&nbsp; Awesome. I would rather not prompt my players (or myself) each time for how they are rolling, and I'd also rather not rely on tool tips or status markers. My preference would be to simply have three macros (say, roll-init, roll-init-ADV, roll-init-DISAD) that players (or I) could click on. What I can't figure out is how to directly invoke a roll with one of the Bonus Stat Groups through the !group-init command line so that each macro can throw the dice with the appropriate group.&nbsp; Does anyone out there have an idea or example I can work off of? Thanks!
1748119861
The Aaron
Roll20 Production Team
API Scripter
There isn't a way to do that directly, but you could use this in combination with TokenMod to get it done: Roll Normal: !token-mod --set tooltip|Normal !group-init Roll Advantage: !token-mod --set tooltip|Advantage !group-init Roll Disadvantage: !token-mod --set tooltip|Disadvantage !group-init That would force appriate selection of rules based on tooltip without prompting.
I actually make use of the Tool Tips (esp. for NPCs), which is why I was hoping to avoid that route. Hmm. I might have to do it with a status marker I'm not using (e.g., have token-mod turn it on, run group-init, then have token-mod turn it off). Let's see if I can make that work. Thanks for the quick response, Aaron.
1748125738
The Aaron
Roll20 Production Team
API Scripter
Cool.&nbsp; I can likely add a way of selecting a specific rule, or adding some filter like only advantage'd rules or some such.&nbsp; One thing to be aware of is that !group-init is asynchronous, so, you can't really turn off the statusmarker or tooltip immediately. !token-mod --set tooltip|Disadvantage !group-init !token-mod --set tooltip| &lt;Group Initiative will likely be active and looking for tooltip here&gt;
1751475510

Edited 1751491493
So I have this set up, apparently, correctly, but it's just not seeing the rules.&nbsp; I am running in the Experimental Sandbox (same results in the normal one) I set it up with: !group-init --add-group --filter-sheet dnd2024byroll20 --filter-tooltip advantage --roll-die-count 2 --roll-die-mod kh1 --computed initiative_bonus --computed init_tiebreaker --label advantage !group-init --add-group --filter-sheet dnd2024byroll20 --filter-tooltip disadvantage --roll-die-count 2 --roll-die-mod kl1 --computed initiative_bonus --computed init_tiebreaker --label disadvantage !group-init --add-group --filter-sheet dnd2024byroll20 --filter-tooltip normal --computed initiative_bonus --computed init_tiebreaker --label normal which results in: So far, so good. But if I run this macro ...&nbsp; !token-mod tooltip|advantage !group-init ... which should set the tool tip to read "advantage" (it does), it should fire off group 1, right? It's not seeing the rule -- the label is not showing and &nbsp;it's not adding 2 to the Init roll (as that NPC should have).&nbsp; Same for when I try to detect "disadvantage" or "normal."&nbsp; Also if I just have rule 3 be the default (no tool tip reading). In all cases, "No matching rule." The mod output console, for just a single "normal" click of this generates: "Error: No attribute or sheet field found for character_id -OR7nVOAoWUOhLHSM3bU named dnd2024byroll20" "Error: No attribute or sheet field found for character_id -OR7nVOAoWUOhLHSM3bU named advantage" "Error: No attribute or sheet field found for character_id -OR7nVOAoWUOhLHSM3bU named 2" "Error: No attribute or sheet field found for character_id -OR7nVOAoWUOhLHSM3bU named kh1" "Error: No attribute or sheet field found for character_id -OR7nVOAoWUOhLHSM3bU named initiative_bonus" "Error: No attribute or sheet field found for character_id -OR7nVOAoWUOhLHSM3bU named init_tiebreaker" "Error: No attribute or sheet field found for character_id -OR7nVOAoWUOhLHSM3bU named advantage" "Error: No attribute or sheet field found for character_id -OR7nVOAoWUOhLHSM3bU named dnd2024byroll20" "Error: No attribute or sheet field found for character_id -OR7nVOAoWUOhLHSM3bU named disadvantage" "Error: No attribute or sheet field found for character_id -OR7nVOAoWUOhLHSM3bU named 2" "Error: No attribute or sheet field found for character_id -OR7nVOAoWUOhLHSM3bU named kl1" "Error: No attribute or sheet field found for character_id -OR7nVOAoWUOhLHSM3bU named initiative_bonus" "Error: No attribute or sheet field found for character_id -OR7nVOAoWUOhLHSM3bU named init_tiebreaker" "Error: No attribute or sheet field found for character_id -OR7nVOAoWUOhLHSM3bU named disadvantage" "Error: No attribute or sheet field found for character_id -OR7nVOAoWUOhLHSM3bU named dnd2024byroll20" "Error: No attribute or sheet field found for character_id -OR7nVOAoWUOhLHSM3bU named initiative_bonus" "Error: No attribute or sheet field found for character_id -OR7nVOAoWUOhLHSM3bU named init_tiebreaker" "Error: No attribute or sheet field found for character_id -OR7nVOAoWUOhLHSM3bU named normal" I've tried clearing then reloading the rules. I've tried with one or many characters. I've tried with PC and NPC characters. All the tokens involved are tied to 2024 character sheets.&nbsp; Am I just missing some embarrassingly obvious error I'm making? (Version is&nbsp;v0.9.41)
1752117501
The Aaron
Roll20 Production Team
API Scripter
This should be: !token-mod --set tooltip|advantage You should be able to verify by checking the tooltip in the UI.
1752164530
timmaugh
Forum Champion
API Scripter
If, after making the syntax change Aaron points out, you are still having issues, I would wonder about GroupInit running before TokenMod has finished. In that case, you can add the Metascript Toolbox to your game and slow down the GroupInit command by some degree. Here I'm slowing it down by .2 seconds: !group-init {&amp;delay 0.2}
Ugh. Aaron: 1. Good catch of my embarrassingly obvious error. Fixed. 2. Tooltip is being updated as the macros intend (with "advantage" or "disadvantage" or "normal"). 3. But ... !group-init is still not seeing any rules ("No Matching Rule" being generated, as above). That includes when I manually set the tool tip as indicated and run the mod from the command line. I've confirmed the rules are still as above. Tim: 1. It doesn't look like lag from Tooltip, because when I do it all manually (manually update the tooltip on the token, then run "!group-init" from the command line), it still doesn't detect the tooltip cue ( "No Matching Rule"). 2. But ... I did add the Metascript Toolbox and changed the syntax in the macro as you described. It looks to be loading correctly in the sandbox (which I have also restarted, along wiith the game).&nbsp;&nbsp; When I then fire off !group-init in the macro with the delay parameter you provided OR directly in the command line with the delay parameter, nothing ever happens .&nbsp; GroupInit doesn't seem to run. No error is generated in chat or in the console. (Firing off "!group-init" without the parameter behaves still as above.) So I remain well and truly stumped.
And tinkering with it today, on the Experimental sandbox, any use of the computed (initiative_bonus) stuff is crashing the sandbox. But selecting a 2024-backed token at that point (the only character sheets in this game), running "!group-init" from chat crashes the Experimental sandbox with: For reference, the error message generated was:&nbsp; TypeError: Cannot read properties of undefined (reading 'initiative_bonus') TypeError: Cannot read properties of undefined (reading 'initiative_bonus') at getComputed (file:///home/node/d20-api-server/api.js:674:29) at getComputedProxy (apiscript.js:5841:29) at Object.func (apiscript.js:6236:22) at apiscript.js:7126:33 at Array.reduce (&lt;anonymous&gt;) at apiscript.js:7109:48 at Array.map (&lt;anonymous&gt;) at GetBonuses (apiscript.js:7095:31) at findInitiativeBonus (apiscript.js:7172:23) at apiscript.js:7214:35 This is (still) running&nbsp;&nbsp;GroupInitiative v0.9.41, but is new behavior, so thought I'd bring it up.&nbsp;
1753460834
timmaugh
Forum Champion
API Scripter
This is a known issue that has been reported. I think it owes to something on the sheet side, but Roll20 is looking at it.
Thanks!
Quoth the Change Log ... Fixed a bug that caused API sandboxes to crash on D&amp;D 5e 2024 games. Which seems to have resolved all problems. Yay!