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

Change Map - Clone Tokens (What is it Supposed to Do? How Does it Work?)

1625070730
Bea H.
Pro
Marketplace Creator
I want to be able to have players move between one of four maps when they press a button. I used the Map Change API script to change the maps, but it doesn't move the tokens. I found a script, called ChangeMapCloneTokens, which states, "This script listens to change of page event (drag the ribbon) and will clone player tokens onto the new page. Ignoring duplicate tokens... The spawn coords of the new tokens reflect the original postion of the token on previous map." I assume that means that if I drag the player ribbon from Map 1 to Map 2, whatever player tokens are on Map 1 will appear on Map 2. Except it's not doing that. Any thoughts?
1625072724
The Aaron
Roll20 Production Team
API Scripter
The API can only create images that are in a User Library.  If the tokens came directly out of the Marketplace, the API won't be able to create them.  That's probably why Map Change doesn't do it. As for ChangeMapCloneTokens, I'd have to look at the script to know.  Probably the issue is with how it knows that a token is a player token.  In my scripts, I generally consider a Player Token to be any Token that can be controlled by a Player that isn't a GM, or that is representing a Character that can be controlled by a Player that isn't a GM.  That has a bit of complexity to it, so they might require tokens to have some marker, or not in the gm notes, or the character to have a particularly named attribute, etc.  Can you link that script?
1625102668
Bea H.
Pro
Marketplace Creator
It's one of the standard API scripts. <a href="https://github.com/Roll20/roll20-api-scripts/blob/494eb5dd00f15968267ac4bbb92d546b60e38d11/ChangeMap_CloneTokens/1.0/ChangeMapCloneTokens.js" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/blob/494eb5dd00f15968267ac4bbb92d546b60e38d11/ChangeMap_CloneTokens/1.0/ChangeMapCloneTokens.js</a>
1625242227
Bea H.
Pro
Marketplace Creator
*bump*
1625249563
The Aaron
Roll20 Production Team
API Scripter
Pick one of your player tokens, select it, press Z, right click and copy the URL. Look at the first part of it, does it say marketplace anywhere?
1625326057
Bea H.
Pro
Marketplace Creator
At the moment, I'm using a token that doesn't have an image associated with it. It's just the default image. So that's not the issue.&nbsp;
1625326577
The Aaron
Roll20 Production Team
API Scripter
Is it this:&nbsp; <a href="https://app.roll20.net/images/character.png" rel="nofollow">https://app.roll20.net/images/character.png</a> The API cannot create images that are not in user libraries.&nbsp; That image is not in a user library.&nbsp; Try it with an image that is in a user library and see if you have the same problem.
1625330236

Edited 1625330313
Bea H.
Pro
Marketplace Creator
Okay. I think you have a solution for what I'm trying to do, but it's in another thread (see link below). So here's what I'm trying to do. I have four levers. When characters pull a lever, it causes a certain pattern of blocks to rise up. Each lever has a different pattern of blocks. I want to create four macro buttons that the characters can press and when they do, the correct sequence of blocks appears. I was initially thinking I would have them switch between maps, but it seems like maybe creating a rollable table and creating a multi-sided object is the way to go. The only problem I'm running into is how to switch the sides of the map using a macro. I see your explanations in the thread below, but I... am dumb and don't understand what you're saying. :-P The name of my map is&nbsp;Path_Of_Ice. It has four sides. <a href="https://app.roll20.net/forum/post/7354866/multi-sided-tokens-switching-sides-simply" rel="nofollow">https://app.roll20.net/forum/post/7354866/multi-sided-tokens-switching-sides-simply</a>
1625331173
The Aaron
Roll20 Production Team
API Scripter
Ah, the old X-Y problem rears its head.&nbsp; =D So, the easiest way is to have your Rollable Table set up with the 4 layers you want.&nbsp; Be sure they're the same size, or you'll get weird stretching or squishing.&nbsp; Create a Rollable Table Token from it and place it on the Map sized the way you like. Get it's id with: /w gm @{selected|token_id} Create a macro/ability for each level with the TokenMod (side note: install TokenMod from the 1-click) command for the side you want (-Jak1a42J23 is a stand in token id for what you would have gotten above): !token-mod --set currentside|1 --ids -Jak1a42J23 --ignore-selected Hook those up the the levers however you want. Bonus Instructions: You can make this cleaner by making the Map graphic represent a character like "Map": !token-mod --set currentside|1 --ids @{Map|character_id} --ignore-selected --current-page That will change whatever graphic represents the Map character on the current page, which means you can use the same system on multiple pages without affecting each other.
1625331693

Edited 1625331843
Bea H.
Pro
Marketplace Creator
Okay, this is what I put in for lever 1: !token-mod --set currentside|1 --ids -Mdh7L-GgBixTU5hNsz6 --ignore-selected It's not working.
1625334811
The Aaron
Roll20 Production Team
API Scripter
Are all the images in the Rollable Table in a User Library? What version of TokenMod do you have?
1625338449
Bea H.
Pro
Marketplace Creator
The Aaron said: Are all the images in the Rollable Table in a User Library? Yes. The table is called Path-Of-Ice-Table The Aaron &nbsp;said: What version of TokenMod do you have? ID10T Error: User didn't download the API script. Please remove user from keyboard. -__- It's working now. Thanks. (I feel so dumb.) :-P
1625349816
The Aaron
Roll20 Production Team
API Scripter
Great! &nbsp;Glad to hear you got it working!