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] Bump v0.2.4 - Invisible manipulation of GM Layer objects from the Token Layer [New Thread]

July 26 (9 years ago)

Edited February 10 (9 years ago)
The Aaron
Roll20 Production Team
API Scripter
Update v0.2.4 -- Bump now makes sure that tokens in the turn order are the Master token and not the Slave.  It will check on turn order updates (such as adding tokens, or advancing the turn).  As an added bonus, if used with GroupInitiative v0.9.7 or higher, it will also check when GroupInit adds/updates tokens in the turn order. (Thanks BGB!)

Bump v0.2.4

Commands:

  • !bump-slave -- This sets up the invisible Slave Token. By default, the Slave Token is created on whatever layer the selected Master Token is not on. So, if your Master Token is on the GM Layer, it will make the Slave Token on the Objects Layer and vice versa.
    • You can specify --push when you run this command and if the Master Token is on the Objects Layer, it will push it up to the GM Layer and create the Slave Token on the Objects Layer. (see AutoPush below)
  • !bump -- swap the Master Token and Slave Token. You can run this with either selected. It will apply the operation to all selected tokens that are part of a Bump Master/Slave pair.
    • If you have the AutoSlave setting on, using this command on a token that isn't in Bump yet will slave it for you.
  • !bump-config -- An interface to setting the configuration options for Bump. More on those in a bit...


Features:
  • Slave Token Aura -- 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 -- Moving, Rotating, Scaling, Flipping, Renaming, Tinting, and Last Move are all mirrored between Master and Slave!
  • Mirrored Bubbles -- 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 -- 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!
  • GenKitty Config System -- The help screen includes a list of all settings and their current state at the bottom along with an API Button for changing them.
    • No more typing out tedious commands to set options, in fact they prompt you for the setting with the current value as the default.
    • You can also specify !bump-config directly to get just the config options.
  • AutoPush -- If you always want Master Tokens to be pushed up from the Objects Layer to the GM Layer, just set this option.
  • AutoSlave -- If you want to have !bump act like !bump-slave on tokens that are not already slaved, just set this option.


Git:https://github.com/shdwjk/Roll20API/blob/master/Bu...
If you use my scripts, want to contribute, 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: This Patreon campaign is not affiliated with Roll20; as such, contributions are voluntary and Roll20 cannot provide support or refunds for contributions.
This brings your Scriptomancy to a new level of awesome!

I had considered doing something like this because it's annoying to toggle between layers when you have hidden/invisible combatants.  (And savvy players will pick up on it if you're normally fast to decide NPC actions/movements.)  But as a level 1 Scriptomancer, I knew I had no chance to pull it off eloquently.

You did.  Bravo, sir!

July 27 (9 years ago)
The Aaron
Pro
API Scripter
Thanks.  Actually, this script has been around for quite a while, I just added the bit today about getting the right token in the turn order. =D
July 27 (9 years ago)
The Aaron
Pro
API Scripter
(The old thread was closed for age, and not really titled correctly.)
Then I'm disappointed I missed the other thread.  Cuz I've wanted this functionality for months.
July 27 (9 years ago)
The Aaron
Pro
API Scripter
Ah!  Then take a look at my script repo:  http://github.com/shdwjk/Roll20API/

Might be some more gems. :)
hmm...

A minor bug.  I think.

When I use your Groupinitiative script to set up Initiative, a player can see the invisible tokens in the Turn Tracker.  They disappear as soon as you move to the next character, but they're there initially.

If I add the combatants using the default method, they are not visible.

July 27 (9 years ago)
The Aaron
Pro
API Scripter
Are you using the latest version of GroupInitiative?  It has a fix for that.
I just updated GroupInitiative and you are correct, it works properly.  Thanks!
July 28 (9 years ago)
The Aaron
Pro
API Scripter
SWEET!  Glad to hear it!
August 19 (9 years ago)
DK Heinrich
Marketplace Creator
Sheet Author
when Bump and BloodSpatterandConditions are both enabled - midway into Blood doing its thing the API crashes. with this message.
When Bump is disabled the crash stops. 

Anything I can do to to tweak Bump to make it play nice with Blood?

/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1
orts, require, module, __filename, __dirname) { function g(a){throw a;}var j=v
                                                                    ^
TypeError: Cannot call method 'set' of undefined
    at handleTokenChange (evalmachine.<anonymous>:1406:68)
    at eval (
August 19 (9 years ago)
The Aaron
Pro
API Scripter
So, somehow the interaction between the two is causing one of the tokens that Bump (or Splatter) uses to be removed.  I'll have to dig into where that's happening.  There shouldn't be an interaction between the two, but I'm not familiar with how the BloodSplatterandConditions works internally.  Does it delete a slain token and replace it with a pool of blood?  That could cause something untoward to happen.   Either way, I'll add some guards into my code to make sure the crash doesn't happen.
August 19 (9 years ago)
DK Heinrich
Marketplace Creator
Sheet Author
no, it adds a 'blood' token to the map layer based on -variables- it does not delete anything (well it has a delete all blood function but that is not whats breaking I dont think). 

I was went back and forth enabling and disabling until I found Bump to be the culprit -it was last one i check of course, honestly because I did not think they would worry about each other. 

Its no rush, just wanted to bring it to your attention
August 20 (9 years ago)
Kryx
Pro
Sheet Author
API Scripter
@DK: At what point does this error happen? I installed Bump to test (which works great, I may use this script now!), and was able to move a bloodied token which created a blood spatter, kill a token which created a pool, etc. No errors.

Can you please specify the reproduction path?
Im confused what this script aims to achieve?
August 20 (9 years ago)

Edited August 20 (9 years ago)
Kryx
Pro
Sheet Author
API Scripter

Saevar L. "Liquid-Sonic" said:

Im confused what this script aims to achieve?
Being able to drag tokens on the gm layer from the token layer without having to switch.
It also works to apply damage (which works with my blood spatter), and other things.
August 20 (9 years ago)

Edited August 20 (9 years ago)
DK Heinrich
Marketplace Creator
Sheet Author
the above error pops when I increase a tokens damage to a point they should make a spatter. The blood image hits the table. The error pops and locks up the API. I 'think' its after the blood image but before the condition marker - going to check it again next.

Edit - the above is correct. 

click on token
type 75 in damage bar (max is 80)
75 appears in circle
blood spatters
api breaks

click on token
type 95 in damage bar (max is 80)
95 appears in circle
api breaks (same error as above)

click on token
type 25 in damage bar (max is 80)
25 appears in circle
api breaks (same error as above)

Turn off !bump - and it all works fine.


August 20 (9 years ago)

Edited August 20 (9 years ago)
DK Heinrich
Marketplace Creator
Sheet Author
OK - this seems to only be crashing when using a large token - normal (1sq) sized tokens do not have the issue. 

EDIT - I hate computers. 

Deleted all (only 2) my large tokens and recreated them. Now they are working perfectly with bump turned on. 

No idea why the others crashed it, and at this point I dont care :) 

If I screw it up again I will let you guys know.
August 20 (9 years ago)
The Aaron
Pro
API Scripter
Glad you got it working.  At a minimum, I can add some guards into Bump to be sure it isn't happening again, though it would be nice to get a root cause.  =D

September 15 (9 years ago)
DK Heinrich
Marketplace Creator
Sheet Author
is it just me, or if a token is set up for players to 'see' the name, they can see it even after you 'bump' it to be invisible? 
September 15 (9 years ago)
The Aaron
Pro
API Scripter
Probably.  That's something I can change pretty easily.  I'll take a look. 

There might be some other settings that shouldn't be duplicated, such as seeing the aura, etc.  Thoughts?
September 15 (9 years ago)
DK Heinrich
Marketplace Creator
Sheet Author
to me - if a token is bumped to invisible status then all would be bumped - making it fully invis to all players. 

bars, names, auras - I cant think of a good reason to have any of them visible while 'bumped'.
September 15 (9 years ago)
The Aaron
Pro
API Scripter
I could make an argument for auras, but I think you're generally right. I'll add some options shortly. 
September 16 (9 years ago)
DK Heinrich
Marketplace Creator
Sheet Author
very niche item:  when using !bump with the !centerSmall script (auto-centers tokens less than 70x70) - while 'invisible' to players the aura centers correctly (on main layer), but the token (on gm layer) does not. When it becomes visible it is all perfect. Mostly my OCD kicking in (or is that CDO?) 

This is, like most things, not the end of the world - and is most likely only fixable on the centerSmall script - but since you were make a list of things to look at I figured I would toss you one more. 
September 16 (9 years ago)
The Aaron
Pro
API Scripter

DK Heinrich said:

or is that CDO?
In alphabetical order, as it should be!

Yeah, I'll see about fixing that as well...  not an easy thing, but possible.

I was just about to post about how Bump still shows auras when a token is invisible.  It appears you're already on the case!

Thanks for such a useful script!
September 17 (9 years ago)
The Aaron
Pro
API Scripter

DK Heinrich said:

is it just me, or if a token is set up for players to 'see' the name, they can see it even after you 'bump' it to be invisible? 

Are you sure this is the behavior you're seeing?   Looking at the script, it shouldn't show those things on the invisible token.  Can you verify this is happening?  I checked the defaults for those permissions and they should not show unless explicitly turned on, which I haven't done.  They should remain off.  I can certainly explicitly turn them off, but I shouldn't need to.
September 17 (9 years ago)

Edited September 17 (9 years ago)
DK Heinrich
Marketplace Creator
Sheet Author
recreated, with photos!


(GM VIEW)


(Permissions - nothing selected)


(Player View)


(Permissions - Name selected)


(Player View)


(permissions - Aura selected)


(Player View)
September 17 (9 years ago)
The Aaron
Pro
API Scripter
You are turning on the aura and name of the invisible token.  That's why they can see it.

If you want to adjust those features for the bumped token, you'd need to do it on the bumped token.  Does that make sense?
September 17 (9 years ago)
DK Heinrich
Marketplace Creator
Sheet Author
damnittohellinahandbasket.

yeah, makes sense. I made all my guys, and was bumping them as I was going - then after the fact decided I wanted the names to show (originally did not) so I added it... I can correct.  Thanks again and sorry for the crazy... at least I did give you a harder project with the CenterSmall heheheh
September 17 (9 years ago)
The Aaron
Pro
API Scripter
You could use this on the objects layer to fix invisible tokens:
!token-mod --off showplayers_name showplayers_aura1 showplayers_aura2 showplayers_bar1 showplayers_bar2 showplayers_bar3 
And this on the gm layer to fix the master tokens:
!token-mod --on showplayers_name showplayers_aura1 showplayers_aura2 

I could probably add something to bump that would prevent accidentally turning those on, and possibly whisper to the GM something like "You just tried to show the name of the invisible token, did you mean to do that on the master token?"
November 10 (9 years ago)
From another post :

Hi everyone,

One of my player like to do tricks and want his character to sometimes disappears then he will pm me what he do and then reappears. Deleting his token and replacing it is not really convenient as i can't see where he really want to be.

Other example would be a character who can only be seen by 1 player who has a specific ability, like seing ghosts.

How can i have a token viewable only by 1 player?
Would that be possible with that script, knowing its for a player and not a GM ?



November 10 (9 years ago)
The Aaron
Pro
API Scripter
Hmm.  It would certainly be better than deleting the token.  If the player has control of the token you bump, they will have control of the invisible token that takes it's place on the object layer.  They won't be able to see it, but they will be able to select it and manipulate it as normal.

There may be a configuration where I could put an aura on it that they could see, but that other players would not.  I'll have to experiment.