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 Request] Linking tokens on seperate maps

Kind of a niche thing, but basically I want to be able to 'link' 2 tokens on similar maps, so that any action made by one is made by the other. The reason I want a script like this is because in my campaign I'm wanting to run a scenario where the party is interacting with illusionists. One of my players would be able to see through the illusions, so he would be on a separate map from the rest of the party, where the map layout is the same, but the illusions have been replaced with the actual identities of the tokens. I was hoping that there was someway that I could do this, without having to constantly switch between pages and update the tokens individually. The bar values and status markers don't need to update, mainly just the locations of the tokens updating on both pages simultaneously. Hopefully I've made myself clear enough...
1424562082
The Aaron
Pro
API Scripter
Nothing like that exists currently, but I've always wanted to write something for this... ...Ok! Done! Twins v0.1 This is a hacked together script, so it's a bit rough around the edges... Commands: !twins [token id] [token_id] -- Specify the two token ids to twin. You can use @{selected|token_id} for one of them, but you'll have to copy paste the other since you can't select across pages. Adding a token to a twin relationship that is already a twin will remove its other twin relationship. !twins -JiiOlS-vFIPqWr1L7io -Jh1sr9gXH7OmoUB2S3e !not-twins [token_id] -- Specify a token id to remove its twin relationship. You only need to specify one of the twins. !not-twins @{selected|token_id} Note: Removing a token that is a twin will remove the twin relationship. These are the properties being copied between twins: left, top, width, height, rotation, layer, isdrawing, flipv, fliph, bar1_value, bar1_max, bar1_link, bar2_value, bar2_max, bar2_link, bar3_value, bar3_max, bar3_link, aura1_radius, aura1_color, aura1_square, aura2_radius, aura2_color, aura2_square, tint_color, statusmarkers, showplayers_name, showplayers_bar1, showplayers_bar2, showplayers_bar3, showplayers_aura1, showplayers_aura2, playersedit_name, playersedit_bar1, playersedit_bar2, playersedit_bar3, playersedit_aura1, playersedit_aura2, light_radius, light_dimradius, light_otherplayers, light_hassight, light_angle, light_losangle, lastmove I left off name and show name, so you can change those individually. You can remove any of the other ones by taking it out of the list of props at the top of the script. Note: If you change anything about a token with the API (for example, using !torch to set it's light), this change will not be synchronized until you change something manually, such as a status marker. This is a limitation of API changes not triggering change events in Roll20, but shouldn't be too much of a problem for you. Let me know how it goes!
1424568673

Edited 1424568753
Great, thanks! I haven't tried it officially yet (like in campaign play) but it seems to work fine in rudimentary testing.
1424568946
The Aaron
Pro
API Scripter
Cool... =D Can't wait to hear how it goes! You should be able to like not only the enemies but the players as well. =D
1424597641
Ziechael
Forum Champion
Sheet Author
API Scripter
Aaron... Roll20's official API-hog does it again lol. Love your idea J G, may well have to throw something similar into my campaign, especially with this added functionality... inspired use of roll20!