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

Group Init

I am attempting to get it to roll off a singular attribute and not having much luck. Because initiative is not based on a roll in the system i'm using its a constant stat. In this example i would need it to use the initiative_mod and the initiative_add stats together.
1503325774
The Aaron
Pro
API Scripter
Hi, sorry for the delay.. GenCon. You can do that by setting the Dice Count to 0 and then setting up a group with the name of the attribute.  For example, assuming you just installed it and needed to set up the attribute InitConstant: !group-init --del-group 1 !group-init --add-group --bare InitConstant !group-init-config --set-dice-count 0 (that last you would usually do through the help: !group-init --help )
So on my character sheet do I need to add a total of the two initiative stats?
1503386037
The Aaron
Pro
API Scripter
No, you can just add two attributes: !group-init --add-group --bare stat1 --bare stat2
1507127964

Edited 1507128054
Is there a way to mimic the Initiative roll on the D&D 5e sheet? Do I just replace the group to be initiative_bonus? I haven't gone through all of the NPCs, I'm just assuming I may run across an NPC that has bonus' beyond dexterity to initiative (though I could be wrong here). I only ask, because I noticed that was the stat used by the built in initiative roll as shown below. {{r1=[[@{Goblin|d20}+[[@{Goblin|initiative_bonus}]][DEX] &{tracker}]]}} Edit: Also, what does the announcer options do? I noticed that None, Hidden and Visible are clear in how they act. But I wasn't sure about Partial.
1507128448
The Aaron
Pro
API Scripter
For the 5e Sheet, you can set up GroupInitiative like this: !group-init --del-group 1 !group-init --add-group --bare initiative_bonus Partial will show PCs Visible, but NPC Hidden.
Thanks The Aaron, just figured out the Partial lol, I never though, why would I want to roll their initiative. Though with this tool it's probably a lot faster if I do it for them. There's just something about someone else rolling for you! Going through the help in depth now, this is a super cool, thanks for the amazing script!
1507128979
The Aaron
Pro
API Scripter
Yup, no problem.  Sorry for the arcane syntax, it's an older script. =D PCs in this since could also mean allies, if they can be controlled by the players, but I feel you on the idea of having others roll for you.  One thing to remember is that this script predates character sheets on Roll20, which is why it does some of the things it does, like the PCs rolling using it.  Also, the rules system was much more useful when no attributes were implicitly created, but that's life! =D
1507130744

Edited 1507131030
Is there anywhere that describes how the stack function works? Ultimately I am looking to add a turn order, and other effects to my turn tracker. And I watched a video that is showing that here (albiet quite old). Is this even part of GroupInit? Is the stack function something that allows me to do this type of thing? Here is the video I am referencing -&nbsp; <a href="https://youtu.be/TgqxMzAZGUo" rel="nofollow">https://youtu.be/TgqxMzAZGUo</a> Anytime I try to use --stack label test for example I get the following
1507133464
The Aaron
Pro
API Scripter
This talks about the Stack functionality: <a href="https://app.roll20.net/forum/post/4543341/script-u" rel="nofollow">https://app.roll20.net/forum/post/4543341/script-u</a>... In that video, he is conflating GroupInitiative with TurnMarker1:&nbsp; <a href="https://app.roll20.net/forum/post/3963829/script-u" rel="nofollow">https://app.roll20.net/forum/post/3963829/script-u</a>... Most of the functionality he's demoing (the orange aura, the "Round #" in the turn order, the purple chat announcements) is from TurnMarker1.
1507163986

Edited 1507164439
Nox
Translator
Hi, i dont want to open another post so I ask here: I'm trying to do a similar thing , but i have a problem:&nbsp; In our system the initiative is&nbsp; based off various stats. Initiative is calculated by using an attribute called "quick". If two character has the same quick score, we use Vigilant. if the characters have the same vigilant aswell, we need to roll 1d20 and whoever get the higher number will get the initiative. Now i did this initiative in a macro, but i dont know how to use the Group initiative API with it.&nbsp; Macro: [[@{selected|quick}+round((@{selected|vigilant}/100+1d20/10000)*10000)/10000 &{tracker}]] (Those *10000 and /10000 are there to fix a bug i had were if the result should've been something like 12.1309 I got 12.13089999999999999...) This give me something like 12.1409, where 12 is quick,14 is vigilant and 09 is the roll of the d20. This keeps the initiative in perfect order. Using the group initiative script&nbsp;i've&nbsp;menaged to do it by calling an attribute I created for this (d20roll: 1d20/10000).&nbsp; 1. quick|current + tie-breaker( vigilant|current ) + d20roll|current the problem with this is that i need to create this attribute for every character i make, and that's annoying.&nbsp; Any other way I can menage to get this done without this attribute? any way to make the script to roll a dice as a bonus stat?&nbsp; Edit: I guess i could just modify the HTML of the character sheet so it adds automatically a "d20roll" attribute to any character iI make.. but still it would be nice if i could do it by using bonus stat.
1507164836
The Aaron
Pro
API Scripter
I think I can find a solution for you.&nbsp; I don't think there's a good way to set this up as a rule in GroupInitiative, but at a minimum, I could write a small script that created that attribute on all your character objects and any created in the future.&nbsp; I'll think on it while putting the kids to bed and see what I can come up with...
1507165368

Edited 1507172501
Nox
Translator
The Aaron said: I think I can find a solution for you.&nbsp; I don't think there's a good way to set this up as a rule in GroupInitiative, but at a minimum, I could write a small script that created that attribute on all your character objects and any created in the future.&nbsp; I'll think on it while putting the kids to bed and see what I can come up with... That would be fantastic!! EDIT: I'd like to also remove the critical and fumble from the result (the red/green border).&nbsp; EDIT2:&nbsp; Any way to auto re-roll the tokens who get same values? I found a workaround for the d20roll attribute, even if it's a bit ugly. I'm not that good with html at the moment, but i remember some basics from highschool.&nbsp; Since I use a custom version of the character sheet I added a command to create the attribute when it is opened. In the character sheet there is an attribute for the sheet_version which get updated everytime the sheet get&nbsp;opened. I used that function to insert a setter["d20roll"]= "[[1d20/10000]]", so every time I open a new character sheet it adds the attribute d20roll and I can use the Group-init script. Although is a bit messy it seems it works properly. It also removed the critical hit-fumble since I added the square brackets for inline macros.&nbsp; I honestly dont&nbsp;get why if I omit the "[[]]" (as I did in the first place) the script reads the roll as the initiative roll, and if I add the square brackets it is read as a bonus stat and added properly to other bonus stats. It behaves strangely if I do not use the square brackets. The result is correct, but the numbers of the calculation don't make much sense (I get something like 3 from roll - or other random number as normal + 10.6548 -or other random numbers to complete the correct result - from the bonus, even if my bonus shouldn't&nbsp;be that number). It's hard to explain :D. Mysteries of the code. If you have any better-cleaner way to arrange it let me know, and thanks in advance for all the help!
1507642811

Edited 1507643547
The Aaron
Pro
API Scripter
Sorry for the delay, this should add an attribute named init_formula to every character and any future created characters: on('ready', () =&gt; { &nbsp; &nbsp; const attrValue='(@{quick}*10000)+(@{vigilant}*100)'; &nbsp; &nbsp; const attrName='init_formula'; &nbsp; &nbsp; const createInitAttr = (cid) =&gt; createObj('attribute',{ &nbsp; &nbsp; &nbsp; &nbsp; characterid: cid, &nbsp; &nbsp; &nbsp; &nbsp; name: attrName, &nbsp; &nbsp; &nbsp; &nbsp; current: attrValue &nbsp; &nbsp; }); &nbsp; &nbsp; const charids = findObjs({type:'character'}).map((o)=&gt;o.id); &nbsp; &nbsp; const haves = findObjs({type:'attribute', name: attrName}).map((o)=&gt;o.get('characterid')); &nbsp; &nbsp; const havenots = charids.filter((id)=&gt;!haves.includes(id)); &nbsp; &nbsp; havenots.forEach(createInitAttr); &nbsp; &nbsp; log(`Adding attributes on ${havenots.length} characters.`); &nbsp; &nbsp; on('add:character',(c)=&gt;setTimeout(()=&gt;createInitAttr(c.id),100)); }); Then you just need to set up GroupInitiative like this: !group-init --del-group 1 !group-init --add-group --bare init_formula Leave GroupInitiative configured to roll 1d20 and add it in.&nbsp; I left the 1d20 roll out of the formula and adjusted it to account for IEEE754 rounding errors.&nbsp; On each token, GroupInitiative will basically do this then: [[1d20 + [[(@{quick}*10000)+(@{vigilant}*100)]] ]]