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

TurnMarker and GroupInitiative not quite working together

1455058142
Lucian
Pro
API Scripter
Hi, I've just been rebuilding my campaign to use the new Shaped 5e sheet, and in the process I've cleared out all the scripts and started with the latest versions from the repository. I've noticed that the latest version of TurnMarker and GroupInit don't quite work together as they should. If you select a bunch of characters with the initiative tracker closed, and run !group-init, everything works as expected, *except* that the turn marker doesn't get set on the top token in the initiative order until the first time the turn order is moved on. Also, the first turn doesn't get announced properly either (presumably the same underlying problem).  Looking at the code, it seems like TurnMarker registers an observer on GroupInit, presumably because the API-based changes that GroupInit makes don't trigger the relevant change events for TurnMarker to pick up. This observer is getting called correctly, but for some reason all it does is to ensure that the "pr" value for the turn marker is set to -1 if it isn't already (presumably to compensate for people accidentally changing initiative for the marker itself somehow). It seems like this function should probably also be calling TurnMarker.Start() as well somewhere, but I don't understand it well enough to know if that will have other unintended consequences (and would require GroupInit to notify observers *after* showing the initiative order to work correctly, since Start just returns if the initiative order isn't showing). While I'm posting on the subject, is there a neat way to have the initiative order cleaned out before rolling it with !group-init? At the moment it seems like I have to do that manually if there are still unwanted entries from a previous combat in the tracker... but perhaps I'm missing something? Cheers, Lucian
1455058251
The Aaron
Pro
API Scripter
Which versions are you using of each?
1455058573
The Aaron
Pro
API Scripter
I'm showing the current versions as: "-=> GroupInitiative v0.9.15 <=-  [Sun Jan 31 2016 14:31:58 GMT-0600 (CST)]" "-=> TurnMarker v1.3.1 <=-  [Tue Oct 13 2015 08:17:46 GMT-0500 (CDT)]"
1455060654
The Aaron
Pro
API Scripter
Fixed. &nbsp; TurnMarker1 will now pop to the first person in the turn order once GroupInitiative Rolls. &nbsp;It will also now announce the Player Turn (if you have that option enabled) when it comes up. GroupInitiative now has an --clear option to clear the turn order. &nbsp;If you have Auto Open Init enabled, --clear will close the turn order box automatically. !group-init --clear GroupInitiative v0.9.16 Git: <a href="https://github.com/shdwjk/Roll20API/blob/master/G" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/G</a>... TurnMarker1 v1.3.2 Git: <a href="https://github.com/shdwjk/Roll20API/blob/master/T" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/T</a>...
1455092259
Lucian
Pro
API Scripter
In the depths of night, the bugs start to emerge in Javascript Forest; they think they're safe now that the sun has gone down. Little do they suspect that the Arcane Scriptomancer prowls these woods. Within moments of emerging from their hiding spaces, their squirming ends with a crunch as they meet the inescapable doom of his terrible Bug Hammer.&nbsp; All Hail the Power of the Scriptomancer!
1455105835
The Aaron
Pro
API Scripter
Hehehehe. They don't stand a chance. :)&nbsp;Let me know if any more crept in there. Happy Rolling!