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]

Oh, I thought you already were, that's why I was confused as to why it wasn't working for me...that explains it, I guess! :)
1432448171
The Aaron
Pro
API Scripter
Hahahaha, you guys keep me greatly entertained. =D
1432449657
vÍnce
Pro
Sheet Author
Gozer the Gozerian said: Oh, I thought you already were, that's why I was confused as to why it wasn't working for me...that explains it, I guess! :) I think I changed at least one of my player's ability macros to !group-init but hadn't tried it as a player either. Glad it happened to you first. ;-P lol
1432451382
Gen Kitty
Forum Champion
Gozer the Gozerian said: The reason is really just cosmetic - ever since Aaron got so fancy with the output, I like having their rolls come up in the chat the same as the monsters (I have everything set to Visible). Otherwise, I could (and was previously) using plain init macro. That makes perfect sense! ^_^
I am having similar errors to Greg and Gozer I believe. However, I cannot even get the help text to pop up. When I type in the !group-init --help nothing pops up at all. None of the commands work, in fact.
Kevin, are your scripts disabled? If so, save them, and the sandbox should spin back up. Also, check to see if you're running the latest version (it's hard to keep up with Aaron moving so fast).
1432662288

Edited 1432662353
Gozer the Gozerian said: Kevin, are your scripts disabled? If so, save them, and the sandbox should spin back up. As far as I can tell they are on. When I load up the API console it says Spinning up new sandbox... "-=> GroupInitiative v0.9.5 <=- [Sun May 24 2015 00:18:49 GMT-0500 (CDT)]" I am assuming that it means it is working. Then of course once I go into the actual campaign and attempt a command. Nothing pops up, then I go back out and the API Output Console is giving me an error.
Ok, well you've passed the first layer of tech support. :) I'll have to upsub this for an answer to your question.
Just so you know what I was talking about above. This is what pops up after I go and attempt to input commands.
1432663291
The Aaron
Pro
API Scripter
hmm.. try restarting the sandbox and executing this command: !group-init-config --set-dice-count-attribute|test It looks like it didn't correctly create your state object, this will probably fix it... if not, you can go to line 10 and change schemaVersion = 0.10 to schemaVersion = 1.0 That will force it to rebuild the state object, but you'll loose any existing configuration for GroupInitiative. I'll see about redesigning my checkInstall() to do more validation.
The Aaron said: hmm.. try restarting the sandbox and executing this command: !group-init-config --set-dice-count-attribute|test It looks like it didn't correctly create your state object, this will probably fix it... if not, you can go to line 10 and change schemaVersion = 0.10 to schemaVersion = 1.0 That will force it to rebuild the state object, but you'll loose any existing configuration for GroupInitiative. I'll see about redesigning my checkInstall() to do more validation. Thanks so much! The first command worked after restarting the sandbox, and now all of the other commands are working. Sweet!
1432663907
The Aaron
Pro
API Scripter
Great! =D Definitely let me know if you run into any other issues. =D
1434425967
The Aaron
Pro
API Scripter
Update v0.9.6 -- Fixed bug with default installed state for fresh script use (Thanks Joseph l.!)
Hm....only 4 more updates to version 1.0!
1434459887
The Aaron
Pro
API Scripter
Ha! I could go to v0.10.0...
1434461713
vÍnce
Pro
Sheet Author
Tease.
Vince said: Tease. Right, i'm still waiting for the new Turntracker and CharMod and .... and The Aaron is just fixing bugs that only Joseph cares about. :)
1434465244
The Aaron
Pro
API Scripter
Ha! I've got a little script to write for you, too! The more scripts you have written, the more time it takes to support them, and the more you wish you'd done something different with them to begin with. =D I'll get there, eventually. =D
The Aaron said: Ha! I've got a little script to write for you, too! The more scripts you have written, the more time it takes to support them, and the more you wish you'd done something different with them to begin with. =D I'll get there, eventually. =D Haha for sure :) Feel free to write me a character importer/exporter first.. :) Mark is all bogged down with vacation and stuff :) This guy really needs to reevaluate his priorities.. I mean sheesh.
1434466835
The Aaron
Pro
API Scripter
HA! I usually find that vacations are more work than working. =D
The Aaron said: HA! I usually find that vacations are more work than working. =D Oh man, that is so true. I guess thats the issue with desk jobs eh? The real work of life is quite a bit more intense than office work.
1434487355
The Aaron
Pro
API Scripter
Indeed! =D
1434873844

Edited 1434874908
Kryx
Pro
Sheet Author
API Scripter
I only worked a little on vacation. ;) Aaron, I started using this script on my 5e shaped sheet, but it looks like it is having issues with nested inline rolls in the character sheet. /home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1 orts, require, module, __filename, __dirname) { function g(a){throw a;}var j=v ^ SyntaxError: Expected "]" or [^\]] but end of input found. I am using initiative_overall|current Code for that: <input " type="number" name="attr_initiative_overall" value="(@{dexterity_mod} + @{initiative} + @{jack_of_all_trades})" disabled="disabled"> Dex <input type="number" name="attr_dexterity_mod" value="[[floor((@{dexterity}-10)/2) + @{dexterity_bonus}]]" disabled="disabled"> <input type="number" name="attr_dexterity" min="1" step="1"> Init Bonus <input type="number" name="attr_initiative" value="0" step="1"> Jack of All Trades <input type="checkbox" name="attr_jack_of_all_trades" value="floor(@{PB} / 2)"> <input name="attr_PB" value="[[(2 + floor(abs((@{level}-1)/4)))]]" disabled="disabled"> Level goes on for a while, but I doubt it'd add more info. Same issue if I use dexterity_mod|current Any reason why it wouldn't work? Shouldn't the value of "initiative_overall" or "dexterity_modifier" already be calculated and the API able to call it? dexterity|current works fine btw
1434900037
The Aaron
Pro
API Scripter
Nested inline rolls don't work in the API on prod yet. The fix is on Dev currently and being tested. I hadn't considered they would be used in stats this way, but that makes sense. I could write code to unroll all of them on prod, but I'm hesitant to do that with the impending fix...
1434917544
Kryx
Pro
Sheet Author
API Scripter
Thanks for the quick reply, Aaron! Any idea on the timeframe of the feature being tested and pushed to prod? Are we talking weeks, months, many months? If it's super long then a script fix would be quite nice. Though I'm unsure how long a fix would take you - I'm guessing 1-3 hours? I could also work around it on my by adding the calculated formula myself to the script (would be quite messy).
1434918196
The Aaron
Pro
API Scripter
Timeframe is indeterminate. It's been on dev for a long time. It seems to me that it's really slow to process the rolls, as in "did the API crash?" slow. It's a good question for Riley. Adding nested expansion would be fairly difficult. Instead of passing each roll off to sendChat() with the attributes in it, you'd have to pull the value of each attribute and substitute it in recursively until you run out of attributes (God forbid there are any cycles btw!). Then you'd need to pull out the deepest nested roll and send that to sendChat() then sub in the result to the next inline roll upward and do it again. Rince-repeat until you're out of rolls. And you need to do that for each selected token. It would be very complex to manage and tedious to write, and would likely be very slow. It's all behind the scenes work, so 3-4 hours uninterrupted time would probably be enough time. I'd rather wait for the nested inline roll support though. Should probably follow up with Riley about it...
1434919393
Kryx
Pro
Sheet Author
API Scripter
Agreed - check with Riley. It would be a large pain to fix on the chat command side as well. Depending on the response from Riley I could probably write an unwrapper if I get enough motivation. Though based on what you wrote it'd likely take me ~8 hrs.
Greg B. said: Vince said: Tease. Right, i'm still waiting for the new Turntracker and CharMod and .... and The Aaron is just fixing bugs that only Joseph cares about. :) Well, Joseph and his players are very happy with the results, so nanny nanny boo boo. /rasberry Now if only I could get the blood spatter API to work......
1434943608
The Aaron
Pro
API Scripter
Hahaha! Blood splatter does seem to be a bit fickle. PM me if you're still having issues with it tomorrow and maybe I can jump in and take a look at it. ;)
1434959353
Kryx
Pro
Sheet Author
API Scripter
I have no issues with BloodAndHonor. It works quite nicely and is one of my favorite scripts.
Exactly how would I set Group initiative to use dexbonus as a group modifier, also if it is not set will "GI" treat it as a zero or crash? I recently upgraded to V9.6 and have managed to crash the API pretty regularly. I love the features, like announce, open tracker, and sort tracker, but I am rubbish with these things...
1434985299
The Aaron
Pro
API Scripter
You can add a group with the dexbonus attribute like this: !group-init --add-group --Bare dexbonus If they don't have the dexbonus stat, it *should* proceed on to the next rule and assume 0 if no other rules match. If it doesn't (and particularly if it crashes!) then that's definitely a bug and I'll fix it. I'll do some testing on it tonight to make sure. I need to update the way you add groups now that we have API buttons. You can see the list of groups with: !group-init --help If you need to remove one of the groups, you can use it's index number to remove it: !group-init --del-group 1 If you want to move a group up, you can use: !group-init --promote 2 Let me know if you have any problems, I can jump in an configure it for you! =D
It pretty much crashes every time I use it, deleted, hoping I have a copy of the old v3.0 somewhere. It could be the other scripts, blind roll, door control, blood and honor...
1434986384
The Aaron
Pro
API Scripter
Bummer! If you want to invite me, I'll figure out the problem and fix it. You can access different versions of it here: <a href="https://github.com/shdwjk/Roll20API/commits/master/GroupInitiative/GroupInitiative.js" rel="nofollow">https://github.com/shdwjk/Roll20API/commits/master/GroupInitiative/GroupInitiative.js</a>
1435014865
vÍnce
Pro
Sheet Author
Thanks for the update Aaron. The API buttons are the bomb. Much more user friendly. Is it possible to include tipsy info for API buttons? Just asking. Since I'm on a roll here... wouldn't it be cool if the avatars could be shown in chat by the order of their initiative. Highest to lowest, or lowest to highest depending on the Sort Options flag. Haven't been able to break this version yet. Still trying.
1435017701
The Aaron
Pro
API Scripter
Pretty sure tipsy is an option for API buttons, what did you have in mind? I can do that sort option.
1435027316

Edited 1435027380
vÍnce
Pro
Sheet Author
Nothing in particular. I just instinctively hovered over the buttons that had multiple options to see if there was more information about what the button did. Some buttons might be obvious, while other's not so much. I used the top of this thread to find find out the details, but it could have easily been available with a quick mouseover. This might be handy for other scripts as well. BTW: I'm very content with the current version of group-init. No need to change a thing.
1435027600
The Aaron
Pro
API Scripter
=D Well, you know that probably won't stop me from making improvements at some point.. I'm not real happy with the way the rule creation works and I'd like to be able to specify some other ways for things to apply (apply this rule if a character has a 1 in the npc attribute, but don't add one to it!).
1435232276

Edited 1435232306
It would be really cool, if you could add the feature to add/substract INI from all selected tokens like !group-init --add -10 This would help shadowrun GM's like me a lot. And thank you for the implementation of the initiative dice attribute, this works wonderful.
1435235438
The Aaron
Pro
API Scripter
You're just talking about reducing all the selected token's initiative's by some number, not rerolling them, right?
Exactly.
1435237155
The Aaron
Pro
API Scripter
That's very doable. I'll see if I can get that rolled in soon.
Thank you!
1435404416

Edited 1435405953
There also seems to be a nasty nasty bug somewhere. For nearly all of my tokens the API crashes on !group-init with the following error message. Die Size = 6, Die Count = 1, Dice Count Attribute ini_dice (i am able to verify with @{selected|ini_dice that the attribut exists. Max decimal places=2, replace roll= on, roller = individual-roll, bonus stat groups=ini_basis|current. Edit: It seems to have problems with auto calculated fields. I just wonder why it works for some tokens. Shouldn't it crash always? For reference, the error message generated was: /home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1 orts, require, module, __filename, __dirname) { function g(a){throw a;}var j=v ^ SyntaxError: Expected "]" or [^\]] but end of input found.
1435422365
The Aaron
Pro
API Scripter
Do your auto-calculated fields have Nested Inline Rolls? Looks like the same error Mark was getting ( look up 6 days ago ) with his Nested Inline Rolls. Nested Inline Rolls are not supported in the API yet (but that change is coming soon, it's on Dev right now). Sorry!
1435423186
Kryx
Pro
Sheet Author
API Scripter
Any idea if nested inline rolls for the API are going to be launching at the same time as the mobile changes that support inline rolls?
1435423800
The Aaron
Pro
API Scripter
I don't know about them coming together, but the API one seems like it will be out soon enough that righting a parser for it shouldn't be required.
1435423889
Kryx
Pro
Sheet Author
API Scripter
Ya, no worries about writing a parser. Using your script will really help me start encounters. Hopefully soon!
Do your auto-calculated fields have Nested Inline Rolls? Just to get it right: [[@{a}+@{b}]] would not be allowed but @{a}+@{b} would be. Do I require the [[ ]] at all?
1435505087
The Aaron
Pro
API Scripter
In this case, you do not. Years of writing C preprocessor macros makes me want to suggest using: ( (@{a})+(@{b}) ) as it won't get messed up when you expand attributes.