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 API question

Hello, I just started to use the GroupInitiative API for my campaign. I have a question about the  !group-init --ids <id> [<id> ...]  function. I'm not quite understanding the syntax on how to make this roll for  my party of 5.
1621598510
The Aaron
Roll20 Production Team
API Scripter
Generally speaking, you can select tokens and just run: !group-init If you want to specify Token IDs, you can do that by supplying them to the --ids argument: !group-init --ids -Jfsht4dh -Kg476df57 You can supply one or more space delimited IDs after the --ids flag.  This is usually not so useful as Token IDs are unique to a single instance of a Token, which means they vary from page to page. Note: In command line documentation < > are used to delimit required values, [ ] delimit optional values, and ... means you can supply more of the preceding value as needed.
1621627463
Andreas J.
Forum Champion
Sheet Author
Translator
You can supply one or more space delimited IDs after the --ids flag.  This is usually not so useful as Token IDs are unique to a single instance of a Token, which means they vary from page to page. Could GroupInit steal some targetting code from other APIs, so targetting names could be possible, as an alternative for a more persistant macro? Although just  doing !group-init and selecting tokens is good enough in most cases, haven't used the --ids option, but could see it having some use. The name-select thing should probably limit to tokens on the same page.
1621627601
The Aaron
Roll20 Production Team
API Scripter
Something like that could probably be done.  I have another script I wrote to assist a blind player in rolling their token's initiative without selecting their token.  Really, I need to rewrite GroupInititive because there are many things that have changed since I wrote it... there are character sheets now, we can tell what page the GM is on, etc...  lots of things that should be addressed.  Also, I'm a better programmer than I was, so I could surely make it more dynamic.  =D
1621628503
Andreas J.
Forum Champion
Sheet Author
Translator
The Aaron said: there are character sheets now lmao what that makes for a really solid API that it's popular and very useful even without major rewrites :D Standing the test of time, if nothing else.
1621629500
The Aaron
Roll20 Production Team
API Scripter
Yeah, though the way character sheets created every possible attribute removes a great deal of functionality from GroupInitiatiave.  Back in the old days, you would control which Base Stat Group was applied based on what attributes existed.  Now only the top one matters unless you do something special.