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] GroupInitiative -- Calculate the Initiative for all selected tokens [New Thread]

1431296211
vÍnce
Pro
Sheet Author
I would like to see what was rolled as well as any modifiers and /or bonuses. For example, you can hover over inline rolls in chat (even when done from using an api script, like powercards) and see the formula used and it's output. For NPC's, this isn't that big of a deal, but for players, it's nice to be able to see how the total was calculated.
1431297374
The Aaron
Pro
API Scripter
So something like: [Token Name] [Roll] With the roll giving a hover to show: [Roll]+[total of bonuses] All in whispers to the GM, or do you want players to see theirs as well, or have all players see player rolls? (and if all players, is it sufficient to show everyone if at least one player has the character in their journal?)
1431298012

Edited 1431298055
vÍnce
Pro
Sheet Author
The Aaron said: So something like: [Token Name] [Roll] With the roll giving a hover to show: [Roll]+[total of bonuses] All in whispers to the GM, or do you want players to see theirs as well, or have all players see player rolls? (and if all players, is it sufficient to show everyone if at least one player has the character in their journal?) I really don't mind if everyone can see the results since initiative has already been rolled. :-) In the past, I had a macro quickbar macro that whispered (using powercards) the initiative rolls for NPC's, but player's could hover over any player's inline roll shown in chat (player's had an ability macro for initiative). With your recent updates to GroupInititative, I have decided to just use !group-init for all my initiative rolls.
1431298087
The Aaron
Pro
API Scripter
I'll see what I can do... =D
Vince said: The Aaron said: So something like: [Token Name] [Roll] With the roll giving a hover to show: [Roll]+[total of bonuses] All in whispers to the GM, or do you want players to see theirs as well, or have all players see player rolls? (and if all players, is it sufficient to show everyone if at least one player has the character in their journal?) I really don't mind if everyone can see the results since initiative has already been rolled. :-) In the past, I had a macro quickbar macro that whispered (using powercards) the initiative rolls for NPC's, but player's could hover over any player's inline roll shown in chat (player's had an ability macro for initiative). With your recent updates to GroupInititative, I have decided to just use !group-init for all my initiative rolls. Yeah, I it doesn't matter to much if they see it, but for those npcs on the gm layer might be better to have a selectable option?
1431302334
vÍnce
Pro
Sheet Author
Greg B. said: Yeah, I it doesn't matter to much if they see it, but for those npcs on the gm layer might be better to have a selectable option? Good point Greg. I don't want the group to know about the 3 Invisible Stalkers lurking above Stephen's character.
1431321108
The Aaron
Pro
API Scripter
Update 0.8.7 - Added four Announcers to show the results of GroupInitiative None -- Doesn't announce anything Hidden -- Announces all rolls via whisper to the gm(s) Partial -- Announces rolls for PCs to all, but whispers NPCs to the gm(s) (PCs are any character with either All, or at least one non-gm as a controller) Visible -- Announces everything to everyone With the caveat that tokens on the GM layer are always whispered. PCs have a Greenish background, NPCs have a bluish background, GMLayer items have a darker grayish background. Standard Dice highlighting applies and hover shows you the die roll and the total bonus applied.
1431321193
The Aaron
Pro
API Scripter
(And yes, I know I went from 0.8.5 to 0.8.7 . I actually pushed 0.8.6 , but realized Vince would break it almost immediately and pushed 0.8.7 as a proactive fix for Vince. =D )
1431321307
vÍnce
Pro
Sheet Author
LOL
1431321795
vÍnce
Pro
Sheet Author
That's slick Aaron. Thanks for the additions!
1431321859
The Aaron
Pro
API Scripter
I'm serious! Version 0.8.6 wouldn't have made you happy: Of course, you'll probably find bugs in this version too... =D
1431321952
vÍnce
Pro
Sheet Author
I'll do my best. :-P
Yeah ok, that's pretty cool. :)
1431322964
The Aaron
Pro
API Scripter
Thanks! Let me know how it goes! =D
I've got a game tomorrow night, and it will be the first unveiling of TurnTracker and GroupInit. I think this will help things flow a lot better.
1431323582

Edited 1431323673
vÍnce
Pro
Sheet Author
Gozer the Gozerian said: I've got a game tomorrow night, and it will be the first unveiling of TurnTracker and GroupInit. I think this will help things flow a lot better. Did you get weapon speed working?
1431323647
vÍnce
Pro
Sheet Author
Vince said: Hey Gozer. This macro seems to work for me on the 1e sheet !group-init --bonus [[ @{selected|SurpriseBonus} + @{selected|repeating_weapon_0_WeaponSpeed} ]]
So, is that a formula for making a roll with a bonus built in, or is that setting up a bonus group?
1431324053
The Aaron
Pro
API Scripter
That's applying a bonus using the dice engine, which is actually pretty clever as it knows how to derive the bonus. However, that's only going to work for a single combatant.
Yeah, I'd need something for groups. I will probably just live without weapon speed, unless there's a way to make that repeating field work as a bonus. There's another problem with that, and that is, the players may choose different weapons at different times. How could that be taken into account in this script? Another option would be to let PCs roll their own initiative and use the group initiative script for the baddies.
Also, that dice engine did apply a bonus when I used it for 1 character, but it applied it weird. The SurpriseBonus for this test character was -2, and the weapon speed was 1. The correct bonus total should be -1, but it applied the bonus as -3.
1431324725
vÍnce
Pro
Sheet Author
The Aaron said: That's applying a bonus using the dice engine, which is actually pretty clever as it knows how to derive the bonus. However, that's only going to work for a single combatant. Bummer. Any way for the --bonus to work for each combatant other than selecting one token at a time?
1431324742
The Aaron
Pro
API Scripter
With just the raw numbers, it seems to apply fine: What do you get if you just do: @{selected|SurpriseBonus} + @{selected|repeating_weapon_0_WeaponSpeed}
1431324834
The Aaron
Pro
API Scripter
Vince said: The Aaron said: That's applying a bonus using the dice engine, which is actually pretty clever as it knows how to derive the bonus. However, that's only going to work for a single combatant. Bummer. Any way for the --bonus to work for each combatant other than selecting one token at a time? Yes, but not the way you're thinking it would. I'd have to do the expansion on the API side, and you'd have to supply it as something like @#{selected... }, which gets back to the problem I have right now.
1431324977
The Aaron
Pro
API Scripter
For that matter, the "which weapon do you use" question is harder to solve. Basically, you need to be able to declare which weapon you're using in such a way that the group-init script is able to know that and apply what it needs to. BTW, you may not realize it, but GroupInitiative was written before there were character sheets... Back then, you just added attributes and used the ones you wanted. That's why it's a bit hard to retro fit it now.
1431325354
vÍnce
Pro
Sheet Author
You could use a query in the bonus. !group-init --bonus @{selected|SurpriseBonus} + ?{WeaponSpeed?|0} I know it only works for an individual or a group as a whole.
The Aaron said: Update 0.8.7 - Added four Announcers to show the results of GroupInitiative None -- Doesn't announce anything Hidden -- Announces all rolls via whisper to the gm(s) Partial -- Announces rolls for PCs to all, but whispers NPCs to the gm(s) (PCs are any character with either All, or at least one non-gm as a controller) Visible -- Announces everything to everyone With the caveat that tokens on the GM layer are always whispered. PCs have a Greenish background, NPCs have a bluish background, GMLayer items have a darker grayish background. Standard Dice highlighting applies and hover shows you the die roll and the total bonus applied. Yay, thanks Aaron!
1431349592
vÍnce
Pro
Sheet Author
The Aaron said: Vince said: The Aaron said: That's applying a bonus using the dice engine, which is actually pretty clever as it knows how to derive the bonus. However, that's only going to work for a single combatant. Bummer. Any way for the --bonus to work for each combatant other than selecting one token at a time? Yes, but not the way you're thinking it would. I'd have to do the expansion on the API side, and you'd have to supply it as something like @#{selected... }, which gets back to the problem I have right now. Is that why it's called GroupInitiative? =-P
1431350420
The Aaron
Pro
API Scripter
Well, the first version of this script didn't even allow for individual initiative scores. It was all about generating the min/max/mean initiative value for a set of tokens.
1431350561

Edited 1431350600
Gen Kitty
Forum Champion
This worked fine before people tried to get all fancy ^_-
1431352547
The Aaron
Pro
API Scripter
You know you like fancy! =D
I like fancy :)
1431357647
The Aaron
Pro
API Scripter
1431383776
The Aaron
Pro
API Scripter
Update v0.8.8 - Fixed the 3+6.06 = 9.05999999999999999 problem. =D (Thanks Ziechael!)
The Aaron said: Yes. It's not built in currently, but it could be. Do you need that? I would need that and love it so much. I would need something like 3d6+10 (individual roll for all selected tokens) (Shadowrun System). That would be so neat - your scripts are amazing! Thank you for your work and time!
1431420668

Edited 1431430380
Ziechael
Forum Champion
Sheet Author
API Scripter
The Aaron said: Update v0.8.8 - Fixed the 3+6.06 = 9.05999999999999999 problem. =D (Thanks Ziechael!) And next up... world hunger... go! Not sure it is connected to this release (but its the only thing i've changed recently) but i'm getting the following errors in a loop when saving: Spinning up new sandbox... Unexpected end of input Restarting sandbox due to script changes... Spinning up new sandbox... Unexpected token . Restarting sandbox due to script changes... Spinning up new sandbox... Unexpected token }
1431430981
The Aaron
Pro
API Scripter
Hmmm... Did it ever start working? Does disabling GroupInitiative let it start up?
1431433507
Ziechael
Forum Champion
Sheet Author
API Scripter
It looks like i've just been hit by the 'unable to connect to campaign' issue so will check as soon as i can!
1431435202
Ziechael
Forum Champion
Sheet Author
API Scripter
Ok, back up and running and can confirm that disabling groupinitiative stops the error loop. Will attempt to debug when i get time but suspect you'll beat me to it...
1431436715

Edited 1431436812
The Aaron
Pro
API Scripter
I don't know, I just got back in the office after being out sick for 4 days... Might be a bit busy... If you want yo PM me a link to you're campaign and GM me, I might jump in and take a look... :)
Because you asked in the other thread: I've tried to make GroupInitiative work more generally, so if you have a case it doesn't work for, definitely let me know so I can fix it. =D It's exactly the called roll per individual. In Shadowrun initiative is based on one initative value which i assume would be !group-init --add-group --Bare initiative But the final iniative is (Iniative+XD6) where the eyes of the dice are summed up. As group iniative only let's me roll one die of a specific size I can only roll 1d6 and add the iniative value or I can apply the bonus as a roll, but as this would lead to the same bonus for each and every character I do not benefit from group-init - I would love be able to roll for all selected tokens with one button press :)
1431877635
The Aaron
Pro
API Scripter
Ok, so how is the X determined? Isn't it Initiative + InitiativeD6?
1431887752

Edited 1431890886
It is Initiative (which is the sum of reaction plus intuition - so a bonus stat group) + XD6, with X beeing a value between 1 to 5. Each character has at least 1 initiative die and can have up to a maximum of 5. There are several augmentations giving your character one or several additional initiative dice.
1431889798

Edited 1431889857
vÍnce
Pro
Sheet Author
I would love for the --bonus to be figured by individual token(even when selecting a group), but I get why it isn't so. I pull the bonus from an attribute that is unique to each token.
1431895016
The Aaron
Pro
API Scripter
I could probably do that, actually. You'd have to type it a bit differently, but I bet I could do it...
1431895748
vÍnce
Pro
Sheet Author
The Aaron said: I could probably do that, actually. You'd have to type it a bit differently, but I bet I could do it... I have my doubts it can be done.
1431895774
vÍnce
Pro
Sheet Author
=-P
1431898117
Gen Kitty
Forum Champion
Vince said: I pull the bonus from an attribute that is unique to each token. What system are you playing that does this and why are you humoring it instead of bending it to your will and making it use 'Initiative' regardless? :>
1431899804

Edited 1431899867
vÍnce
Pro
Sheet Author
GenKitty said: Vince said: I pull the bonus from an attribute that is unique to each token. What system are you playing that does this and why are you humoring it instead of bending it to your will and making it use 'Initiative' regardless? :&gt; Don't hate the playa... I'm playing PF and use Initiative normally but I also like to add the init bonus to the roll(as a decimal). <a href="https://app.roll20.net/forum/post/1908986/#post-19" rel="nofollow">https://app.roll20.net/forum/post/1908986/#post-19</a>...
1431900007
The Aaron
Pro
API Scripter
Could probably add that as an option...