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, Update] Bump -- Now with Auto-Unslave, No Bars, and a Help Handout!

1588290499

Edited 1618240958
The Aaron
Roll20 Production Team
API Scripter
Bump Update v0.2.21 &nbsp;-- Added LDL Light Multiplier to copied attributes of the master token. (Thanks&nbsp; Craig M.&nbsp; ) Update v0.2.18 &nbsp;-- Added auto unslave and no bars to the configuration. Added Help: Bump handout. (Thanks&nbsp; Tod L. , &nbsp; Carl H. ,&nbsp; Joe ) Turning on Auto Unslave in the configuration will cause the slave token (often seen as a green aura) to be removed when you make a token visible by putting it on the TokenLayer.&nbsp; When paired with Auto Slave, this lets you stay pretty much only on the Token Layer and still control all your things. Turning on No Bars on Slave in the configuration will cause the Slave token to only mirror the current value in each bar, excluding the max value and not linking to the attribute.&nbsp; This lets you still adjust the values, but doesn't give you double bars, which is especially nice if you're using an alternate bar position/configuration (which the API currently has no access to). There is now a Help: Bump handout created and maintained with the current help for the script.&nbsp; (see latest TokenMod update for details on how that works). Update v0.2.17 &nbsp;-- Added the ability unslave tokens with the&nbsp; !bump-unslave &nbsp;command. (Thanks GenKitty!) Update v0.2.16 &nbsp;-- Will now force visibility of bars and auras off for players on each change to a token (master or slave). (Thanks&nbsp; Joe !) Update v0.2.14&nbsp; -- Fixed bug where names get turned on for slave tokens always.&nbsp; Now the slave token does not get a name if it's a GM only token, and only gets a name for player tokens if the master player token has its name turned on. (Thanks&nbsp; Jay R. !) Update v0.2.13&nbsp; -- Added support for players to Bump their tokens and see the invisible colored square to move around the map.&nbsp; Bumped player tokens won't be visible to players that can't control them (unless that rogue left his torch burning!).&nbsp; Additionally, you can not set Status Markers on the slave token for a bumped token.&nbsp; Setting a status that is on the master token will remove it, setting one that isn't will add it, and setting a status with a number will add that number to the status on the master.&nbsp; Status Markers are then cleared from the slave to preserve their invisibility. (Thanks&nbsp; Refugee !) Update v0.2.12 &nbsp;-- Fixed issue that prevented Bump from starting up.&nbsp; Update v0.2.7 &nbsp;-- Reverted a change to push the left margin of help into the space under chat avatars. &nbsp;Disabling chat avatars was truncating the help display down the left side. &nbsp;Also removed an unnecessary warning about !bump'ing a token that didn't have a slave. (Thanks&nbsp; Three of Swords !) Update v0.2.6&nbsp; -- Bump will now automatically repair and cleanup any broken associations with master and slave tokens on startup. &nbsp;Additionally, I have cleaned up a few crash bugs with missing objects. &nbsp;Finally, the help and configuration UI is updated and more thoroughly documented. Features Slave Token Aura &nbsp;-- The created Slave Token is invisible to the players, but also serves a useful purpose of reminding you which tokens support Bump and where they are. Created slave tokens have an aura visible to the GM only. They have one color when Master Token is visible to players (defaults to green) and another when the Master Token is invisible to players (defaults to purple). Mirrored Operations &nbsp;-- Moving, Rotating, Scaling, Flipping, Renaming, Tinting, and Last Move are all mirrored between Master and Slave! Mirrored Bubbles &nbsp;-- Whatever you have the Master Bars set to, the Slave Bars mirror. Change one, it changes the other. Got some invisible monsters in an AoE? No problem. This includes Bars that are linked to a character sheet, which brings me to... Mirrored Represents &nbsp;-- Need to do a save or make a skill check? Slave Tokens have the same Represents as their Master, so they have the same Token Action bar and shift double clicking brings up the character sheet! Commands: !bump &nbsp;-- Swaps places between a token and it's counterpart if it has been added to Bump. &nbsp;If&nbsp; Auto Slave &nbsp;is on, it will add the token to Bump if it isn't already in it. &nbsp;If&nbsp; Auto Push &nbsp;is on, it will also push it to the GM Layer if it is on the Objects layer. !bump-slave &nbsp;-- Puts the selected token in Bump if it isn't there already. &nbsp;If&nbsp; Auto Push &nbsp;is on, it will also move the token to the GM Layer if it is on the Objects layer. --push &nbsp;-- The optional --push argument to !bump-slave causes the token to also be pushed to the GM Layer as if&nbsp; Auto Push &nbsp;was on. Configuration Settings: GM Layer (Visible) Color &nbsp;-- Sets the color that a slave token shows when the associated master token is visible to players. The slave token will be on the GM Layer and the master token will be visible to players on the Objects Layer. &nbsp;Click the button showing the color to be prompted to enter a new color in HTML color format. &nbsp;Show's a checkerboard for transparent. Objects Layer (Invisible) Color &nbsp;-- Sets the color that a slave token shows when the associated master token is invisible to players. The slave token will be on the Objects Layer and the master token will be hidden from players on the GM Layer. Click the button showing the color to be prompted to enter a new color in HTML color format. Show's a checkerboard for transparent. Auto Push &nbsp;-- Causes adding a token to Bump to also automatically push it to the GM Layer if it isn't already there. [Default: Off] Auto Slave &nbsp;-- Causes using the !bump command on a token that isn't in Bump to add that token to Bump. &nbsp; Auto Push &nbsp;applies to this addition. &nbsp;[Default: Off] Previous Release Notes:&nbsp; <a href="https://app.roll20.net/forum/permalink/7079958/" rel="nofollow">https://app.roll20.net/forum/permalink/7079958/</a> Git:&nbsp; <a href="https://github.com/shdwjk/Roll20API/blob/master/Bu" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/Bu</a>... Support my work on If you use my scripts, want to contribute,&nbsp; and have the spare bucks to do so , go right ahead. However, please don't feel like you must contribute just to use them! I'd much rather have happy Roll20 users armed with my scripts than people not using them out of some sense of shame. Use them and be happy, completely guilt-free! Disclaimer:&nbsp; This Patreon campaign is not affiliated with Roll20; as such, contributions are voluntary and Roll20 cannot provide support or refunds for contributions.
Can't wait to try to it! How do I install v2.18? I tried re-installing bump (it's still 2.17), then I un-installed it and manually installed the raw github script (produces an error re state.lastHelpVersion).
1588328332

Edited 1588328359
Joe
Pro
Auto-unslave sounds brilliant, and thank you for the hidden bars! :-)
1588337105
The Aaron
Roll20 Production Team
API Scripter
It will be in the one-click installs next week, or you can go to this url: <a href="https://github.com/shdwjk/Roll20API/blob/master/Bump/Bump.js" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/Bump/Bump.js</a> And copy the script text, then paste it in a new API tab. You'll want to disable the 1-click version if you do that, and enable it again next week. &nbsp; Here's a video that can help:&nbsp; <a href="https://www.youtube.com/watch?v=jam2yx8btaQ" rel="nofollow">https://www.youtube.com/watch?v=jam2yx8btaQ</a>
1588343613
Gold
Forum Champion
Reading about it. Glad you have somehow found time to do a lot of API Script updates, The Aaron. So far I have found the new "Handout" help for one of the ones I use, and it looks useful and handy.
I will eagerly wait until next week. For me, a manual install of the script produces this error: TypeError: Cannot read property 'lastHelpVersion' of undefined at assureHelpHandout (apiscript.js:6430:54) at Object.checkInstall [as CheckInstall] (apiscript.js:6067:9) at on (apiscript.js:6683:10) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:154:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:154:1), &lt;anonymous&gt;:70:8) at checkForReady (/home/node/d20-api-server/api.js:1452:12) at /home/node/d20-api-server/api.js:1532:9 at c (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:14:64) at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147)
1588349940
The Aaron
Roll20 Production Team
API Scripter
Oh!&nbsp; Thanks for finding that!&nbsp; I've pushed a corrected version to the URL above and to the pull request!
It works perfectly! My poor players will be facing a lot more enemies popping out of the shadows next session. Thank you so much!
1588355282
The Aaron
Roll20 Production Team
API Scripter
BWHAHAHAHAH!&nbsp; No problem!
1588711909

Edited 1588711965
I'm not sure what happened but bump no longer works for me. It gives me the following error. ReferenceError: scriptName is not defined It also says that it is version 2.19 I also can't get any other version to work for me any more, on any game. I even created a single stand alone game with Bump being the only API and it still gives me the error. I should also say that I was not currently using bump. Just having it in my available scripts is what's doing it.
1588712004
The Aaron
Roll20 Production Team
API Scripter
Yeah, sorry about that.&nbsp; I made a last minute change and broke it but didn't notice till it got committed.&nbsp; You can import it to your game and it will work, it's just the 1-click version that's broken at this point.&nbsp; It should be fixed for the 1-click by Tuesday.
Oh. That's good to know. I've been playing around with API's and thought I had broken it at first. I spent a while trying to undo what I had done then after about an hour or two I found this. But at least it will be fixed before I really need it. Thanks I appreciate it. I love your scripts they are so useful.
1591448748

Edited 1591448782
I just experimented with your script myself and added the " Auto Unslave" option (while experimenting on how to disable those double-bars). Now I wanted to report my changes and suggest them to you and I stumble upon this thread where you did everything yourself already, hah! Great work, thanks for those updates!
1591455492
The Aaron
Roll20 Production Team
API Scripter
Woot. =D. Thanks for the intent anyway. &nbsp;Maybe you'll notice some other improvements, so definitely not a waste!
Any chance we can get an option to make initiative tracker apply to the slave token only? I wan't the option to use the tracker, but to hide enemy initiative from the players, and Bump seems perfect for that, but the master-only initiative functionality added in v0.2.4 seemingly makes that impossible.
1594098864
The Aaron
Roll20 Production Team
API Scripter
If you add the slave to the initiative, it should replace it with the master and thus hide it from players. Is that not the behavior you're seeing?
1594134392

Edited 1594134606
The behavior I am looking for is for the initiative to *always* be the GM-layer token, thus hiding the actual values of the initiative roll during combat. In the following video you can see on the left is the DM view, on the right the player view. I attempt to add both a player token and a monster to the battle map, !bump-slave the monster, and then attempt to add a turn to the token in various states. In all states, as long as the token is visible to the player, its turn and initiative outcome is visible to the player as well. Desired behavior would be to able to add the slave token to the initiative, allowing the DM to see it in the initiative tracker, but not the players for the entire duration of the encounter. <a href="https://youtu.be/JGvNlOsoAbY" rel="nofollow">https://youtu.be/JGvNlOsoAbY</a> For the record since i noticed my whispered initiative roll macro added the token to the turn order twice, the macro I was using is: /gmroll 1d20+@{selected|initiative_bonus}&amp;{tracker}
1594137738
The Aaron
Roll20 Production Team
API Scripter
Ah, I see. That's outside the original design, but should be pretty easy to add. I'll take a look at it when I have my laptop back.&nbsp;
Sounds great. In the mean time I will play with the relevant lines removed from the script, specifically -785 const handleTurnOrderChange = () =&gt; { -786 Campaign().set({ -788 turnorder: JSON.stringify( -789 JSON.parse( Campaign().get('turnorder') || '[]').map( (turn) =&gt; { -790 let iid = keyForValue(state[scriptName].mirrored,turn.id); -791 if(iid) { -792 turn.id = iid; -793 } -794 return turn; -795 }) -796 ) -797 }); -798 }; -803 on('change:campaign:turnorder', handleTurnOrderChange); -805 if('undefined' !== typeof GroupInitiative &amp;&amp; GroupInitiative.ObserveTurnOrderChange){ -806 GroupInitiative.ObserveTurnOrderChange(handleTurnOrderChange); -807 } -808 if('undefined' !== typeof TokenMod &amp;&amp; TokenMod.ObserveTokenChange){ -809 TokenMod.ObserveTokenChange(handleTokenChange); -810 } -815 Notify_TurnOrderChange: handleTurnOrderChange, Not familiar with javascript so can't offer a solution, but can caveman out the code causing me trouble :D
This is an awesome script, but I'm hoping to simplify it for myself a bit by creating a toggle macro using just the !bump command and having Auto Push, Auto Slave, and Auto Unslave active.&nbsp; Currently I'm noticing 2 issues: 1. When no token is selected, !bump defaults to adding the --help argument, but I'd rather not get that message every time I accidentally forget to select a token.&nbsp; I'd rather get no message, or an error message like "You must select a token to Bump" I've looked through the code, but I'm not seeing where the --help argument is being automatically added when there is no argument provided. It seems like it should be in the 'const helpParts = {' section starting on line 579, but I'm not sure what to modify there.&nbsp; In the meantime I've simply commented out line 648 'sendChat('', '/w "'+who+'" '+ helpParts.helpChat(context));' which prevents the help message from displaying in chat at all, which is an ok workaround.&nbsp; (Especially since the Bump Help Handout is still available on the Journal tab.) 2. When a token is Bumped, it is automatically deselected afterwards. I'm assuming that's a result of creating the invisible token, but it would be great if that could be updated as well, so that whatever token is on the layer that was bumped from is selected. &nbsp;
1594239196
The Aaron
Roll20 Production Team
API Scripter
For 1, on line 662: if ( ! msg . selected || args . includes ( '--help' ) ) { Change it to: if ( args . includes ( '--help' ) ) { For 2, I'd love to give you that functionality, but the API does not have access to the selected state of the client. :(
Awesome, thanks The Aaron! For anyone else who is looking for the same functionality, I also updated each instance of sendChat(‘’ to sendChat(‘Bump’ so that the chat displays the name of the API script. On line 662, I also added: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(!msg.selected) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sendChat('Bump', '/w "'+who+'" You must select a token to Bump!'); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } to add an error message when no token is selected.