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] True Page Copy - Duplicating pages made simple!

1489805637

Edited 1490815231
PaprikaCC
Pro
API Scripter
True Page Copy.js Download Links: Version 1.0 1-click install now available! A little script to make the duplicate page button actually work. Fully copies one page to another, obeying Z-ordering, token stats, linked bars, and dynamic lighting walls. It will copy everything from a small 12x12 map, to a 600x600 behemoth. Use this in conjunction with  Twins to get the most out of multi-page setups! Big thanks to TheAaron and Scott C for helping me fix a major error in development. What does True Page Copy do? Automatically duplicates page graphics to your shiny new page when you click the "Duplicate Page" button. Gives you a chat command to manually copy page graphics to other pages on a whim. Forces you to click a button so the whims aren't as destructive. Chat Command : 1. Use the 'Duplicate Page' button on the pages menu. OR 1. Use !pagecopy or '!pagecopy source' to select the page you're looking at as the source. 2. Use !pagecopy while looking at a different page to select it as the destination. 3. Select the [Yes] button in chat to copy from source to destination. Through the API : // The exposed function is TruePageCopy.CopyPages(@sourcePageId, @destinationPageId) // The party is moving from an area to a similar looking area TruePageCopy.CopyPages(templateArea.id, targetLocation.id); exampleMovePlayersToNewArea(playersArray, targetLocation.id); Change-log & Known Bugs: Known Bugs: You also cannot copy graphics unless they are in your library. This is a strict limitation of the API. Pages altered by the script will have to be deleted twice (if you want to delete them). Version 1.0: Released to the public. Updated to properly order graphics.
1490205242
PaprikaCC
Pro
API Scripter
Now it obeys z-ordering. It's a True Page Copy now.
1490206708
The Aaron
Pro
API Scripter
Very nice!
In the next week or two I should be duplicating some pages.  I'll check this out!
Why would I be duplicating pages??  What are the scenarios that cause this?  How would this be something useful to me that I have not been using yet?
1490370986

Edited 1490371053
The Aaron
Pro
API Scripter
So, here's a few things I can think of off the top of my head: Creating a Day and Night version of a town Creating a Before and After version of a castle when there is a siege. Creating a series of Forest maps where the trees grow up over time, or the forest is getting slowly corrupted.. Creating a set of standard outpost maps for a culture that always sets up outposts with a rigid layout (Like the Romans!) Creating a multiple copies of a village which are subtly different for when players are moving between realities Creating duplicates of a map to allow some special case effects (some players see invisible, others don't... or ghosts, or fnords...). Creating a town at different points in history (for time travel, or multiple generations of PCs)
1490385843

Edited 1490385854
Personally I mainly duplicate maps to set up different random encounters ahead of time, or buildings with multiple floors that are going to have the same basic shape. This is good stuff thanks man!
I was thinking of using this for diff levels of the same map.  
1490815209

Edited 1491494800
PaprikaCC
Pro
API Scripter
To all of the people who find this script through 1-click install, there is a major bug that I forgot to check for. If you use any assets that you don't own (e.g. free assets through the pro subscription, uploaded by another GM/player), the API will crash upon using this script. The script available through the download link above does not have this problem and the 1-click install will be fixed in one to two weeks time. EDIT: Problem is now fixed.
1490818221
The Aaron
Pro
API Scripter
I probably should have mentioned this to you earlier, but I have a function for cleaning up image source that the API can't create. &nbsp;It also handles another class of problems, drag/drop tokens from the compendium without a cache buster value: &nbsp; <a href="https://wiki.roll20.net/API:Cookbook#getCleanImgsr" rel="nofollow">https://wiki.roll20.net/API:Cookbook#getCleanImgsr</a>...
1490843601
PaprikaCC
Pro
API Scripter
I just added it and it helped stop all the annoying "CANNOT DO THIS" logging. I also took your _.reduce trick from the twins script to grab token properties, it was pretty neat. Thanks!
1490869753
The Aaron
Pro
API Scripter
No problem. =D
I finally got around to using this. &nbsp;It worked very well. Thank you.