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

1611134600

Edited 1611134646
Hi there, I am new to API and at a complete loss. I tried to implement the groupinit api. What I want: I have a number x tokens without character sheets, just attributes. I want that for a  selected group a d10 is rolled plus the value of an attrib for each selected token. Sort should be ascending. I am getting nowhere here...The !group-init command will, when used in the chat, at best roll the d10. But even the sort option will not work properly, since the entries are not sorted. Not to mention the aforementioned atrib to work with...Any help would be really appreciated. If so, please with complete syntax. Thanks very much, Hendrick
1611156709
Kraynic
Pro
Sheet Author
Attributes only exist on character sheets.  If you have it set up to be looking for an attribute to add to a roll, but then use tokens that aren't representing a character sheet, then that might be your problem because the attribute won't exist when the script looks for it.  You don't need to set the tokens as the default for a sheet, but the token (in the token settings) needs to represent a sheet that has that attribute. If that isn't the problem, you might want to post a screenshot of the output of relevant sections of the output from "!group-init --help".  That will show your current settings for sorting, attributes it is looking for, etc. Someone should be able to figure out what is going on with that info if it isn't the token/attribute issue.
Hi and thanks. there are attributes that are associated with tokens so that works fine. Here is the macro code and a SC of the selected options. !group-init --clear !group-init-config --set-roller|Individual-Roll !group-init --add-group --Bare Speed !group-init !group-init --sort Funny enough, actual the first entry in the turnorder is not sorted, no matter what I try.... Thanks a lot Hendrick Normal 0 21 false false false DE X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Normale Tabelle"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}
Can you use @(target|target 1} @(target|target 2} @(target|target 3} .....and have it multi - "select" the tokens like @{selected|target|1|},   I want to use the target command to choose several tokens and treat each like they are "selected" and one token at a time send them to the turn tracker with &{tracker}.  I will use multi lines in the macro to add each "selected target" to the tracker. I am using the free Roll20 version.  I don't have group initiative.
Thanks for the update and quick reply. I'll be sure to keep an eye on this thread. Looking for the same issue. Bumped into your thread. Thanks for creating it. Looking forward for solution.
1611577512
The Aaron
Roll20 Production Team
API Scripter
Steve R. said: Can you use @(target|target 1} @(target|target 2} @(target|target 3} .....and have it multi - "select" the tokens like @{selected|target|1|},   I want to use the target command to choose several tokens and treat each like they are "selected" and one token at a time send them to the turn tracker with &{tracker}.  I will use multi lines in the macro to add each "selected target" to the tracker. I am using the free Roll20 version.  I don't have group initiative. Please start a new thread for new questions.  &tracker only works with @{selected}, there isn't another way to add Tokens to the Turn Order in a macro without the API.
1611578011
The Aaron
Roll20 Production Team
API Scripter
When you say "without character sheets", you are saying they have Characters associated with them (and thus attributes) but you are only using the Attributes and Abilities tab directly, not a community or Roll20 created HTML character sheet, yes? Can you post a screenshot of the Bonus Stat Groups section of the help? It might be easiest if you just PM me an invite to your game and then GM me and I can track down the issue.
Hi Aaron and thanks for helping. Ah, i cant post you a PM with the link...not authorized to post.?
1611606240
The Aaron
Roll20 Production Team
API Scripter
Sent you a PM, you should be able to reply to it.
1611669301
The Aaron
Roll20 Production Team
API Scripter
Sort Ascending appears to have a bug in it, switching to Sort Descending seems to be working correctly.
Hi, for those who need a workaround for Ascending: This little script I found will do the  trick. It listens to the turnorder and will sort it accordingly. // Fire when the turnorder is changed. on('change:campaign:turnorder', (obj, prev) => {     // Check if the turnorder is changed, otherwise cancel     if(obj.get('turnorder') === prev.turnorder) return;         // Parse the turnorder to an object, and sort it Ascending.     let turnorder = JSON.parse(obj.get('turnorder')).sort((a,b) => { return a.pr - b.pr });         // Set the new turnorder order.     obj.set('turnorder', JSON.stringify(turnorder)); }) Regards, Hendrick