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

Maelstrom Initiative help request

1551552722

Edited 1551559726
Hello all, I am interested in using a set of homebrew rules for initiative called Maelstrom Initiative. I would need a macro that would roll three initiatives for a token selected and then add those to an initiative tracker.  The player/DM would choose from a choice of "Actions" each round, and the macro would add that choice to the tracker, as well as two more - a bonus action and a move action. The turn tracker would sort initiatives from the rolled values of the least to the greatest. Because the macro would both wait for an input of an "Action", as well as automatically add a Move Action as well as a Bonus Action, I wasn't sure how to script this myself. Any advice? Action choices and initiative rolled (Declared at beginning of round, reevaluated if need be)     Dodge (cannot be reevaluated) Initiative 0     Disengage, speak (d4 - (Initiative Modifier/2 round down)) minimum 1     Light weapon attack, dash, use an object (d6 - (Initiative Modifier/2 round down)) Minimum 2     Cantrip or Regular Weapon ((d6  - Initiative Modifier/2 round down)) Minimum 2     Spell (d8 + spell level  - (Initiative Modifier/2 round down)) Minimum 2     Heavy Weapon ((d10  - Initiative Modifier/2  round down)) Minimum 2 Other Actions   (always roll both of these)     Bonus action (d4  - (Initiative Modifier/2)) Minimum 2     Move Action (d6  - (Initiative Modifier/2)) Minimum 2
1551585791
The Aaron
Roll20 Production Team
API Scripter
That’s gonna be 100% API if it’s anything. 
Oh.  I was hoping that it would not be a difficult or time consuming thing...
1551599918
GiGs
Pro
Sheet Author
API Scripter
You could probably do much of this with API buttons printed to chat (doesnt need API scripting). Have a macro that prints a button for each option to chat. Players click the button, and its macro runs - which adds that action, the bonus action, and the move action to the tracker (btw do they really all have different initiative scores?) You can then sort the tracker manually, once everyone has added their actions. 
1551601639

Edited 1551602457
GiGs, yeah what you said is what I had in mind. Yep they will have three different initiative scores each round - an Action, Bonus Action, and a Move Action.  I can pull off writing the API buttons, but I'm not sure how to give a single token, three different initiatives in the turn tracker.  I would want each initiative to be labeled with the token name followed by the name of the Action such as Merlin: Bonus Action.  Would this require API scripting or is there a way that someone might know how to do this?
The Aaron said: That’s gonna be 100% API if it’s anything.  Aaron, would you know if it is possible to grant a token three different initiatives within the turn tracker without API scripting, is that what what you were referring to as needing scripting...?
1551603449
GiGs
Pro
Sheet Author
API Scripter
Barry S. said: GiGs, yeah what you said is what I had in mind. Yep they will have three different initiative scores each round - an Action, Bonus Action, and a Move Action.  I can pull off writing the API buttons, but I'm not sure how to give a single token, three different initiatives in the turn tracker.  I would want each initiative to be labeled with the token name followed by the name of the Action such as Merlin: Bonus Action.  Would this require API scripting or is there a way that someone might know how to do this? Ah yeah, I was thinking of adding Custom Items with names like CharacterName - Move, CharacterName -Bonus, etc., but I forgot to cant add custom items from a macro without using the API.
1551625723
The Aaron
Roll20 Production Team
API Scripter
It isn’t possible to add a token to the initiative more than once without the API  further, you can’t add tokens with different names. You can do all of what you want with a collection of api command Buttons (great idea GiGs) and my AddCustomTurn script. Barry S. said: The Aaron said: That’s gonna be 100% API if it’s anything.  Aaron, would you know if it is possible to grant a token three different initiatives within the turn tracker without API scripting, is that what what you were referring to as needing scripting...?
The Aaron said: You can do all of what you want with a collection of api command Buttons (great idea GiGs) and my AddCustomTurn script. Aaron,  sounds like we have a winner! I did a search both in the Wiki as well as the API script library and didn't see your solution.  Would you mind letting me know where I may find your AddCustomTurn?
1551633130
The Aaron
Roll20 Production Team
API Scripter
Here's a post with it:&nbsp;<a href="https://app.roll20.net/forum/post/6198383/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/6198383/slug%7D</a>
thanks :)
The Aaron said: Here's a post with it:&nbsp; <a href="https://app.roll20.net/forum/post/6198383/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/6198383/slug%7D</a> Aaron, your solution works great! Thank you very much.&nbsp; I tried to implement an API button to post several "actions" at once and it only added the first initiative roll to the three initiatives posted on the tracker. !act -0 --***@{target|character_name}*** Dodges Action !act -[[1d4]] --***@{target|character_name}*** Bonus Action !act -[[1d6]] --***@{target|character_name}*** Move Action Do I need to make different buttons to handle the three "actions", or is there a way to make the above work in one "button"? Barry
1551640140
The Aaron
Roll20 Production Team
API Scripter
This should work (Separate the API commands with &amp;#13; which is a carriage return): [Thing](!act -0 --***@{target|character_name}*** Dodges Action&amp;#13;!act -[[1d4]] --***@{target|character_name}*** Bonus Action&amp;#13;!act -[[1d6]] --***@{target|character_name}*** Move Action) Note that that's going to roll the 1d4 and 1d6 as part of creating the button, not when the button is clicked.&nbsp; Worse, it's going to do the target selection when you create the button, not when you push it. To get those things to happen on click, you have to HTML escape all the things. (The @ sign in the target calls and the [ in the rolls, etc)&nbsp; Easier and probably better would be to put all of that in a Macro Character &nbsp;Ability and then use an Ability Command Button instead: Ability: !act -0 --***@{target|character_name}*** Dodges Action !act -[[1d4]] --***@{target|character_name}*** Bonus Action !act -[[1d6]] --***@{target|character_name}*** Move Action Ability Command Button: [Thing](~Maelstrom|dodge)
The Aaron said: Hey Aaron, I've tried a few different ways to do this and splitting up the API buttons seems to hold the most promise for me.&nbsp; This is my current config with this being my API button: &amp;{template:npcaction} {{rname=Move Action}} } {{description=Choose an option to be used for your ACTION : [***Move Action*** - Minimum initiative 2](! #MaelstromInitiative-Move)}} ...and this being my "Move Action" API button. !act -[[1d6-(floor(@{selected|initiative_bonus}/2)), 2 + 0d0}kh2, 30 + 0d0}kl2 ]] --***@{selected|character_name}*** Move Action However, the tracker seems to always have an initiative of zero posted.&nbsp; Do you see a scripting error by chance? I am wishing for it to roll 1d6 - initiative bonus with a minimum calculated of 2, maximum of 30. (The max of 30 is for other actions but I am putting it here to be sure I am scripting it correctly...)&nbsp; Lastly, how can I also place a "tie breaker" addon into the calculation? Thank you Scriptomancer! Barry
1551654212
The Aaron
Roll20 Production Team
API Scripter
Yeah, there are two numbers after !act.&nbsp; The first is the rate of change, the second is the initiative. !act -1 10 --Label Will create something with an initiative number of 10, which decrements by 1 each time it comes up in the turn order, and is named "Label".&nbsp; You probably want: !act 0 -[[1d6-(floor(@{selected|initiative_bonus}/2)), 2 + 0d0}kh2, 30 + 0d0}kl2 ]] --***@{selected|character_name}*** Move Action
1551658172

Edited 1551659218
... Still rolling a zero in the tracker Upon a second look at the screen capture, it appears to be rolling some sort of initiative and placing it to the left of the character name, while placing a ZERO where the initiative normally goes... When I run the dice roll in the chat window it works fine except there is no minimum.&nbsp; I had expected a minimum of 2 of course...&nbsp;&nbsp; [[1d6-(floor(@{selected|initiative_bonus}/2)), 2 + 0d0}kh2, 30 + 0d0}kl2 ]] NO rush.&nbsp; It's a Sunday. :D
1551665103
The Aaron
Roll20 Production Team
API Scripter
You probably want kh1 and kl1.&nbsp; You only want a single value, not a group of values.&nbsp; I'll try to take a look soonish...
The Aaron said: You probably want kh1 and kl1.&nbsp; You only want a single value, not a group of values.&nbsp; I'll try to take a look soonish... Hey Aaron, I made the correction you suggested, and it did improve the format of what is being sent to the tracker, but it is still only generating a Zero for initiative, as oppose to a minimum 2, or any other initiative value... !act 0 -[[1d6-(floor(@{selected|initiative_bonus}/2)), 2 + 0d0}kh1, 30 + 0d0}kl1 ]] --***@{selected|character_name}*** Move Action Cheers, Barry
1551674213

Edited 1551674240
GiGs
Pro
Sheet Author
API Scripter
I'd suggest testing that roll just as a roll in chat, without using the script, to make sure there's nothing up with the syntax. Like /roll 1d6-(floor(@{selected|initiative_bonus}/2)), 2 + 0d0}kh1, 30 + 0d0}kl1 But I can see one issue: you have }kh1 and }kl1 , but dont have any matching { for either of them,&nbsp;
1551674652

Edited 1551674830
GiGs
Pro
Sheet Author
API Scripter
I think &nbsp;it should be [[1d6-{{floor(@{selected|initiative_bonus}/2)), 2}kh1, 30}kl1 ]] The 0d0 is only needed if its being paired with a dice roll; in this case they are just numbers. I'm not sure what the purpose of 30 is there, how are numbers ever going to be big enough to need it? Especially when you are rolling d6 minus something, with a minmum of 1 or 2 - it's completely irrelevant. In fact all your init mods in the original post seem weird: &nbsp;&nbsp;&nbsp;&nbsp;Disengage, speak (d4 - (Initiative Modifier/2 round down)) minimum 1 &nbsp;&nbsp;&nbsp;&nbsp;Light weapon attack, dash, use an object&nbsp;(d6 - (Initiative Modifier/2 round down)) Minimum 2 &nbsp;&nbsp;&nbsp;&nbsp;Cantrip or Regular Weapon ((d6&nbsp; - Initiative Modifier/2 round down)) Minimum 2 &nbsp;&nbsp;&nbsp;&nbsp;Spell (d8 + spell level&nbsp; - (Initiative Modifier/2 round down)) Minimum 2 &nbsp;&nbsp;&nbsp;&nbsp;Heavy Weapon ((d10&nbsp; - Initiative Modifier/2&nbsp; round down)) Minimum 2 With just an initiative modifier of just 1:&nbsp; Like, d4-1 minimum 1 means half the results are going to be 1. d6-1 minimum 2 means half of all results are going to be 2. With this system, you are going to end up with a LOT of ties. If initiative ever goes higher than 1, you get even more ties. Is that intended, and how are you going to handle tiebreaks to sort the characters ?
1551683620

Edited 1551683767
Hey GiGs, Thanks for the suggestion but that didn't seem to work for me .&nbsp; As for why I have it max at 30, I had simply copy/pasted a min/max from something else. It is only the minimum that I am concerned with.&nbsp; As for ties, I am interested in a tie breaker - I just haven't gotten that far yet... My thought would be to add something at the end of the calculation that would somehow tie it the initiative bonus, maybe as a decimal added to the calculation... I downloaded this system from a homebrew resource page. My players and I simply wish to explore it.&nbsp; That is why I am trying to make it work. Thanks and cheers, Barry
1551683873

Edited 1551684009
GiGs
Pro
Sheet Author
API Scripter
For tiebreakers, using another stat as a decimal is the way I've seen it done. I noticed an error in my formula, I had an extra bracket. I also didnt include the d6 in the kh1 calculation, which was an error, so you do need the 0d0 after all. Try this: [[{1d6-floor(@{selected|initiative_bonus}/2), 2 + 0d0}kh1 ]] remember to test it in chat first, before using it with the script. If you were using, say, a dex score as a tiebreaker, you could do it like so: [[{1d6-floor(@{selected|initiative_bonus}/2), 2 + 0d0}kh1 + @{selected|dex}/100]]
GiGs said: If you were using, say, a dex score as a tiebreaker, you could do it like so: [[{1d6-floor(@{selected|initiative_bonus}/2), 2 + 0d0}kh1 + @{selected|dex}/100]] Thank you Gigs! That works nicely. I also removed the "minus" sign that was located before the beginning brackets, and between that and the changes you and Aaron suggested, it now works properly.&nbsp; I may tweek the dice roll so that minimum rolls do not come up so often, but at least it works. !act 0 [[{1d6-floor(@{selected|initiative_bonus}), 2 + 0d0}kh1 + @{selected|dexterity_mod}/100]] --***@{selected|character_name}*** Move Action THANK YOU Aaron and GiGs! Barry
1551722061
GiGs
Pro
Sheet Author
API Scripter
Great!