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] ScenarioSwitcher

1522019148

Edited 1523113100
Welcome everyone, welcome to the home of ScenarioSwitcher! Imagine an overview map of a town with a token for the party. and once you click on a button, what you were seeing disappears and the image of a tavern is there instead. and you click another button and back to the map you go - the token for the party back to where you left it. then the party moves along the overview map towards the market, and at the press of a button, everyone sees a top-down view of the market, and a bunch of merchants. and all of this happens in the same page, quicker than you can say tnetennba. Or maybe you have a map in a city with multiple height levels. as the party is on a roof, they will see what is below as well as the roof across the street (that is at the same height as their position). as they descend to a lower balcony the roof across the street will no longer be completely visible.&nbsp;Here the&nbsp;dynamic light layer paths were changed, with one button press. No more&nbsp;moving tokens all the time, no dynamic light that is completly static, no 3 versions of the same page cluttering up your campaign. Sound good? then this script might be a good fit for you! QUICK FUNCTIONALITY INFO * This Script allows for a quick change between different scenarios in a map: this means that you can quickly make visible one of many combinations of tokens in your map, if you prepare these combinations in advance. * This includes changing the paths from the dynamic light layer, making things visible/hiden with ease. * Combine scenarios at will! * Main limitation: This script needs the token bar 1 to work. this means you can only use it with tokens that are not using bar 1 for anything else. you can use bar 1 on any tokens that are not flagged to be changed by this script though. * The flagged elements will be switched between the dynamic light layer and the other layers, creating clean looking abundance of possibilities. A VIDEO EXAMPLE OF THE SCRIPT IN ACTION A video has been created to show how the script works after being set-up. Use the time stamps of the video to get a very quick idea about how the script works. <a href="https://youtu.be/hmULjEdofWU" rel="nofollow">https://youtu.be/hmULjEdofWU</a> GUIDES TO THE SCRIPT There are two video guides available and two written guides. The video guides are meant to be very simple to follow and explain all the essentials - but this makes them quite long. also, updating video guides is quite time consuming, so these should be considered outdated references. I suggest reading the basic written guide and using the videos if any questions arise. The second written guide is meant for more advanced uses of the script.&nbsp; The basic written guide can be found under: <a href="https://app.roll20.net/forum/permalink/6223040/" rel="nofollow">https://app.roll20.net/forum/permalink/6223040/</a> There are time-stamps on all the videos, to help you skim through the info. I suggest watching the videos at 1.5x speed, as it cuts the time by a good deal and everything is still understandable. These videos should be considered references that are a bit outdated, as creating new videos is very time consuming. The video guide for setting up token switchers can be found under: <a href="https://youtu.be/TCPH_s5p-rc" rel="nofollow">https://youtu.be/TCPH_s5p-rc</a> The video guide for setting up dynamic light paths switchers can be found under: <a href="https://www.youtube.com/watch?v=rxjLDgoITlo&" rel="nofollow">https://www.youtube.com/watch?v=rxjLDgoITlo&</a> The advanced written guide can be found under: <a href="https://app.roll20.net/forum/post/6251757/guide-sc" rel="nofollow">https://app.roll20.net/forum/post/6251757/guide-sc</a>... INSTALL INSTRUCTIONS 1. add API to library - this means create a New Script, paste in all the code, save script 2. inside your game, send the following to the chat: !ScenarioSwitcherSetup 2a. if you want, a couple of example tokens will appear in the map with the player ribbon by sending the command !ScenarioSwitcherExampleToken (2a cont.) please save the script once more after the example tokens are set-up. 3. the script is now set-up and ready to use. a necessary character was automatically created in this setup. LINK TO SCRIPT Current Version: v1.5 Please consider that updating from previous versions to v1.4+ requires running set-up again. For this, simply follow the instructions above one more time. The Script code can be found under: <a href="https://gist.github.com/gui8311/77b67b3687b8f8fba54c446ff7026337" rel="nofollow">https://gist.github.com/gui8311/77b67b3687b8f8fba54c446ff7026337</a> KNOWN ISSUES 1) Deleting the ScenarioSwitcher from the Journal will detach all command tokens from this character. This stays like this, even after the character is created again, which would require to manually re-link all command tokens. In a future update I plan to include a way to mass re-link all command tokens. For this future step I recommend naming the token with the format: ScenarioSwitcher* [the name you want] An Example would be: ScenarioSwitcher* Castle of the Bat For now I suggest never deleting the original ScenarioSwitcher character - if there are problems with it they should be originating from the macros; from v1.4+ just run the setup again, and your ScenarioSwitcher character should be reverted to its default state, with no unlinking happening. I am sorry for the hassle of renaming all Command Tokens. It is not obligatory, it never will be - but it will allow me to implement this valuable safety net functionality in the future and if you do not re-name your tokens you will forgo this functionality. Nothing of the sort will ever be asked of users again. FEEDBACK AND QUESTIONS All Feedback and questions are welcome. Post here, or if this thread gets closed create a new post and add [gui8312] and [ScenarioSwitcher] to the post so that I can find it easier :) VERSION LOG **V1.0.0 * Release **V1.1.0 * Script now allows for changing dynamic light borders on the go! **V1.2.0+V1.3.0 * Major overhaul simplifying usage of the script drastically. New Formatting required. * Deleted old ScenarioSwitcher Forum Post, because of a bug in the Forums. **V1.3.1 * changed token-setup-reference macro, to be clearer. **V1.3.2 * small stability fix, protecting from wrongly set-up command tokens. **V1.4.0 * stability fix, correcting a problem with unreliable setup. * the symbol / no longer poses a problem when used in flags or descriptions. * please re-run setup if updating to this version from a previous one. **V1.5.0 * A new option has been added: tokens can be sent to a chosen layer, individually. * Unexpectadly fixed the bug with the symbol ] rendering tokens unresponsive. * Added an advanced guide.
1522026577
Pat S.
Forum Champion
Sheet Author
Looks very interesting. Do you have a short video of it in action?
1522026752

Edited 1522158497
thanks :) EDIT: There is a video guide, set up as a playlist. the first video is showing the script in action. the two other videos show how to set up you own scenarios.&nbsp; There are time-stamps on all the videos, to help you skim through the info. I suggest watching the videos at 1.5x speed, as it cuts the time by a good deal and everything is still understandable. The link is the following: <a href="https://www.youtube.com/playlist?list=PLB5a4VR0RQ" rel="nofollow">https://www.youtube.com/playlist?list=PLB5a4VR0RQ</a>...
1522027469
GiGs
Pro
Sheet Author
API Scripter
Your link seems truncated.&nbsp; This looks like the correct one . This is a very intriguing script, I'd love to see it in action too.
1522027696

Edited 1522029185
@G G Thank you! link fixed.
1522072363

Edited 1522158286
Created a video showing how the script works. The description of the video has a few timestamps that quickly show you the switches in action. It can be found under: <a href="https://youtu.be/hmULjEdofWU" rel="nofollow">https://youtu.be/hmULjEdofWU</a>
1522076441
GiGs
Pro
Sheet Author
API Scripter
That looks great. The intro post is very tantalising and tells is what can be done, but it doesnt do a great job of telling is how to do it. What is the text of the macros you used in the video? The intro post mentions switching tokens back and forth from GM layer. How do you flag a token to be controlled by this script?
1522076970

Edited 1522077762
alright noted, will look into updating it! The macros used in the video are added when you install the script, and they are kind of hard to make sense of without understanding the script well. That is why I did not write them into the post. They are: ** Macro 1: .Switch !ImageSwitcher @{selected|bar1|max}/?{Which image is to be loaded?|@{selected|bar1|max}} ** Macro 2: Token-Setup-Reference Ex. Bar 1, Token: ImageRedtusk1 Ex. Bar 1, CommandToken: object_layer OR map_layer OR empty OR #DL# &nbsp; Ex. Bar 1 max, CommandToken: Redtusk Overview map ,redtuskOverview| Drawn image Redtusk Houses ,ImageRedtusk1| image description 3 ,-| image description 4 ,-| image description 5 ,- I did go into flagging in the post, I thought that explanation was clear. gui8312 said: * Time to create the appropiate flags and descriptions, by setting up the Command Token. I opened the ScenarioSwitcher command token. The bar1 max value is: A Gryphon attacks ,Gryphon_| A Goblin Squad appears! ,3Goblins| image description 3 ,-| image description 4 ,-| image description 5 ,- I changed it to: It is snowing. ,Snow_| A myst forms... ,Fog_| It is raining a lot. ,Rain_ As I want the weather effects to appear in the map Layer I changed the bar1 value to: map_layer * Now we will flag all the tokens that are meant to be switched. For the snow scenario, we set the value of bar1 to Snow_, for the snow token. For the fog scenario we set the value of bar1 to Fog_, for the fog token. Analog case for the rain scenario.
1522079538
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
This is looking more and more intriguing the more I look at it. Pardon my ignorance, but what does "analog case" mean? Does it just mean that you are about to show us a picture or demonstration rather than text?
1522080003

Edited 1522080076
@keithcurtis thanks :)&nbsp; analog comes from analogy, so it means that: for the rain scenario we set the value of bar1 to Rain_, for the rain token.&nbsp;I am not a native english speaker, maybe this is not a frequent expression in english. Probably will switch it out to keep things simple.
1522087709
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
No need to apologize.I speak 3 years of French from 35 years ago very poorly, so anyone who makes an effort to speak my language has my full support and admiration. A good English term to use for this would be "Example:" or "Here is an example".
Hey gui8312: Wow man, this looks really cool and would help alot, it could do wonders to my games. I saw your video and is really cool the many things that are posible to do. I do wonder if you could do an instruction video on how to use it, as i am having really hard to understand how everything work with just the pictures. Let me tell you again i think this script is fantastic :) Danny
1522093882

Edited 1522162507
@keithcurtis will change it soon then :) I had a problem with the original post here on this thread but it seems to be fixed now, that is the actual reason why I did not update it until now. Things being easy to understand is my main goal. EDIT: finnallyable to edit my initial post. @Danny C. Thank you for the support! I will work on creating a new video, probably tonight. When I create a script I focus on it a lot at the beginning to make use of suggestions and feedback, as well as keeping the post trending as long as possible. There are too many things that are not easy to see for yourself, so having a community look at your work is so valuable. again, check this thread in a few hours, a vid should be up soon.
1522094792
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thanks gui8312. This script promises to do a lot of things I would normally use token-mod for, but more automatically (I love the drop down menu) and with a few more options, (like the dynamic lighting control).
1522107743

Edited 1522157469
a new video is out! It shows you how to set up a token scenario from scratch. this one is a bit longer, as it explains things so they are simple to follow. I suggest watching it at x1.5 speed. The description of the video has a few timestamps that help you quickly find the info you need. As you get used to the process setup becomes quite fast, in my experience. The video can be found under:&nbsp; <a href="https://youtu.be/TCPH_s5p-rc" rel="nofollow">https://youtu.be/TCPH_s5p-rc</a>
1522155830

Edited 1522158561
and the last video is out too. This is a guide for setting up DL path switchers from scratch. Again Timestamps help you skim thorugh the video.&nbsp;I suggest watching it at x1.5 speed. Link to video:&nbsp; <a href="https://youtu.be/rxjLDgoITlo" rel="nofollow">https://youtu.be/rxjLDgoITlo</a> EDIT: everything is now neatly bundled in one playlist:&nbsp; <a href="https://www.youtube.com/playlist?list=PLB5a4VR0RQ2" rel="nofollow">https://www.youtube.com/playlist?list=PLB5a4VR0RQ2</a>...
thx gui
hope it makes things easy to follow :)
Looks good!&nbsp; One question i have based on the first intro video...You have a color representing what kind of "action" you want preformed (specifically for dynamic lighting). You have Red for opening up paths, for secret paths/doors. Does that mean if i make ALL my doors/paths the same color, they ALL get switched?&nbsp;&nbsp; And if so, that would mean i would have to make all my doors on the map all different colors so they all don't get switched/opened at the same time right? Thanks!
1522252469
GiGs
Pro
Sheet Author
API Scripter
That's correct, the colour is how the script knows which paths to pick. The actual colour is unimportant since the players never see it, so using different colours to distinguish paths with different purposes has always been a good practice.
Thanks G G! :)
1522262037
GiGs
Pro
Sheet Author
API Scripter
I added a textual guide to using the script in the&nbsp; Guide thread .
1522263219
GiGs
Pro
Sheet Author
API Scripter
Some comments and suggestions The Duplicate Command Token issue: I'm pretty sure you can identify which page is active (where you are triggering the script), so you should be able to use that when filtering down to which command token to use. That would eliminate issues about duplicate command tokens.&nbsp; Using bar1: &nbsp;I cant really use the script because all 3 bars are in use already in my current game. But it seems like it could be adjusted to not need it. The way dynamic lighting switching works, you use a property of the path and don't need to set a bar1 value.&nbsp; Command Tokens can have Attributes, and you could set up an Attribute Naming structure in such a way to replace use of bar1 on both command tokens and ordinary tokens. this would let you create a single command token that functions in place of them multiple ones you need already. Then just need to to figure out a property of tokens to use in place of the bar. You could use token names, and store them in the attribute on the CommandToken. You could even use parts of token names. For instance, on the commandtoken you might have an attribute: "TokenValue1" and as a value, enter, "Bandit,Bear" and the script could search for all tokens on the GM layer and current page with Bandit or Bear in their name, or maybe use the represents field in place of the name, which is a good way of finding groups of similar tokens. You can also have a token action to create and remove the attributes you need for the script to work, so it would be even more userfriendly than editing the bars. I'll think some more on how to approach this, as I might hack the script to use it in this way for my own game.
G G said: I added a textual guide to using the script in the&nbsp; Guide thread . again, this is great! I might want to use this guide for the official descirption of the script. gonna get back to you in a sec.
1522270140
GiGs
Pro
Sheet Author
API Scripter
Feel free! If you see any errors, or things that might cause misunderstandings, let me know and I'll clean it up.
G G said: Some comments and suggestions The Duplicate Command Token issue: I'm pretty sure you can identify which page is active (where you are triggering the script), so you should be able to use that when filtering down to which command token to use. That would eliminate issues about duplicate command tokens.&nbsp; This sounds really interesting... I had no idea about this possibility. I just did not want to limit it to the page with the player ribbon, and I did not know about other possibilities. Something to consider including in the script :) Using bar1: I cant really use the script because all 3 bars are in use already in my current game. But it seems like it could be adjusted to not need it. The way dynamic lighting switching works, you use a property of the path and don't need to set a bar1 value. Command Tokens can have Attributes, and you could set up an Attribute Naming structure in such a way to replace use of bar1 on both command tokens and ordinary tokens. this would let you create a single command token that functions in place of them multiple ones you need already. Then just need to to figure out a property of tokens to use in place of the bar. You could use token names, and store them in the attribute on the CommandToken. You could even use parts of token names. For instance, on the commandtoken you might have an attribute: "TokenValue1" and as a value, enter, "Bandit,Bear" and the script could search for all tokens on the GM layer and current page with Bandit or Bear in their name, or maybe use the represents field in place of the name, which is a good way of finding groups of similar tokens. You can also have a token action to create and remove the attributes you need for the script to work, so it would be even more userfriendly than editing the bars. I'll think some more on how to approach this, as I might hack the script to use it in this way for my own game. I am not sure how you would pull this off. the script is built like this to acommodate token and charaters being switched. but tokens have a few limitations: they have way less fields, and what is even worse they have even less fields that can be acessed by macros. now with what you said I could seethe possibility of having the tag on the gm notes, but even that might be impossible to do. and at least the command tokens would still need bar1 to be used. If you find a way to modify the script to avoid using bar1 and still have a user friendly interface, tell me.
@G G I have written a corrected version of the guide:&nbsp;<a href="https://app.roll20.net/forum/permalink/6229492/" rel="nofollow">https://app.roll20.net/forum/permalink/6229492/</a>
1522296475

Edited 1522296498
G G said: That's correct, the colour is how the script knows which paths to pick. The actual color is unimportant since the players never see it, so using different colors to distinguish paths with different purposes has always been a good practice. Yeah i get that, but if i have a place with lots of doors, instead of just using a color for "walls, and doors" , using this script, i would have to do "walls, door1, door2, door3, door4...." edit: spelling
1522301313
GiGs
Pro
Sheet Author
API Scripter
Yes, but that's not really hard. Roll20 does have an easy color picker. In practice, if you have a lot of doors and they are only single items, it's probably simpler to do them manually than using this script. But if you have sections with linked dynamic lights (like the example in the video), it can make sense to use the script.
1522321048

Edited 1522339644
@Terelle S. The script can switch 100s of scenarios within one single page, and having many individually switchable doors is a possibility. &nbsp;But it does require some work for setup and load times for the map will increase noticeably as the number of scenarios in one single page goes way up. When I designed the script I did not see this as a problem as I had in mind scenarios that are quite complex, and therefore clearly worth the setup work. Stuff like making a map look completely different for different quests, or having interactive city maps, or working with multiple height scenarios, or major events like a tunnel collapsing. Things very hard to do safely and quickly during a session, if you do them manually. I think your question is also about game design: is it that important that players cannot see through the doors? Maybe some fog of war would actually remove the need for the setup. And if you still want the doors that are actually opaque, do they need to be switched individually? Maybe the map also works&nbsp; by opening multiple rooms at a time, or maybe each time the players enter a room the door they just came in closes (with the right design and alternating colours this could drastically reduce work load).&nbsp; Or, with some care, switch each door manually, which in this scenario is not that much work compared to the alternative. But disabling a room wall instead of a door with a missclick could be a problem.
1522538833

Edited 1523110805
There are a few known issues with the script right now. Please read at least the second one, it will be important in the future. EDIT: Not an issue anymore after v1.5! :) 1) Using some symbols in descriptions or flag values in a command token can make that token unresponsive. I will try to fix this soon, but some of these might take some time. the following are known to have the potential to make the script unresponsive: ] 2) Deleting the ScenarioSwitcher from the Journal will detach all command tokens from this character. This stays like this, even after the character is created again, which would require to manually re-link all command tokens. In a future update I might include a way to mass re-link all command tokens. For this future step I recommend naming the token with the format: ScenarioSwitcher* [the name you want] For now I suggest never deleting the character - if there are problems with it they should be originating from the macros; run the setup again,&nbsp;and your ScenarioSwitcher character should be reverted to its default state, with no unlinking happening.
1523109643

Edited 1523112883
Update, v1.4 and v1.5 1) The most exciting change: &nbsp;tokens can now be sent to a chosen layer, independently of the default layer for the Command Token. This means that one single command token can send tokens to multiple layers. More on that can be found on the new advanced usage guide, which can be found here:&nbsp; <a href="https://app.roll20.net/forum/post/6251757/guide-sc" rel="nofollow">https://app.roll20.net/forum/post/6251757/guide-sc</a>... The most limiting known issues have also been fixed! 2) Please re-run setup if updating to v1.4+ from a previous version. For this, follow the new&nbsp; instalation steps . 3) I also suggest naming all existing CommandTokens in the Format: ScenarioSwitcher* [the name you want] An Example would be: ScenarioSwitcher* Castle of the Bat I am sorry for the hassle of renaming all Command Tokens. This is optional though. It will allow me to implement a valuable safety-net functionality in the future that protects users from breaking their own command tokens.&nbsp;If you do not re-name your Command Tokens you will forgo this functionality, but the script will still work. Nothing of the sort will ever be asked of users again. Check the&nbsp; Known Issues for more information. Version Log Entries **V1.4.0 * stability fix, correcting a problem with unreliable setup. * the symbol / no longer poses a problem when used in flags or descriptions. **V1.5.0 * A new option has been added: tokens can be sent to a chosen layer, independently of the default layer for the Command Token. This means that one single command token can send tokens to multiple layers. * Unexpectadly fixed the bug with the symbol ] rendering tokens unresponsive. A big thanks to The Aaron for taking the time to help me with this error. * Added an advanced guide. It can be found here:&nbsp; <a href="https://app.roll20.net/forum/post/6251757/guide-s" rel="nofollow">https://app.roll20.net/forum/post/6251757/guide-s</a>...
Possible upcoming features: Planning to create hybrid tokens, changing tokens and DL paths in one go.