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

[Script Update] GroupInitiative - Now with Beacon Sheet Support!

1734983165
The Aaron
Roll20 Production Team
API Scripter
GroupInitiative Update 0.9.37  - Added support for Beacon, Sheet filtering, Bonuses, and better help formatting. --bonus  Stat Adjustment Adds a raw number to the roll.  Use it like other Stat Adjustments with the number as an argument: !group-init --add-group --bare npc_init --bonus 5 This will result in adding the value of npc_init + 5 to the roll. --computed  Stat Adjustment Uses the value of a Beacon Sheet Computed for the stat group.  This works just like attribute references, but uses the Beacon SDK instead.   Note: This requires the Experimental API Server, and your Beacon Sheet (Likely, DnD 2024 by Roll20) needs to be the primary sheet in the game for it to work. !group-init --add-group --computed initiative_bonus This will collect the value of initiative_bonus from the Beacon Character Sheet, and apply it to the roll.  There is more work going on for computed values than there is for attributes, so you may notice a small amount of lag when these are fetched. --filter-sheet  Stat Adjustment To support multiple character sheets, you can now add a rule to filter to a specific character sheet. !group-init --add-group --filter-sheet dnd2024byroll20 --computed initiative_bonus Only characters using the given sheet will have this rule applied to calculate their initiative.  This is primarily useful for multi-sheet games.  You can see the names of character sheets installed in the current game with the following command: !group-init --show-sheets GroupInitiative will only allow you to add rules for sheets in the current game, but it will tell you if you try to add one for a sheet that is missing. Standard Configuration Options Update With added Beacon support added, there is now a Config option for  D&D 2024 by Roll20 .  GroupInitiative will prompt you in new games, but you can add it in existing games from the GroupInitiative Help.  Since you might want to use this with  D&D 5E by Roll20 , both those Config options will now add to the existing configuration, rather than replacing it.   If you are running a game with  D&D 2024 by Roll20  as the primary sheet, and  D&D 5E by Roll20  as the secondary sheet, you can add both configs from the help, or run the following commands: !group-init-config --apply-standard-config|dnd5eogl !group-init-config --apply-standard-config|dnd2024byroll20 Afterwards, you should have Bonus Stat Groups that look like this: You're all set for some Beacon Battles at this point! If you have any questions or issues, please let me know!
1734986147
vÍnce
Pro
Sheet Author
The Aaron delivers an early x-mas present! Great to see GroupInitiative getting adapted to support the Beacon - D&D2024 sheet.  Will this work with any other Beacon sheets? (just looking ahead as a sheet author...)
1734999867
The Aaron
Roll20 Production Team
API Scripter
If they provided Computed values, it will work for them.  If you try it out with any others, please let me know!
1735008154
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thank you, Aaron for this and all the other stuff you do!
This works amazing. Thanks Aaron! Keep it up.
1735058992
The Aaron
Roll20 Production Team
API Scripter
Good to hear! 
So, I can have group init roll the initiative for both my player characters using the 2024 sheet and NPC's using the 2014 sheet. However, It doesn't seem to pick up the Init bonus from the 2024 sheet at all. Maybe I have something set wrong but I can't seem to see how to get this to work correctly.
1735329887
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Steverhud said: So, I can have group init roll the initiative for both my player characters using the 2024 sheet and NPC's using the 2014 sheet. However, It doesn't seem to pick up the Init bonus from the 2024 sheet at all. Maybe I have something set wrong but I can't seem to see how to get this to work correctly. Hi Steverhud! I had this same problem yesterday. Due to the way that beacon handles data, for this to work, Beacon has to be the default sheet for the campaign, with 2014 as the secondary. If you deactivate the 2024 sheet make a copy of your game with 2024 as the base sheet, it will automatically set up the copy with 2024 as the base and 2014 as the secondary. GroupInitiative should work in this new copy.
1735330470
The Aaron
Roll20 Production Team
API Scripter
Yeah, exactly as Keith said.  I probably should have made this note from the post a bit louder: Note: This requires the Experimental API Server, and your Beacon Sheet (Likely, DnD 2024 by Roll20) needs to be the primary sheet in the game for it to work.
1735331479

Edited 1735332066
Ok, that works. I did have the Experimental API Server activated but did not have the 2024 sheet as the primary sheet. I have it working now. I need to learn to read more closely. LOL.  keithcurtis said: Steverhud said: So, I can have group init roll the initiative for both my player characters using the 2024 sheet and NPC's using the 2014 sheet. However, It doesn't seem to pick up the Init bonus from the 2024 sheet at all. Maybe I have something set wrong but I can't seem to see how to get this to work correctly. Hi Steverhud! I had this same problem yesterday. Due to the way that beacon handles data, for this to work, Beacon has to be the default sheet for the campaign, with 2014 as the secondary. If you deactivate the 2024 sheet make a copy of your game with 2024 as the base sheet, it will automatically set up the copy with 2024 as the base and 2014 as the secondary. GroupInitiative should work in this new copy.
Has anyone created a way to select Adv/DisAdv before doing a group Initiative roll? Is there another script that offers this?
1735337903
The Aaron
Roll20 Production Team
API Scripter
Update 0.9.39 &nbsp;- Added support for filtering by status marker and tooltip words, added new adjustments for die count, die size, and die modifiers. (Thanks&nbsp; DM Deadman ) I've added two new filters as follows: --filter-status Adjustment This filter lets you apply a rule to only the tokens with a given status marker.&nbsp; Numbers are ignored (currently), so as long as the status marker is present, the rule will be applied. !group-init --add-group --filter-status green --bonus 5 --bare npc_init --filter-tooltip Adjustment This filter lets you apply a rule to only tokens that have a given word in their tooltip.&nbsp; The tooltip doesn't need to be visible to be matched, and you can have other words.&nbsp; The match is case insensitive, and a word can be any combination of letters, numbers, and the characters: # : | - !group-init --add-group --filter-tooltip elite --bonus 5 --bare npc_init I've added three new adjustments that apply to the rolls for the tokens matching the rule: --roll-die-count Adjustment This changes the number of dice rolled for the matching tokens. !group-init --add-group --filter-status elite --roll-die-count 2 --bare npc_init --roll-die-size Adjustment This changes the size of the die rolled for initiative for the matching tokens. !group-init --add-group --filter-status elite --roll-die-size 30 --bare npc_init --roll-die-mod Adjustment This sets the modifiers applied to the roll for the matching tokens. !group-init --add-group --filter-status elite --roll-die-mod ro1 --bare npc_init With the above adjustments, you can now create rules that let you roll with advantage or disadvantage.&nbsp; Here's how you can set up to roll advantage or disadvantage with both the 2024 and 5eOGL sheet using the tooltip contents to indicate which tokens to apply the rules to. !group-init --add-group --filter-sheet dnd2024byroll20 --filter-tooltip advantage --roll-die-count 2 --roll-die-mod kh1 --computed initiative_bonus --computed init_tiebreaker !group-init --add-group --filter-sheet dnd2024byroll20 --filter-tooltip disadvantage --roll-die-count 2 --roll-die-mod kl1 --computed initiative_bonus --computed init_tiebreaker !group-init --add-group --filter-sheet dnd2024byroll20 --computed initiative_bonus --computed init_tiebreaker !group-init --add-group --filter-sheet ogl5e --filter-tooltip advantage --roll-die-count 2 --roll-die-mod kh1 --bare initiative_bonus --tie-breaker initiative_bonus !group-init --add-group --filter-sheet ogl5e --filter-tooltip disadvantage --roll-die-count 2 --roll-die-mod kl1 --bare initiative_bonus --tie-breaker initiative_bonus !group-init --add-group --filter-sheet ogl5e --bare initiative_bonus --tie-breaker initiative_bonus (You may want to run each of those commands separately just to be sure they all end up set and in the right order.) You should end up with Bonus Stat Groups that look like this: (Be sure to remove any old rules) You can get this version now in my Github:&nbsp; <a href="https://github.com/shdwjk/Roll20API/blob/master/GroupInitiative/GroupInitiative.js" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/GroupInitiative/GroupInitiative.js</a> The One Click version should be updated in the next week or so.
1735339115
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Super cool! I will re-do my config as soon as the One-Click drops.
1735342539
The Aaron
Roll20 Production Team
API Scripter
You could use this same method to apply bonuses of other types to certain groups, though each option would double the number of rules you need. I want to write a GroupInitiative2 with more dynamic rules, but it will require a completely different interface (which frankly, would be a good change).
So, theoretically, we could create a macro that prompts for advantage/disadvantage/normal, uses TokenMod to add or remove the appropriate tooltip, then call GroupInit to roll Initiative. Am I understanding this right?&nbsp;
1735398447
The Aaron
Roll20 Production Team
API Scripter
That's correct, though you'll need to experiment with the timing a bit to be sure it works correctly.&nbsp;
1735427208
timmaugh
Pro
API Scripter
To tweak the timing, you can use ZeroFrame batching and {&amp;delay} tags. You can further customize the selected tokens with SelectManager. I can provide examples, but having the source commands would be best, if you can share... then I can show how to convert and combine them. =D
1735436140
The Aaron
Roll20 Production Team
API Scripter
Update 0.9.40 &nbsp;- Added support for labeling rules, and better output formatting on hover. (Thanks&nbsp; DM Deadman ) I've added the ability to label rules as follows: --label &nbsp;Adjustment This lets you apply a label to a rule which will show up in the output. !group-init --add-group --label Advantage --filter-status green--roll-die-count 2 --roll-die-mod kh1 --bare initiative_bonus --tie-breaker initiative_bonus Improved Output Formatting The hover for rolls now show detail about the roll and the rule applied: 1st line: The label applied to the rule (or a generated label like "Rule #3") or "No Matching Rule" if none of the rules matched 2nd line: The formula being rolled including the dice and the bonus to add 3rd line: The result, colored appropriately 4th line: The dice rolled and used (colored appropriately) With that, we can now label the above rules so that they show which one was applied.&nbsp; Edit as desired: !group-init --add-group --label Advantage Beacon --filter-sheet dnd2024byroll20 --filter-tooltip advantage --roll-die-count 2 --roll-die-mod kh1 --computed initiative_bonus --computed init_tiebreaker !group-init --add-group --label Disadvantage Beacon --filter-sheet dnd2024byroll20 --filter-tooltip disadvantage --roll-die-count 2 --roll-die-mod kl1 --computed initiative_bonus --computed init_tiebreaker !group-init --add-group --label Beacon --filter-sheet dnd2024byroll20 --computed initiative_bonus --computed init_tiebreaker !group-init --add-group --label Advantage 5eOGL --filter-sheet ogl5e --filter-tooltip advantage --roll-die-count 2 --roll-die-mod kh1 --bare initiative_bonus --tie-breaker initiative_bonus !group-init --add-group --label Disadvantage 5eOGL --filter-sheet ogl5e --filter-tooltip disadvantage --roll-die-count 2 --roll-die-mod kl1 --bare initiative_bonus --tie-breaker initiative_bonus !group-init --add-group --label 5eOGL --filter-sheet ogl5e --bare initiative_bonus --tie-breaker initiative_bonus That should give you rules like these: Note: If you are only using the 5eOGL, don't apply the first 3 rules, you don't need them. The updated version should hit the 1-click in the next week or so, or you can get it from my github:&nbsp; <a href="https://github.com/shdwjk/Roll20API/blob/master/GroupInitiative/GroupInitiative.js" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/GroupInitiative/GroupInitiative.js</a> Let me know if you have any feedback!
This is working great without any delays. I set the macro up as follows; !token-mod --set tooltip|"?{Normal/Advantage/Disadvantage|Normal|Advantage|Disadvantage}" !group-init It does things exactly as I expected. Set's the tooltip accordingly and then rolls initiative using the correct rule. Thanks Again Aaron.
1735503377
The Aaron
Roll20 Production Team
API Scripter
Sweet! &nbsp;Glad that's working for you!
1735960733
The Aaron
Roll20 Production Team
API Scripter
GroupInitiative v0.9.40 is in production now in the Script Library!