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

Roof removal script

The Aaron said: Bast L. said: edit: also, my turn clock script was really rewritten by Aaron, maybe he should get credit for it :) Eh?&nbsp; What Turn Clock Script?&nbsp; I'm fine with just a mention in the comments, if you put my name on it I'll have to support it! =D (of course, I'd probably help support it anyway...) From this post:&nbsp; <a href="https://app.roll20.net/forum/post/4837139/turn-clo" rel="nofollow">https://app.roll20.net/forum/post/4837139/turn-clo</a>... Here's the current gist:&nbsp; <a href="https://gist.github.com/Bastlifa/2651519cd91276bb1" rel="nofollow">https://gist.github.com/Bastlifa/2651519cd91276bb1</a>...
1507560207
The Aaron
Pro
API Scripter
Oh yeah, that. =D&nbsp; I'm happy with a comment or no mention, no worries. =D Cheers!
So I took a roof from library, draw walls on DL layer, named the token "roof", took a character token and written !RoofReady on the chat window but when I put the character token on the roof nothing happens.
1507656524

Edited 1507656585
Bast L.
API Scripter
@Gianmarco Is the player page set to the page you're working on? I limited it to that for now, so it doesn't run through every page with every token. I think if I ever update it, it'll work on player page, lastpage for gm, and any page with a player set to it. Also, does the !RoofReady command report the number of roofs and player tokens to you? It should be at least 1 in each, or something is wrong (with your set up, or with the script).
I broght the player flag on the page where I'm testing the script, but nothing happens if I type !RoofReady on the chat window. I'm sure that my settings are wrong.
Strange. I re-copied the gist just to be sure. Also, just making sure, you're using the one that's not crossed out, right? This one:&nbsp; <a href="https://gist.github.com/Bastlifa/5a8eaa6f7259c2e9e" rel="nofollow">https://gist.github.com/Bastlifa/5a8eaa6f7259c2e9e</a>... Anyways, here's a screenshot of it from just now:
Bast L. said: Also, just making sure, you're using the one that's not crossed out, right?&nbsp; Perfect, that was the problem. Your script is awesome, thank you!
Nice. Maybe I'll just edit the original post to avoid difficulties :)
1507790881
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I just got through experimenting with the DL. I like the feature for some uses, but it would be nice to toggle it on or off. There are some scenarios where it would be nice to restrict sight, but with the DL lines being unused while the roof is active, the building can be entered from any point, leading to a player potentially accidentally entering through a wall and being unable to easily find the exit. I think in most scenarios, I'd like the players to have to move their token to a door to go in and out. Also it could be disorienting for one player entering a tavern to turn on the DL for the players who are still out on the street fighting bandits or something. I think I have enough savvy to disable that part of the script manually, but a toggle would be a nice topper, and tie together your original two optional scripts. I love this script. It can also be used for trapdoors, lighting a magic circle, revealing a hidden door, and much more. Heck, if you make your interior floorplan a rollable token, you could even have a roof from the outside, step into the first floor and have the DM reveal the second (or third, or fourth...) floor with ChangeTokenImg.
1507951993

Edited 1507952043
Bast L.
API Scripter
Hey Keith, I added a DL toggle command, or rather on and off.. maybe I should've made it a toggle. Anyways, it's explained in the comment at the top of the script. Since the script now uses 3 macros, I suggest making those three, but then using a nested macro. Well, I can't paste it, because it gets converted by the markdown thing on here. Anyways, you know the gist I'm sure.
1507955056
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Great. I'll update and play this weekend. I have three uber-macros I rely on for most of my heavy lifting, that put commonly used commands and macros into clickable roll template menus. I'll just add a section for the Roofs commands. Thanks!
Image 1 is GM vision with DL intercation set to off. Image 2 is player vision &nbsp; !RoofDLOff should remove black and let player see the Roof or have I misunderstood?
1508110840

Edited 1508110937
Bast L.
API Scripter
The DL interaction toggle only changes whether the script will modify paths on the page. When the player approaches, and the roof goes away, the Dynamic Lighting path will move to the DL layer, when he moves away, the path will move to the GM layer. If DL Interaction is off, the path will stay on whichever layer it is currently on. So, for example, if the DL path was on the DL layer, and you turn off interaction, it will stay on the DL layer.&nbsp; At least that's the intent. Also, I wanted to post an update: the script now has an optional range of interaction. It's set to be under the roof, as it was before. You can change it via command or editing the script. It depends on your rooftop's padding, but maybe 1 to 2, representing 1 to 2 squares, or 5 to 10 feet, is a good number.
1508169222
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I don't think you intended this to be a super-featured script, but at the risk of asking for the moon, here's an idea I came up with while converting my City Neighborhood map to using this script. For "City Exploration" type games, would it be possible to have tokens with some identifying feature (name, controller, status,... something), so that they would do the opposite of the roof? I.e. when the roof disappears, they appear? You could populate an entire city section in this way.
That kinda seems like a necessary feature of the script, since it puts the roof on the map layer. I hadn't thought about that. One way would be to set every token that isn't assigned to someone, which is under the roof, to the gm layer until the roof is removed, then move them all to the GM layer. The obvious problem is that it will move hidden tokens from the GM layer to the object layer when the roof is removed. Optionally, I could set it to not interact with tokens which have "hidden" or something in GM notes (once I figure out how to check GM notes). The simplest way would be to just move the roof between the Object Layer and the DL Layer, and not worry that it's off the map layer. I'll take a look at doing this in some way later.
1508198763
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
How about this as an order of operations: PC within roof area Roof goes from Map to DL NPCs go from DL to Object Layer No PC&nbsp;&nbsp;within roof area Roof goes from DL to Map NPCs go from Object to DL Some commands which would help setup !Roofready - does what it already does, but also checks for (NPC) tokens flagged with whatever criterion you choose. Plus note at end. !Hideroofs - moves all roofs to DL !Showroofs - moves all roofs to Map layer !Hide NPCs - moves all NPCs within roof areas to DL !Show NPCs - Moves all NPCs to Object layer The last four commands would help GMs to work on roofs or NPCs by hiding one or the other. Then !Roofready would basically do what it does as described above, but also do the equivalent of !Showroofs and !HideNPCs to set the map for player interaction.
1508376718

Edited 1508377092
Great script! :D just one question: for me it is best to have rooftops at the object layer, as most npcs are there too and I do not want for them to show up on top of the roof. I already tweaked the script to flip between DL and Objects Layer, but do you think it would create any problems otherwise? btw I will not use Dinamic Lightning for city hubs, only for the wilderness/dungeons.
I think it won't cause issues. I was working on switching it to object layer instead of map, but I also refactored the code to clean it up. Something I did screwed it up, so I won't update the script until it's fixed.
Plan to use this one day for sure... i would indeed love the roof gone and token appear for NPC tokens using a gm note or nameplate of Show/Hide.&nbsp;
Well, I think the gm notes stuff may work here, but I commented that whole thing out and went with the method of putting the roof on the object layer and bringing it to the front. The gm notes part is mostly done though, so it shouldn't be too much work if someone wanted to modify it (update the Roof-Command macro, uncomment the gmnotes area, uncomment the bits in remove and restore roof, and send the roof to map layer, instead of object). Anyways, here's the latest. I won't update the main gist, in case this is not what people prefer. It uses state to remember the range and DL interaction preference. It also makes 2 macros, though you only need to put the Roof-Command macro in your bar. To use it: save the script, go to chat, hit !RooftopCommands to make your macros, and put the macro in your bar. On any page, hit roof ready, set your ranges and DL preference, and you should be good to go. You only need to set the preferences if you want it different than default, or whatever you last set it as. Latest Gist:&nbsp;&nbsp; <a href="https://gist.github.com/Bastlifa/1b5f78939ba5b4072" rel="nofollow">https://gist.github.com/Bastlifa/1b5f78939ba5b4072</a>...
1510976860
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thanks, Bast L.!