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] DnD 5e Loading Screen

Hi guys I put together a "loading screen" to put up when the DM is busy. The text changes periodically. You can get the prototype here . It is configured for DnD 5e (Hints include 5e specific rules) but you can configure it to any system by changing the array of text. Demo:
1412287894

Edited 1412293123
This is really cool, too bad there's not 4e tips, I don't really feel like writing a bunch. Cool concept though! Edit: Actually, I'm going to compile a list of 4e ones. Will update this post.
1412294252
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
+1
+1 indeed!
1412300022
Gen Kitty
Forum Champion
That's adorable.
Jarret B. said: This is really cool, too bad there's not 4e tips, I don't really feel like writing a bunch. Cool concept though! Edit: Actually, I'm going to compile a list of 4e ones. Will update this post. If you compile one I'd be happy to push up a 4e alternative on the github repo.
+1
1412322835

Edited 1412325887
Hey, so I started working on the 4e list, and I wanted to include all of the conditions. However, I'm a stickler for formatting. This is what I wanted them to look like: When a creature is Blinded: - They can’t see, which means its targets have total concealment against it. - They take a -10 penalty to Perception checks. - They grant combat advantage - They can't flank. - They can't have combat advantage on anyone. However, when I tried to do this (after searching for how to do a newline with javascript, and finding \n), I found that there were still seemingly arbitrary newlines thrown in there. I came to the conclusion that you put it in there to automatically format the hints so that each line was no longer than a certain length. I changed the numChars variable to 1000 and this solved the issue. However, I wanted to know if this causes massive problems down the road, if you want me to find a different way to format them, or if you have a different solution. Here's what I used, just in case you wanted to see: /* To use: 1. Create a page called "Loading" 2. On the object layer create a textbox */ on("ready", function(obj) { var displaySpeed = 10000; var numChars = 1000; var tips = [ "When a creature is Blinded:\n- They can’t see, which means its targets have total concealment against it.\n- They take a -10 penalty to Perception checks.\n- They grant combat advantage\n- They can't flank.\n- They can't have combat advantage on anyone.", ]; Everything else stayed the same. Edit: Out of curiosity, the hints aren't in order, are they?
Exactly how does the loading screen work? Does it replace the loading screen when players are being moved from page to page or does is it just another page? (IIwould try to test this for myself but im out and about for a while)
It's just a page he created. It does not altar any of the Roll20 splash/loading screens .
1412347187
The Aaron
Pro
API Scripter
Jarret B. said: [...] However, when I tried to do this (after searching for how to do a newline with javascript, and finding \n), I found that there were still seemingly arbitrary newlines thrown in there. [...] Everything else stayed the same. Edit: Out of curiosity, the hints aren't in order, are they? The reason for the seemingly arbitrary wrapping is that the script is inserting carriage returns after every so many characters (35), which means they will be interspersed within your manually added carriage returns. I would change the setInterval call to this following code: var UpdateWithNewTip = function() { var currentPage = getObj("page", Campaign().get("playerpageid")); var pageName = currentPage.get("name"); if(pageName != "Loading") return; var text = findObjs({ _type: "text", _pageid: currentPage.get("_id"), layer: "objects" })[0]; var pickone = randomInteger(tips.length) - 1; var formattedText; var formattedLines = []; _.each(tips[pickone].split(/\n/),function(l){ formattedText = ''; _.each(l.split(''),function(c){ if(formattedText.length > numChars && ' ' === c) { formattedLines.push(formattedText); formattedText = ''; } else { formattedText += c; } }); formattedLines.push(formattedText); }); formattedText=formattedLines.join("\n"); text.set("text", formattedText); log( "new tip: "+ text.get("text")); } UpdateWithNewTip(); setInterval( UpdateWithNewTip, displaySpeed); //take an action every 5 seconds This will allow you to pre-format tips by inserting carriage returns (\n), and still get larger lines wrapped at a boundary (numChars). The tips are displayed in a random order. I also changed it so that you don't have to wait 10 seconds for the first change in tip on restarting the script and changed the picking logic to use randomInteger(), based solely on the aesthetically simpler resultant code.
@Aaron: Thanks a lot, I incorporated your changes in the script I also made the script a bit more user friendly. It now creates a textbox when there is none already present. It also warns you if there is no page in the campaign that matches the targetPageName
1412462935
Kevin the Barbarian
Pro
Sheet Author
API Scripter
This (your just updated version and the previous one) just seems to do nothing for me. Tried it with and without text boxes. Tried it with and without the page being there and didn't get a warning. Any ideas on debugging it on my end?
1412464338

Edited 1412465538
Try this. Create a blank page Titled "Loading" (capitalized) Create a single textbox on that screen and put some dummy text inside like "Placeholder" Drag the Red "Players" flag to the "Loading" page Restart the script. If that doesn't work, id be more than happy to help you debug it. Edit: I uploaded a new version that allows easy debugging, and makes Players being on the loading page optional.
1412473515
Kevin the Barbarian
Pro
Sheet Author
API Scripter
Right...um... yeah.... I guess I didn't move the Players flag over the times I tried it. So, um.... works great! Thanks for making this. I was going to go through the trouble of using different images I saw off Reddit. This is much better!
Hey, My campaign is switching over to 5E, so I won't be making a 4E version.
1412724490
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Kevin said: Right...um... yeah.... I guess I didn't move the Players flag over the times I tried it. So, um.... works great! Thanks for making this. I was going to go through the trouble of using different images I saw off Reddit. This is much better! Where on Reddit?
1412724732
Kevin the Barbarian
Pro
Sheet Author
API Scripter
<a href="http://www.reddit.com/r/DnD/comments/2h79di/when_i_stop_the_game_momentarily_to_set_up_the/" rel="nofollow">http://www.reddit.com/r/DnD/comments/2h79di/when_i_stop_the_game_momentarily_to_set_up_the/</a>
1412725613
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
The "achievements" in that thread are nice.
1413306501
Kevin the Barbarian
Pro
Sheet Author
API Scripter
Michael, this script seemed to break at some point during a 5 hour session. I never got the chance to show it to the players but other scripts stopped working and only started again once I disabled this one.
1413811085
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
I used a variation of this script for an humorous and annoying "Magic Mouth." It was rather fun.
1413812308
The Aaron
Pro
API Scripter
Cool!
1414546570

Edited 1414546585
Looks great, thanks for sharing =)