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

Maps and layers

So I am working on a tower map. I originally had each floor stacked on top of each other and just pushed the old floor to the back. I'm having problems with dynamic lighting and lines of site this way. Would it just be better to have each floor as it's own map?
I make a map divided into several floors with D.L. "boxes" around them. This works with a small tower quite well, they can split the party without you having to changes maps so often.
1429026347
The Aaron
Pro
API Scripter
Also, there is a teleport script you can use to move people between the layers when they mount the stairs, I can loo it up if you're interested.
This one? <a href="https://wiki.roll20.net/Script:Auto_Teleporting_and_Chat_Based_Teleporting" rel="nofollow">https://wiki.roll20.net/Script:Auto_Teleporting_and_Chat_Based_Teleporting</a>
Hmm, link is broken to the actual script.
1429026603
The Aaron
Pro
API Scripter
That's the one. I think I have a version floating about that does collisions instead of precise matches for position, but the basic one works.
1429026929
The Aaron
Pro
API Scripter
Here's my modified version: /* ************ TELEPORTING SCRIPT ************************** * The intention of this script is to allow the DM to teleport * one or all characters to a location based on a token placed * on the DM layer of the map. * To activate the script, type "!Teleport " and add the name * of the teleport location (must not contrain spaces) and then * the name of the party member to teleport there. They must be * seperated by commas. If you want all to teleport, type all. * ie. !Teleport teleport01, all - teleports all players to teleport01 * * AUTOTELEPORTING: This feature allows you to place a token on * One square (for example stairs) and it will auto move a token * to the linked location and back again should you choose. * Linked locations need to be tokens placed on the GMLayer. * Naming conventions: * Two way doors: XXXXXXXX2A, XXXXXXXXX2B * Three way dooes: XXXXXXXX3A, XXXXXXXXX3B, XXXXXXXXX3C * (in the case of one way doors, dont create a 3C) * This system can handle up to 9 way doors (9I max). ****************************************************************/ var Teleporter = Teleporter || {}; Teleporter.AUTOTELEPORTER = true; //Set to true if you want teleports to be linked Teleporter.Teleport = function (CharName, TargetName) { "use strict"; var LocX = 0; var LocY = 0; //find the target location var location = findObjs({ _pageid: Campaign().get("playerpageid"), _type: "graphic", layer: "gmlayer", //target location MUST be on GM layer name: TargetName }); if (location.length === 0) { return; //exit if invalid target location } LocX = location[0].get("left"); LocY = location[0].get("top"); //if all are indicated, it lists all //finds all tokens with the name var targets = findObjs({ _pageid: Campaign().get("playerpageid"), _type: "graphic" }); //Move characters to target location _.each(targets, function(obj) { //Only player tokens if (CharName === "all") { if (obj.get("represents") !== "") { log("Setting all"); obj.set("left", LocX + 1); obj.set("top", LocY); } } else { if (obj.get("name").indexOf(CharName) !== -1) { if (obj.get("represents") !== "") { obj.set("left", LocX + 1); obj.set("top", LocY); } } } }); }; on("chat:message", function(msg) { "use strict"; var cmdName = "!Teleport "; if (msg.type === "api" && msg.content.indexOf(cmdName) !== -1 && playerIsGM(msg.playerid)) { var cleanedMsg = msg.content.replace(cmdName, ""); var commands = cleanedMsg.split(", "); var targetName = commands[0]; var i = 1; while ( i &lt; commands.length ) { Teleporter.Teleport(commands[i], targetName); i = i + 1; } } }); var findContains = function(obj,layer){ "use strict"; var cx = obj.get('left')+(obj.get('width')/2), cy = obj.get('top')+(obj.get('height')/2); if(obj) { layer = layer || 'gmlayer'; return _.chain(findObjs({ _pageid: obj.get('pageid'), _type: "graphic", layer: layer })) .reduce(function(m,o){ if( o.get('left') &lt;= cx && cx &lt;= ( o.get('left') + o.get('width' ) ) && o.get('top') &lt;= cy && cy &lt;= ( o.get('top') + o.get('height') ) ){ m.push(o); } return m; },[]) .value(); } return []; }; on("change:graphic", function(obj) { "use strict"; if (obj.get("name").indexOf("Teleport") !== -1) { return; //Do not teleport teleport pads!! } if (Teleporter.AUTOTELEPORTER === false) { return; //Exit if auto Teleport is disabled } /* To use this system, you need to name two Teleportation locations the same * with only an A and B distinction. For instance Teleport01A and Teleport01B * will be linked together. When a token gets on one location, it will be * Teleported to the other automatically */ //Finds the current teleportation location var CurrName = ""; var location = findContains(obj,'gmlayer'); if (location.length === 0) { return; } CurrName = location[0].get("name"); var Letters = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"]; //Number of doors in the cycle (second to last character) var doorCount = CurrName.substr(CurrName.length - 2, 1); //Current Letter of the Door var currDoor = CurrName.substr(CurrName.length - 1, 1); //Finds the pair location and moves target to that location var i = 0; if( CurrName.match(/^R:/) ) { i = randomInteger(doorCount)-1; } else { i = Letters.indexOf(currDoor); if (i === doorCount - 1) { i = 0; } else { i = i + 1; } } var NewName = CurrName.substr(0,CurrName.length - 2) + doorCount + Letters[i]; var NewX = 0; var NewY = 0; var newLocation = findObjs({ _pageid: Campaign().get("playerpageid"), _type: "graphic", layer: "gmlayer", //target location MUST be on GM layer name: NewName }); _.each(newLocation, function(Loc){ //Get the new Location NewX = Loc.get("left"); NewY = Loc.get("top"); }); if (NewX === 0 ) { return; } obj.set("left", NewX); obj.set("top", NewY); }); on("chat:message", function(msg) { "use strict"; if (msg.content.indexOf("!AUTOTELEPORTER") !== -1 && playerIsGM(msg.playerid)) { if ( Teleporter.AUTOTELEPORTER === true) { sendChat("System", "Autoteleporting Disabled."); Teleporter.AUTOTELEPORTER = false; } else { sendChat("System", "Autoteleporting Enabled."); Teleporter.AUTOTELEPORTER = true; } } });
How do I go about setting this up? Do I put a token on the GM layer and name it Stair2a and then the place they would teleport Stair3a?
1429030323
The Aaron
Pro
API Scripter
Yeah, though I think the A and B need to be capitals.
1429030345
The Aaron
Pro
API Scripter
Also, I think it only works for pages where the player ribbon is, though I might have fixed that in my version, can't remember.
Ok, so Strange. I created a token named Stair2A and it's linked Token Stair2B. However when I input the names and save, the tokens move to the location of Stair2B. I can't reposition Stair2A. They are both on the GM layer
1429035409
The Aaron
Pro
API Scripter
I looked at the code, I believe it needs to have "Teleport" in the name. Sorry, not the way I would have written it. Try using "Teleport Stair 2A" and "Teleport Stair 2B".
That did the trick, thanks!
1429037199
The Aaron
Pro
API Scripter
Glad to hear it! No problem! =D
1429089425
Ziechael
Forum Champion
Sheet Author
API Scripter
Does your version above include the handy 'random' portal selection option that you developed for me Aaron?
1429195001
The Aaron
Pro
API Scripter
Yup, it is in fact the version I did for you. =D
What does "linking" include? Like linking it to a Character sheet? as in Teleport2A and Teleport2B and then binding them to the tokens on each? I'm probably overthinking this.
1429227875

Edited 1429227915
Ziechael
Forum Champion
Sheet Author
API Scripter
Linking refers to the script essentially creating a path between like-named portals, the number tells them how many portals are in the chain and the A,B etc tells the order. So if you had Tele5A through to Tele5E it would default to moving them from portal 5A to 5B, 5B would take them to 5C and so on. Note that using Aaron's edit means you can prefix the portal name with R: and get a random result on the portal output... even sending them back to the portal they just entered :)
Yep was totally overthinking, thanks Ziechael.
Cool script, but has anyone been able to get the "!Teleport" command to work properly? The only time I have been able to get it to kind of work is using "!Teleport teleport01, all", however if I have multiple teleporters it also grabs those tokens on the GM layer and teleports them to the same location... so it doesn't play well at all with the Auto Teleporter functionality. I have this idea in my head, but it doesn't quite work with this script. Think of a maze... but it's not exactly a traditional maze. More of a series of areas interconnected with teleporters. However, you want people to complete a challenge before they can access the next teleporter, in fact you may want them to complete a series of challenges. So this leads to a couple of technical challenges with this script: With random teleporters it would be great if it took all players to the same location. I thought of using the !Teleport command, but couldn't find a way to randomize that, not to mention it really seems a bit flaky. There really isn't a true one way auto teleport feature, because it generates portals... so players can go from 3A to 3B, then just turn around and go back into 3B to appear in 3C. I understand that you could choose not to create a 3C, however then you have trouble getting people back to 3A without creating another series of 1 way doors... but even doing so, the final exit has the same problem of people turning around and going back in.
The more I think about it, I believe that if I had a way to specify a series of locations (teleport01-teleportXX) then have an api command that could either specify a target teleport location or put you in a random teleport location that could work for this idea. I really like the idea though of having characters walk through the teleporter and have them appear in a random location, but there is a need to keep the group together, so I have no suggestions on how to handle that. Regarding one way teleports on 3+way portals, would it be possible to have a "Enter3A" and "Exit3A", etc... this way there is a true one way mechanism? Or am I missing something in how it could be configured to do that now? The key is that it would need to eventually lead back to "3A" entrance without created another portal.
1429512437
The Aaron
Pro
API Scripter
For the record, I didn't write this script, only cleaned up a few things and added the random option. That said, everything you've mentioned is doable, though not with this script as written. I'd probably suggest starting a new thread in API with a request, detailing out the desired features as clearly as possible.
1429516972
Ziechael
Forum Champion
Sheet Author
API Scripter
As Aaron says he added the random option for some guy who just pestered him until he caved... some people just take take take ;) It was also developed for a point in my campaign when i deliberately want to split the party up by sending them to random portals in the same dungeon and having them try to find each other again... I can totally see Kevin's refinements being an improvement though, might be worth PMing the original script author to see if they would do a new version?