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

1595633635

Edited 1595973810
Kurt J.
Pro
API Scripter
Interactive Map Companion Development GIST:&nbsp; <a href="https://gist.github.com/kjaegers/c5568730afb9ce2b45bfbafdfe8951fd" rel="nofollow">https://gist.github.com/kjaegers/c5568730afb9ce2b45bfbafdfe8951fd</a> (Note: InteractiveMapCompanion is not on Roll20's One-Click installer at this time) Updates V 1.0.2 (2020-07-24) - Initial release Introduction This API script was inspired by&nbsp; This Video &nbsp;by Nick Olivo (You should check out&nbsp; Nick's Channel &nbsp;- he has a number of well done Roll20 videos). In the video, Nick demonstrates using tokens with a special macro to create a world/area map that players can select to get information about the various locations you have defined. I really like the idea behind this system, but the setup for each token takes a number of steps and a little time. When I started building a map like this for the new campaign I'm working on, I decided that I needed an API script to automate some of the setup process, and InteractiveMapCompanion was the result. (The included default macro will produce chat output as above) Note that the provided macro is intended to be non-game and non-sheet specific - it should work in any game. That doesn't mean you need to use it, however. You can replace the contents of the macro to customize the look and feel of your POI details. Personally I use a PowerCards macro for my game. Requirements You'll need a character in your campaign called "Map Handler Dummy", and it should be controllable by all players (doesn't need to be in their journals). The character should have a token action that displays the location summary. Fortunately, this can be set up automatically by the script by running " !imc createdummy ". (Sample area map with map pins. Phandalin is "Discovered" while the others in the area are not) Creating Map Pins The process below would be used to create a single map pin. I normally drag out all of the tokens first, set the Represents and Name, and then use the !imc list command and it's buttons to do everything else):&nbsp; Drag a graphic out onto your map (I quite like Nick's method of creating a rollable token and setting the sides - I'm even using the same Skyrim icons on my map).&nbsp; Double click the token and set it to represent "Map Handle Dummy" Give the token a name describing the location (ie, Phandalin) Close the token details window Keep the token hilighted and type "!imc describe " followed by the short description text for your map pin Either: Type "!imc createhandout Token Name" (case sensitive) in the chat window or Type "!imc list" in the chat window and click the "Fix" button next to the name of your map pin Type "!imc list" and click the scroll next to your map pin to open the handout and fill in details. Commands to Use While Working on Your Map There are a handful of commands that can assist while setting up your map: !imc showall &nbsp; &nbsp; Moves all map pin tokens to the Token layer for easy editing !imc hideall &nbsp; &nbsp; Moves all map pin tokens to the GM layer !imc setlayers &nbsp; &nbsp; Moves discovered map pins to the token layer and undiscovered map pins to the GM layer. Commands to Use During Play The easiest thing to do is run "!imc list" to display the list of map pins and select the buttons from there: Clicking the magnifying glass will "Discover" the location for your players. Clicking the construction sight (best emoji I could come up with) will cause your players to "forget" about the location. Clicking the scroll will open the associated handout for you to view/edit. Alternative to clicking on the icons on the list, you can: !imc discover&nbsp; &nbsp; &nbsp; Will operate on selected tokens OR &nbsp;include the (case sensitive) name of the map pin (This is what the magnifying glass runs). !imc forget &nbsp; &nbsp; Will operate on selected tokens&nbsp; OR &nbsp;include the (case sensitive) name of the map pin (This is what the construction sign runs). Suggestions I have a bottom bar macro for "!imc list" so I can pop it up whenever I need it... Since this command covers most of the uses of the script, I generally don't need to bother with the other commands. I use Token-Lock and a modified version of a script created in another one of&nbsp; Nick's videos &nbsp;to trigger token-lock when I move the player ribbon to my world map page (or any other page I'm using the IMC on). I also use this script on my landing page and on town maps for both locations and for details of important NPCs the players have met. Notes As always, feedback, bug reports, or suggestions for improvements are always welcome.
Whoa, whoa. This looks amazing. Will dive in and try out as soon as I'm able.
1595648075
The Aaron
Roll20 Production Team
API Scripter
Super nice!
1595692782
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I like the automatic token-lock when moving the player flag. I currently manually lock all of mine. I also really like the chat list functions.
Just tested it out this afternoon. Really nice! I have a couple of questions/requests. Where does the short description of the token appear? When I highlighted my test map pin and ran the !imc describe &lt;text&gt; command, I didn't receive any update from the script in the Chat window. So I'm wondering a. if it worked and b. where that description actually goes, in terms of players being able to see it. Would it be possible for the script to use one of the OGL roll templates? The current display is rather small. Or maybe, down the line, make that display configurable? I dunno, just a thought.
1595702484
GiGs
Pro
Sheet Author
API Scripter
Jay R. said: Would it be possible for the script to use one of the OGL roll templates? The current display is rather small. Or maybe, down the line, make that display configurable? I dunno, just a thought. If rolltemplate is changed, it should be a configurable option. Right now the script is I think usable by anyone, but linking it to a specific sheet's rolltemplate would restrict it to be only usable by users of that sheet.
GiGs said: Jay R. said: Would it be possible for the script to use one of the OGL roll templates? The current display is rather small. Or maybe, down the line, make that display configurable? I dunno, just a thought. If rolltemplate is changed, it should be a configurable option. Right now the script is I think usable by anyone, but linking it to a specific sheet's rolltemplate would restrict it to be only usable by users of that sheet. Yes, you're right. It should be configurable.
1595703837

Edited 1595703943
Kurt J.
Pro
API Scripter
Jay R. said: GiGs said: Jay R. said: Would it be possible for the script to use one of the OGL roll templates? The current display is rather small. Or maybe, down the line, make that display configurable? I dunno, just a thought. If rolltemplate is changed, it should be a configurable option. Right now the script is I think usable by anyone, but linking it to a specific sheet's rolltemplate would restrict it to be only usable by users of that sheet. Yes, you're right. It should be configurable. GiGs is spot on... the createdummy uses the default template because it should work for any game/sheet. However, the macro that it creates can be freely edited/replaced by going to the Abilities tab of the "Map Handler Dummy" character. I use a PowerCard for the macro that ends up looking something like this: but I didn't want to create a dependency on PowerCards for the IMC. I particularly like doing it this way though because I can replace the bar3 value with a link to another image for particularly important tokens (like Phandalin) and get something more interesting like this: both images are generated by the same PowerCard macro which, if you are interested is: !power {{ --inlinereplace|NAME|@{selected|token_name};IMAGE|@{selected|bar3};HANDOUT|@{selected|bar2};DESC|@{selected|bar1} --name|~NAME$ --bgcolor|#76323f --leftsub|Discovered Location --!desc|~DESC$ ~R[x](~IMAGE$)~R --!more|[Click here to learn more about ~NAME$](~HANDOUT$) }} but that's totally optional and just what I'm using in my own game.
Thanks for the info, Kurt!
Hey Kurt. This is great but I am having a few issues. First, the " !icm describe My Details go here " command doesn't populate the description into the icon. it ends up blank. Second, the " !imc list" command doesn't seem to work for me. I only get a bar that says API: in the chat window.&nbsp;
1595973898
Kurt J.
Pro
API Scripter
Mykal said: Hey Kurt. This is great but I am having a few issues. First, the " !icm describe My Details go here " command doesn't populate the description into the icon. it ends up blank. Second, the " !imc list" command doesn't seem to work for me. I only get a bar that says API: in the chat window.&nbsp; There was a typo in my original post above... !icm describe should be !imc describe :) When running the list, have you set your tokens to represent "Map Handler Dummy" and given them each distinct names? And is your player ribbon on the page you are working on as the GM?
that was it. player ribbon was on a different page
Fantastic script, Kurt. Thanks for sharing.
Kurt J. said: However, the macro that it creates can be freely edited/replaced by going to the Abilities tab of the "Map Handler Dummy" character. I use a PowerCard for the macro that ends up looking something like this: but I didn't want to create a dependency on PowerCards for the IMC. I particularly like doing it this way though because I can replace the bar3 value with a link to another image for particularly important tokens (like Phandalin) and get something more interesting like this: both images are generated by the same PowerCard macro which, if you are interested is: !power {{ --inlinereplace|NAME|@{selected|token_name};IMAGE|@{selected|bar3};HANDOUT|@{selected|bar2};DESC|@{selected|bar1} --name|~NAME$ --bgcolor|#76323f --leftsub|Discovered Location --!desc|~DESC$ ~R[x](~IMAGE$)~R --!more|[Click here to learn more about ~NAME$](~HANDOUT$) }} but that's totally optional and just what I'm using in my own game. This is probably more of a Powercards question. The default look is just fine but I can't make the powercard template work. Is there any replacement or something I should create to get that nice look above?