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] TurnMarker1 - Turn Token Highlight, Round Counter, Player Advance Command, Turn Announce + spiny graphics if you want them!

1404264061
The Aaron
Roll20 Production Team
API Scripter
Yup. That's what it uses for the rotation counter, which also controls the offset for the sine and cosine waves being used to pulse the auras in and out. =D You might have to toggle animations off if you have problems setting the round counter. In future versions, I'll probably change that to a variable internal to the TurnMarker object. =D
So now I'm getting an error that says: Infinite loop or long running process detected. I haven't changed anything and it was (obviously) working yesterday. Now it's not. o.o
1404345518
The Aaron
Roll20 Production Team
API Scripter
Try it again.. something about the sandbox causes that to happen at times. It's a known issue that Dev is aware of.
1404361349

Edited 1404361369
Naz
Pro
Hey Aaron, I tried out this script and loved it, but setting it up appears to break the Monster Hit Die rolling script you wrote for me not too long ago in this thread. With the Turn Marker and GM script installed the Hit Die script did not work. I deleted the Turn Marker and GM script and it worked again. Any ideas?
1404363199
The Aaron
Roll20 Production Team
API Scripter
hmm... nothing pops to mind. What breaks about the Hit Dice script? Do you get an error, or it just doesn't do anything?
It doesn't roll the hit points. No error pops up on the table, is there some place I need to look for a log?
1404364228
The Aaron
Roll20 Production Team
API Scripter
In the api script area, at the bottom in API Output Log
Ok, l'll set them up again sometime tomorrow and let you know how it goes. Thanks for the replies.
1404364723
The Aaron
Roll20 Production Team
API Scripter
no worries. Thanks for trying my scripts!
1404488940
Pat
Pro
API Scripter
Aaron, Holy Crap! Amazing script - great job. I'd like to ask about the feasibility of a change to support Savage Worlds (SW). In SW, you use playing cards for initiative and you have to deal a new hand every round. In the current implementation, once the last player (Prospero) finishes their turn, the Round Counter (Round 9) displays and then moves on to the init at the top of the list. (Ellisandra) I'm asking for an option to start/stop the script between rounds so I can do my GM stuff before the next init is sent to chat. Here's a visual. To summarize I think I need a script config option to turn on this "pause at the end of round" mode and a new chat command to un-pause the script until the next end of turn event. Without this, the script still works fine, but I end up advancing the round counter when I re-deal and re-sort with the script active. No problem if this is too much work - I can definitely make the current state of the script work. Again, I really appreciate your hard work on this. Pat.
I am having issues getting this script working. I have this script, your isGM script, and your Carry Token script saved in my API Enviroment. However it keeps telling me that I need the isGM Module.
1404496045
The Aaron
Roll20 Production Team
API Scripter
@Pat, Thanks for the praise. I think I can add an option for you that will make this easier. If I understand correctly, would it work to have it announce the next round, but then not advance to the next turn order? @Austin B. I'm not sure what would cause that. Is it possible you could PM me with an invite to the campaign, and GM me so I can look at the scripts and debug it?
1404499741
Pat
Pro
API Scripter
Aaron - Correct, announce the next round, but then not advance to the next turn order. Thanks again.
1404561086

Edited 1404561218
as long as you're updating (and that sounds like a good idea to have an option to pause, I would use it myself now that I think about it - perhaps have an option to pause on the roundmarker at the start of the round instead of jump straight over it while the GM catches up on his bits.? not why i posted, but +1 anyway...) My suggestions: First : a tag that lets you populate the turn order in bulk, based on selected tokens, and possibly roll initiative based on options set through your script. . (ie !tm add ) optionally, also add a tag that removes selected tokens from the order with something like !tm remove ) Second : a tag that lets you set the formula for rolling initiative (ie !tm roll ( [[1d20]]+@{Initiative_Bonus}+@{Dexterity} ) , possibly by using an array to pull those stats into the script to roll automatically when using the add command; I only use the @{stat} to provide a sense of familiarity to possible users, other formats would likely be easier to code. a die roll will not always be necessary, for example, the gurps ruleset uses a flat number every time, with no roll at all, and conversly sometimes no stats are needed, as when playing basic dnd. Third : a tag that lets you depopulate the turn order easily (ie !tm clear ) Fourth : a tag that can be added to a !tm command that opens and closes the turn order. (ie. !tm start and/or !tm end ) Fifth : allow the command line to combine tags to do any combination of commands from one execution (ie. !tm add start or !tm remove end ) Edit: another option for possible ease of use: an option that lets the turn order open and close automatically based on if there are any tokens currently populating it.
1404571316
The Aaron
Roll20 Production Team
API Scripter
I got Austin's issue resolved this morning, and picked up a few bug fixes to my script which will be in the next version. @Michael H: Wow, that's a bunch of ideas! Thanks for the input, I'll see what I can't do to pull in as many of those as make sense. =D Bulk Add Turns -- This is very easy and doable. Set formula for Rolling Initiative -- That's a bit more complicated. If you specified a string in inline dice format, the chat system will parse it into the results for you. Ditto the @{<stat>} format. So, you'd either need an alternate format, or you'd need to parse the inline rolls and reconstruct the original format... hmm.... this one's going on the back burner for the time being.. Clear Turn order -- Also easy and very doable. Pop open/closed the Turn Order -- This is pretty easy to do. Combining Tags on the Command Line -- Also very plausible, but I'll need to go through and make sure what makes sense to combine, and work on the argument parser. (which I'm doing anyway.. =D)
Looking forward to seeing the updates on this. All of my players love this. I think the only downside is that it's very difficult to grab onto a token which has the animation around that token. So, I can't grab everyone in a group because of that yellow triangular token. It does seem like that it enjoys to start "infinite loop process" -- however, disabeling and re-enabling the scripts before every game does fix this. :)
1404577423
The Aaron
Roll20 Production Team
API Scripter
Yeah, that infinite loop thing is annoying. Happens less without the animations, but still can happen. =/ I'm hoping they tighten up the API servers a bit with regard to that...
1404666505

Edited 1404675155
Naz
Pro
I finally got a chance to try this script again and my issue with it affecting the HitDie script you made for me to auto roll mob hit points when their token is added to the map has gone away, if it ever did actually exist :-) However, I'm having an issue with the turn marker script. I always clear the turn tracker after a combat and close it to free up the screen space. Then I get the following behavior from your script. As indicated above, the tracker token has been reset to round 0 and the turn tracker has been completely cleared. I now open the turn tracker to indicate to everyone that it is time to roll initiatives. However, as soon as the tracker opens the script adds the tracker token and immediately announces Round 1 and round 2. The tracker token in the initiative list does indeed say round 2 and initiative of -1. It would make more sense for it to announce round 1 if anything. I can get things set correctly once everything is loaded into the tracker but the chat is gummed up with a bunch of erroneous messages. My preference would be that in the above situation, the script would not announce anything when the tracker is opened and the turn tracker token be loaded and set to a high initiative (say 99). Then the players would add their initiative rolls to the tracker, I would sort the initiatives, the tracker token should be first with a 99, and I hit the button to advance initiative past the turn tracker token to the first regular token and the script would announce round 1. The only way I can get the script to act the way I prefer is to have everyone roll initiatives before I open the tracker. If this procedure is used it works like a charm. Also, I'm notorious for forgetting to reset the tracker token so an option to have the tracker token automatically reset when the script loads it to the turn tracker would be awesome. I suppose it's more likely than not that I am doing something wrong. If so let me know. Edit: The toggle-announce-player command doesn't seem to be working. Whether toggled on or off the player is announced.
1404673486
The Aaron
Roll20 Production Team
API Scripter
Wow Aladar, great feed back! I'd been puzzling over how to handle that starting round problem and I think you've given me exactly what I needed to figure out a solution. :) As for the toggle-announce-player, I'll have to look into it. You're certain it's the announce players and not the announce turn?
Yes, it's the toggle-announce-player that doesn't seem to do anything.
1404680245
The Aaron
Roll20 Production Team
API Scripter
Ok. I updated the gist above to fix the player announce. More to come!
Hi, me again. regarding the idea for rolling initiative using that formula. that does not have to be the layout for input, entirely. !tm roll ( [[1d20]]+@{Initiative_Bonus}+@{Dexterity} ) , could be expressed as several commands: !tm setdice "1d20", followed by !tm setroll "Initiative_Bonus" + "Dexterity", which sets the stats that need to be pulled for the initiative rolls to be based on, to be used by your script. similar to how this script uses a string to pull information to calculate initiative: <a href="https://app.roll20.net/forum/post/207066/script-au" rel="nofollow">https://app.roll20.net/forum/post/207066/script-au</a>... only being able to set the values in game using your menu.
1404694233
The Aaron
Roll20 Production Team
API Scripter
TurnMarker.on('start',function(obj){ var Priority = 0; // get attributes // roll dice // adjust Priority return Priority; }); Yup, I know it's doable. It's more a question of practicality and generalization. I'd be more likely to add a method of having an external API script provide the details of the roll via a registration system. (See above: sorry, can't seem to make code blocks below text from my phone. )
I hope this script is in the sticky'd thread because if it's not, it needs to be.
1404744794
The Aaron
Roll20 Production Team
API Scripter
Thanks! I'm not sure it is yet. I think Josh hasn't updated that in a few months.
Aaron, I'm running into an error, can't get it right now, but it's with this line : var len = this.length &gt;&gt;&gt; 0, I'm trying to use this with the carry item API script (below) : It seems like this line has to do with some rotate feature that I don't use, (I also commented out your highlighter following the target line that you recommended to me - my only modification). Seeing as I have that carry item which I use for a torch to follow a player's token, this seems like it could cause an issue as well??? I currently have to enable one and disable the other based on whats going on (fights I disable carry, adventuring I disable your tracker). Any assistance would be greatly appreciated, thank you! <a href="https://gist.github.com/anonymous/4f455c4157c96ec7" rel="nofollow">https://gist.github.com/anonymous/4f455c4157c96ec7</a>...
1405954083
The Aaron
Roll20 Production Team
API Scripter
Hey Bryan, That problem is caused by the way Stephen is iterating over his array. Full description further up the thread: <a href="https://app.roll20.net/forum/post/931415/script-tu" rel="nofollow">https://app.roll20.net/forum/post/931415/script-tu</a>... My suggestion is to use the modified version of that script in the linked message. If that doesn't work for you, let me know and I can customize my script to not cause that error.
Thank you, sorry for not re-reading this whole thread before posting, but its getting quite long :( Thank you for the quick response! Thank you for all of your hard work!
1405954946
The Aaron
Roll20 Production Team
API Scripter
No worries, I wouldn't re-read this thread either! =D Honestly, I think I'm addicted to this forum... I check it more often than I check my mail. =D (I probably need a self help group... )
Just tested it, it is still crashing when running both together.
1405983199
The Aaron
Roll20 Production Team
API Scripter
hmm.. PM me an invite and I'd be happy to jump in and take a look.
I'm a total noob when it comes to the API and I know nothing about coding so I might be doing mainly stupid things and I ask you to just bear with me. I tried to add this API script and copy-pasted it to a test campaign and named it TurnMarker. I noticed your note about this reguiring your isGM script to work so I added that as well under the name isGM. I get the following info from the sandbox: TypeError: Cannot call method 'get' of undefined at evalmachine.&lt;anonymous&gt;:513:24 at Function._.each._.forEach (/home/symbly/www/d20-api-server/sandcastle/node_modules/underscore/underscore.js:81:22) at Object.TurnMarker._HandleAnnounceTurnChange (evalmachine.&lt;anonymous&gt;:492:3) at Object.TurnMarker.TurnOrderChange (evalmachine.&lt;anonymous&gt;:597:12) at evalmachine.&lt;anonymous&gt;:653:12 at eval ( I don't have any other scripts. How much did I fail?
No idea here, I copy/pasted both scripts, and it's working pretty darn cool. Thanks Aaron.
1406025991
The Aaron
Roll20 Production Team
API Scripter
O.o Maetco, that's a nice one. You say it's a fresh campaign with nothing else in it? Does it do it consistently? That's a crash bug I've been trying to track down, so that would be cool! It has something to do with not having anything in the turn order I think. PM me a join and I'd be happy to jump in there and track it down!
TypeError: Object function (count) { var len = this.length &gt;&gt;&gt; 0, count = count &gt;&gt; 0; unshift.apply(this, splice.call(this, count % len, len)); return this; } has no method 'get' at dropAllCmd (evalmachine.&lt;anonymous&gt;:1409:83) at evalmachine.&lt;anonymous&gt;:1470:9 at eval ( Still vomits when I use the dropAll command
drop works, just not dropall, so I can deal with that, and just ignore dropall.
1406068737
The Aaron
Roll20 Production Team
API Scripter
AH! ok. I know what the issue is. Fixing it now..
1406069553

Edited 1406069602
The Aaron
Roll20 Production Team
API Scripter
Fixed, uploaded and tested in your campaign! =D Problem was the as up above, but I missed fixing it in the dropall command. Here is an updated GIST for my adjustments to the carry script: <a href="https://gist.github.com/shdwjk/48370c09788e11263d32" rel="nofollow">https://gist.github.com/shdwjk/48370c09788e11263d32</a>
1406870215
The Aaron
Roll20 Production Team
API Scripter
Fixed Crash bug! Now at version 1.17. Updated Gist in top message.
Aaron -- love the script, it works great! I must say as well being a noob at programming your layout and comments are immensely educational. I'm finding that really the only way to learn coding is to study / alter stuff already written and your code here at Roll20 is at the top of the list when it comes to being easily read as well as understood. You are teaching me Javascript pretty much single-handedly. Thanks!!!
1406910069
The Aaron
Roll20 Production Team
API Scripter
Awesome! Thanks for the kind words!! If you really want to bump up your Javascript, I recommend reading Javascript: The Good Parts by Douglas Crockford. It really elevated my JS code and gave me a great understanding of the language. This script is really messy compared to some of the ones I wrote after reading it. if you jump in my gist account, you can really tell when I read it. =D Feel free to PM me if you want to talk JS at a more specific level. =D <a href="https://gist.github.com/shdwjk/" rel="nofollow">https://gist.github.com/shdwjk/</a>
I grabbed the latest. I don't know how you find all this time to work on these. :)
1406917019
The Aaron
Roll20 Production Team
API Scripter
I eschew sleep... =D I also don't watch TV. Writing these scripts is an entertaining pastime for me and I use most of them in my games. I ran one of my games last night and could tell how long it had been since the last time we played by the version of this script I had installed. =D
1406959323
The Aaron
Roll20 Production Team
API Scripter
Added support for my Mark script so that !eot will clear marks. =D
!tm reset should reset round to 1, when you get a chance =D
1407002117
The Aaron
Roll20 Production Team
API Scripter
I know you'll be horrified to learn this, but I actually worked on refactoring this script last night until about 3:30am. That's one of the fixes I'm working on. =D
Does that mean it will be finished in time for someone else to uncover the bugs? :D
1407005152
The Aaron
Roll20 Production Team
API Scripter
But with your services, why would I need anyone else? :)
1407127078
The Aaron
Roll20 Production Team
API Scripter
Does anyone using this script actually use the rotation and aura animations? I'm considering stripping it out in the rewrite I'm working on, but if someone actually want's it in there, I'll see about leaving it.