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

Question about TokenMod and the Mad Mage

1543842172

Edited 1543879523
A bit of an intro. Apologies for the wall of text... soooo... I'm running through the Mad Mage campaign. We played the first week, and all was fine, my games are filled with scripts to automate spell slots, ammo, tracking, combat order, XP, monster health, monster death, hit dice tracking etc... However, I then decide the maps are a bit boring so I replace the entire first level (huge dungeon) with my own new textured map. It's traced over the original, so it looks great! and the dynamic lighting can be re-used. However, in the process, I accidentally ruin some of the dynamic lighting layers and remove a few key monster tokens.... I think 'no harm done'! So I rename the 'old map' to something like ' Level 1 - Broken ' and then make a whole new game with a fresh module again and then 'Transmogrify' the new map into my existing campaign. Ta-dah. New map. All I do is replace the background map image with my new map image, delete the already killed monster tokens and drop in the heroes again and I'm good to go. However.... the following week, when I used any scripts (to remove HP, or automatically mark a 'dead' token with a big X) I usually 'select token' and then run the script. However, nothing was changing on my new tokens. What was strange is that I use 'Lazy XP' and the script was sometimes telling me that monsters had died even though their HP was showing as full. The game kept constantly crashing and I was pulling all my hair out. After 2 hours of errors and crashes, I give up, ended the game and investigated it later... It turned out that all the changes WERE happening.... but they were happening to the tokens on the OLD map page. --- So my question is... are the map pages some how identified using a 'unique ID' or something, and having two maps with the same 'ID' causing the game to crash and break? I don't really want to delete the old map page just yet, since I'm using it as a bit of an archive of sorts just to remind me what the players have already killed/explored etc... --- Any thoughts anyone? Thanks :)
1543863394

Edited 1543884680
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Aaron's answer is better than mine. :) We'd need to see some of the actual macros you are using. Tokens do come in with unique token and/or character IDs when transmogrified, which can break if macros or scripts reference them. In the case of scripts, they may keep them in state (the persistent data in the API are) as token IDs rather than by name. In the case of something like Lazy XP, this might be the situation, since my assumption is that XP is generated by monster killed? In the case of the scripts, it might be better to post on the script thread and ask if that is the case. One thing you could try, though I can't guarantee that something might go wrong, so be prepared to do a Rollback, is to delete the tokens from your new map, select all the tokens from your old map and Copy them, then Paste them into your new map. You should then be retaining the original IDs. The safest way would be to test this with just one token first, one that you know to be problematical. If that works, you should be able to transfer the others in a similar manner and keep all of your data references correct. Once again, test first . This is a solution off the top of my head, and since it is not an easily reproduced situation, I can't guarantee it.
1543879207
The Aaron
Pro
API Scripter
Actually, this is a known issue I’ve brought up to the devs before. Every graphic has a unique id which scripts use to manipulate them.  HOWEVER, the transmogrifier does not reassign ids when you pull in maps. If you pull the same map in twice, you’ll have multiple tokens with the same (now very much non-unique) ids. There are two things you can do to fix this. The first is to remove one copy of the map. That should give you only one set of tokens with a given id. The second (more tedious) option is to select all the things on a layer, copy them, select them again and delete them, then paste the copy. Pasting causes new ids to be generated. It’s tedious because you then need to line everything back up. 
I've been going through, deleting the existing tokens and then dragging fresh ones in from the journal. I think that seems to be slowly fixing the issue.
Aaron. That's great! And a lot quicker than the way I was doing it :) Good to know that my question over token IDs wasn't too much of a dumb one..  and that I was in the right ballpark when guessing the issue :) cheers!