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] Deadlands Reloaded - RandomEncounterGenerator

This is my first attempt at a roll20 script, so be gentle. I started with this script as an example (credited to 'anonymous'): <a href="https://gist.github.com/anonymous/fcd266e17d903e1f" rel="nofollow">https://gist.github.com/anonymous/fcd266e17d903e1f</a>... And used some encounter lists I found online: <a href="https://www.scribd.com/doc/313109364/Deadlands-Ran" rel="nofollow">https://www.scribd.com/doc/313109364/Deadlands-Ran</a>... Also thru in a 'draw a card' mechanic (the way Deadlands Reloaded determines if an encounter occurs) Let me know what you think, I ended up with this:&nbsp; DLRRandomEncounterGenerator.js
1519275028
The Aaron
Pro
API Scripter
Cute!&nbsp; Looks like a nice foray into scripting. Congrats!
So as an idiot with this scripting stuff, how would I go about using this because I am very intrigued.
1519769410
GiGs
Pro
Sheet Author
API Scripter
William, it looks like you might have made a mistake with the frequencies.&nbsp; I'm assuming you haven't changed the way the code works. The table entries look like this: event(3, "a [[3d9]] large goblin hunty party is returning (injured) from a hunt"), The number 3 here is a frequency - its like having a d20 table, and having that entry be 1-3 (of 15-17, or any group of 3) on the table. In your tables, you have your frequencies listed as if they are numbered entries on a table, like so: event(1,"A crashed wagon with a large steamer trunk containing 1 zombie of LaCroix craft&nbsp;"), event(2, ... event(3, ... etc event(223, "An earsplitting squawk shatters the silence.&nbsp;"), But in this case, the last entry from the above example will occur 223 times as often as the first. I think all your table entries should be event(1,"A crashed wagon with a large steamer trunk containing 1 zombie of LaCroix craft&nbsp;"), event(1, ... event(1, ... etc event(1, "An earsplitting squawk shatters the silence.&nbsp;"), Otherwise the later entries in each table will be very common, and the earlier entries will hardly ever happen.
1519769753
GiGs
Pro
Sheet Author
API Scripter
Cody, you go to the Campaign page, the one with the pink Launch Game button. At the right side, there's a settings button. Click that and select API Scripts Once there, you have two options. First, click in the Script Library box, and you'll be able to browse a bunch of scripts, and install them with a single click. there are a lot of useful scripts in there. Secondly, you might need to install a script manually. Click the new script button, you'll get a new tab. Enter a name, paste the script code into the box, and save it. Now you can use the script in your campaign. Most scripts are triggered by a a chat statement that starts with ! The above script would be launched with one of these lines !enc-wild !enc-town Hope that helps!
G G said: William, it looks like you might have made a mistake with the frequencies.&nbsp; I'm assuming you haven't changed the way the code works. The table entries look like this: event(3, "a [[3d9]] large goblin hunty party is returning (injured) from a hunt"), The number 3 here is a frequency - its like having a d20 table, and having that entry be 1-3 (of 15-17, or any group of 3) on the table. In your tables, you have your frequencies listed as if they are numbered entries on a table, like so: event(1,"A crashed wagon with a large steamer trunk containing 1 zombie of LaCroix craft&nbsp;"), event(2, ... event(3, ... etc event(223, "An earsplitting squawk shatters the silence.&nbsp;"), But in this case, the last entry from the above example will occur 223 times as often as the first. I think all your table entries should be event(1,"A crashed wagon with a large steamer trunk containing 1 zombie of LaCroix craft&nbsp;"), event(1, ... event(1, ... etc event(1, "An earsplitting squawk shatters the silence.&nbsp;"), Otherwise the later entries in each table will be very common, and the earlier entries will hardly ever happen. Thanks GG, I had no idea!&nbsp; I better fix it before tonights game. :)
1519785872
GiGs
Pro
Sheet Author
API Scripter
You're welcome. Looks like I was just in time :)