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] Marching Order 2.1

1467645803

Edited 1513026201
Ada L.
Marketplace Creator
Sheet Author
API Scripter
This is an update to one of my older scripts (The original thread is closed). In v2.1, the Marching Order script, used to have tokens follow each other in a chain/marching order, now has a chat menu interface. Now available through One-Click. Demo: Update Roadmap: Button to for GMs to stop all following. (Pull request pending) Default marching order (Pull request pending)
Testing now.  Really AWESOME upgrade Stephen L.!
Works like a charm. Only concern ( a minor  one ) is that I have mixed sized characters in one of my campaigns and the larger tokens get unaligned on the grid when following. 
1467810238
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Ravenknight said: Works like a charm. Only concern ( a minor  one ) is that I have mixed sized characters in one of my campaigns and the larger tokens get unaligned on the grid when following.  Currently, the script positions the tokens based upon their center coordinates. In a future update I might see about implementing a snap-to-grid user option.
I'm trying out this script installed via OneClick, but it doesn't seem to be working for me. I see the script added a macro button for MarchingOrderMenu with "!showMarchingOrderMenu" as the content. When I try the button with one, more than one or no tokens selected there is no menu or output of any kind. I have tried the same with "!showMarchingOrderMenu" in the chat box. I have tried as GM as as a player. Doesn't seem to be working. One thing I did notice is that on the API Output Console there is no mention of the script loading, where I see a mention when I use Group Inti. Not sure if this is an indiaction of it not loading?  
1470185038
Ada L.
Marketplace Creator
Sheet Author
API Scripter
The script doesn't produce a log message when it is loaded. It should show you a menu with some buttons in the chat. The menu is whispered to whoever activated the macro installed by the script. Not sure why it isn't showing up for you.  What other scripts do you have installed? Can your players use the script if they enter the macro's command in the chat?
1473829554
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
humannumber1 said: I'm trying out this script installed via OneClick, but it doesn't seem to be working for me.   I also had a lot of problems until I realized that you have to be on the page with the Player Ribbon. I've run into that with some other scripts as well. I understand the reasoning behind this, it's just something I keep forgetting. Stephen L.: Awesome script. It solves a problem I've had with moving players from one encounter area to another.
1473858376
The Aaron
Pro
API Scripter
Stephen L. said: The menu is whispered to whoever activated the macro installed by the script. Not sure why it isn't showing up for you.  Probably his name in the game has a space in it, like "The GM" and someone else in his game has the same first word, like "The Aaron".  The code sending the whisper truncates to just "The" and so it targets the wrong "The": // playerName === 'The GM'         if(playerName.indexOf(" ") !== -1) { // playerName === 'The'             playerName = playerName.substring(0, playerName.indexOf(" "));         } // whispers to 'The' resolve to another person.         _whisper(playerName, " Invalid " + This used to be a limitation for the API, but they recently fixed the quoting of names.  I'd suggest getting rid of the truncation (I've been doing that on my scripts as I run across it) and replacing it with the quotes:     function _whisper(who, msg) {       sendChat('Marching Order', '/w " ' + who + ' " ' + msg);     }
1473860175
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Thanks, I didn't know that you could surround the name with quotes to get around that. I put in the fixed code in a merge request, but if anyone needs it sooner, replace the _whisper function with this: function _whisper(who, msg) {   var name = who.replace(/\(GM\)/, '').trim();   sendChat('Marching Order', '/w "' + name + '" ' + msg); } This was also a problem for the Custom Status Markers script menu, so I've fixed it there too.
1473860761
The Aaron
Pro
API Scripter
No problem.  I've spent hours in the past in people's games trying to figure out why they didn't get the whispers. =D I imagine you also fixed all the places where _whisper() was being called removing the truncation.  Probably people who want it sooner would need more changes than just the _whipser() function to get it going.
1473861045
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Yeah, I just take care of that inside _whisper with that "var name" line. msg.who is being passed in for who everywhere _whisper is called.
1473861364
The Aaron
Pro
API Scripter
Oh.  I think you missed this one on line 190:     /**      * Sends a message back to the player who used the command about how to      * use this script.      * @param {Msg} msg      */     var _replyHowToMessage = function(msg) {         var playerName = msg.who;         if(playerName.indexOf(" ") !== -1) {             playerName = playerName.substring(0, playerName.indexOf(" "));         }         _whisper(playerName, " Invalid " +                 "command. After the command enter either north, south," +                 " east, or west for the direction of the marching order, " +                 "or the name of a character to follow.");     };
1473863569
Ada L.
Marketplace Creator
Sheet Author
API Scripter
K, that's fixed now too.