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

Turn Order

I've spent most of today trying to figure out how to do something Roll20 wasn't intended to do but I'm quite convinced that it's perfectly doable.  It seems like I'm SO close but, alas, I just can't figure out the last step(s). I'm trying to create a game that uses a similar system to Final Fantasy Tactics for determining turn order (Every "tick", add your "Speed" to your action bar until your action bar equals or exceeds some threshold).  I've figured out how to get everyone's token into the Turn Tracker using GroupInitiative and I've figured out how to modify A token's "initiative".  BUT, doing that one at a time for each "tick" is going to be time-consuming and tedious.  I just found a video that will go through all selected token's stats to perform individual actions but, what I can't figure out is how to automate that by selecting all of the tokens through the Turn Tracker list and look up each token's "Speed".  Obviously, the Turn Tracker knows which token is where in the list; if you mouse over a token in the list, Roll20 highlights that token.  How do I pull that identifying information from the list into an array?  IS that doable?  My thought is, then I can run GroupInitiative's adjustment on each token using its Speed and then sorting the list after the entire array has been adjusted. Thank you for your assistance! :D
1592526350
The Aaron
Roll20 Production Team
API Scripter
I actually joined someone's game one time where they had a whole system set up for that.  Super complex and time based with countdowns as the turns and such.  Very wild. You can definitely do some things via the API.  I'd probably suggest purpose building something.  Can you break down the exact process of events you foresee for this, not considering any scripts.
The test game I'm setting up has players with a Speed of 60, Kobolds with a Speed of 50, and Hobgoblins with a Speed of 55. To help alleviate ties, my idea is to roll a die and add it to each token's Speed and put that into the Turn Tracker and sort in Descending order (I've figured this part out). While both sides have at least one token standing (technically not required yet):     While no token has a total greater than or equal to 1,000 (I'm fine with checking this manually and hitting a macro button over and over though I suspect that won't be necessary as I think I saw a way to check the top value):         Add each token's Speed to their total in the Turn Tracker (I only know a way to do this one at a time but this is the part I need help with)     The highest total takes their turn and subtracts 1,000 from their total. (Again, I think I know how to do this.)     The system would then check if anyone else is at or over 1,000 total and the next highest person would take their turn until no one is over 1,000 (or equal to it).  (I think I'm all set here.)     This process would continue until all of one side was defeated (not necessary but it is an ultimate goal--EVENTUALLY, the baddies will be AI-controlled [draw a card and do the thing]). So, to put numbers to it: Start of combat: Add Players 1, 2, 3; Kobolds 1, 2, 3; and Hobgoblins 1, 2 to the Turn Tracker using GroupInit.  Starting values will be something like: Player 1:  62 Player 2:  65 Player 3:  61 Kobold 1:  57 Kobold 2:  55 Kobold 3:  55 Hobgoblin 1:  58 Hobgoblin 2:  65 Then GroupInit sorts the Turn Tracker in Descending order. No one is over 1,000 so the first "tick", everyone adds their respective Speed (60 for Players, 50 for Kobolds, and 55 for Hobgoblins).  Now, the Turn Tracker shows: Player 1:  122 Player 2:  125 Player 3:  121 Kobold 1:  107 Kobold 2:  105 Kobold 3:  105 Hobgoblin 1:  113 Hobgoblin 2:  120 Still no one is over 1,000 so another "tick" occurs and everyone adds their Speed again so on and so forth.
1592723714

Edited 1592724161
I've got it!  The one piece I'm missing is running a token/character macro from an API.  And it would be helpful to know how/if the TokenMod API can read values from the bars?