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] Oh the weather outside is frightful! - Weather script.

1385828468
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
If you ever read the AD&D 1E "Wilderness Survival Guide" you know there is a crazy but cool system for weather in the back. Very impractical for real table top (paper, pencil and dice) play... but easy with API... once you get the table complete... it works nicely. Sample: //Month/day Names: "A “Realistic Enough for Fantasy” Calendar" April 25, 2012 Posted by Martin Ralya roll20API.calendarYear = [ {month: "01", season: "winter", weeks: "4",days: "28", name: "Frostmoot"}, {month: "02", season:"winter", weeks: "5",days: "35", name: "Deepsnow"}, {month: "03", season:"winter", weeks: "4",days: "28", name: "Winterwane"}, {month: "04", season:"Spring", weeks: "4",days: "28", name: "Rainmoot"}, {month: "05", season:"Spring", weeks: "5",days: "35", name: "Palesun"}, {month: "06", season:"Spring", weeks: "4",days: "28", name: "Highsun"}, {month: "07", season:"Summer", weeks: "5",days: "35", name: "Firemoot"}, {month: "08", season:"Summer", weeks: "4",days: "28", name: "Firewane"}, {month: "09", season:"Summer", weeks: "4",days: "28", name: "Lowsun"}, {month: "10", season:"Fall", weeks: "4",days: "28", name: "Redfall"}, {month: "11", season:"Fall", weeks: "5",days: "35", name: "Snowmoot"}, {month: "12", season:"Fall", weeks: "4",days: "28", name: "Fellnight"} ]; roll20API.weekDays = [ {weekdayValue: "1", name: "Moonday"}, {weekdayValue: "2", name: "Towerday"}, {weekdayValue: "3", name: "Wineday"}, {weekdayValue: "4", name: "Thunderday"}, {weekdayValue: "5", name: "Fireday"}, {weekdayValue: "6", name: "Swordsday"}, {weekdayValue: "7", name: "Saintsday"} ]; roll20API.TempVarA1 = [ {regions: "Arctic", terrain: "Desert", month: "01", season: "Winter",low: "A",mean: "B",high: "G"}, {regions: "Arctic", terrain: "Forest", month: "01", season: "Winter",low: "-",mean: "-",high: "-"}, {regions: "Arctic", terrain: "Hills", month: "01", season: "Winter",low: "A",mean: "B",high: "E"}, {regions: "Arctic", terrain: "Mountains", month: "01", season: "Winter",low: "A",mean: "B",high: "E"}, {regions: "Arctic", terrain: "Plains", month: "01", season: "Winter",low: "A",mean: "B",high: "G"}, {regions: "Arctic", terrain: "Sea coast", month: "01", season: "Winter",low: "A",mean: "C",high: "H"}, {regions: "Subarctic", terrain: "Desert", month: "01", season: "Winter",low: "A",mean: "D",high: "I"}, {regions: "Subarctic", terrain: "Forest", month: "01", season: "Winter",low: "A",mean: "E",high: "J"}, {regions: "Subarctic", terrain: "Hills", month: "01", season: "Winter",low: "A",mean: "D",high: "I"}, {regions: "Subarctic", terrain: "Mountains", month: "01", season: "Winter",low: "A",mean: "C",high: "I"}, {regions: "Subarctic", terrain: "Plains", month: "01", season: "Winter",low: "A",mean: "D",high: "I"}, {regions: "Subarctic", terrain: "Sea coast", month: "01", season: "Winter",low: "B",mean: "F",high: "K"}, {regions: "Temperate", terrain: "Desert", month: "01", season: "Winter",low: "K",mean: "M",high: "S"}, By the time I was done with AD&D 1E "Wilderness Survival Guide" and added tide and moon phases (ridiculous I know) the script for the arrays was 1,100 plus lines long.... ...but it works. Here is the output for a day like pictured above. It uses the a player sheet to keep track of time, region, terrain, and weather conditions... as well as macros to incitement date and time or set region or terrain. I wont post the code right now it far to large and an clunky in its construction... need to distill the arrays into a more code friendly structure (all the table in the AD&D 1E "Wilderness Survival Guide" were set up with a reader in mind and not a JavaScript array in mind... I just wanted to get it working as the text present first.
Awesome work man! This is great, I am very interested in adding this to my campaigns, since both are overland adventures at the moment!
1385842434
Alicia
Sheet Author
Pretty cool
ZOMG nice to see you're working on this, I had a crack on it tying it into chronos but failed, also, I cheated and used the much simpler 3.5/pathfinder tables which are MUCH simpler to implement, and far less interesting. Can't believe I didn't think of making character-specific abilities to clean out my macro list though, that's really a simple and extremely elegant way of putting it all together - especially with the new character specific macro bar coming out. I can see why its been a while since you updated the chronos script, I knew you were into some heavy coding for fiddly bits, but this just blew me away, I was NOT expecting such a wealth of atmosphere-inducing goodness in such a big hit.
AWESOME!!! Please, please, please . . . stay inspired!
1386122423

Edited 1386190145
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
This will need to be placed somewhere in your scripts var roll20API = roll20API || {}; These are the API commands you will need to be prepared to process. //GM commands, Chronos {Description: "Add GM_Chronos.", Type: "GM", Long: "addchronos", Short: "addch", Family: "Chronos"}, {Description: "Add # Of Minutes.", Type: "GM", Long: "numMinuteChronos", Short: "numMinuteChronos", Family: "Chronos"}, {Description: "Add a Minute.", Type: "GM", Long: "addMinuteChronos", Short: "addMinuteChronos", Family: "Chronos"}, {Description: "Add # Of Hours.", Type: "GM", Long: "numHourChronos", Short: "numHourChronos", Family: "Chronos"}, {Description: "Add an Hour.", Type: "GM", Long: "addHourChronos", Short: "addHourChronos", Family: "Chronos"}, {Description: "Add # Of Days.", Type: "GM", Long: "numDayChronos", Short: "numDayChronoss", Family: "Chronos"}, {Description: "Add a Day.", Type: "GM", Long: "addDayChronos", Short: "addDayChronos", Family: "Chronos"}, {Description: "Update Chronos.", Type: "GM", Long: "updateChronos", Short: "updateChronos", Family: "Chronos"}, {Description: "Update Terrain.", Type: "GM", Long: "terrainChronos", Short: "terrainChronos", Family: "Chronos"}, {Description: "Update Regions.", Type: "GM", Long: "regionsChronos", Short: "regionsChronos", Family: "Chronos"}, Those are the commands.... once processed by your API message script they all point to one place... //GM common command switch if(roll20API.Family == "Chronos" && roll20API.GMsent == true){ roll20API.processAPIaddChronos(); }; However you process the API message and commands.... they need be stored in the variables below //API values roll20API.commandChronos = roll20API.Long; roll20API.valueGiven = roll20API.message; roll20API.textGiven = roll20API.message; Scripts needed: API needs to point to this one and this is where any variable changes need to take place (from the API.) <a href="https://gist.github.com/BaldarSilveraxe/7780941" rel="nofollow">https://gist.github.com/BaldarSilveraxe/7780941</a> That script will use the functions in this script. <a href="https://gist.github.com/BaldarSilveraxe/7780978" rel="nofollow">https://gist.github.com/BaldarSilveraxe/7780978</a> Supporting tables are here and you can edit some of the values to change your calendar year. <a href="https://gist.github.com/BaldarSilveraxe/7780922" rel="nofollow">https://gist.github.com/BaldarSilveraxe/7780922</a> Lastly you can customize your report that is a hand out. <a href="https://gist.github.com/BaldarSilveraxe/7795128" rel="nofollow">https://gist.github.com/BaldarSilveraxe/7795128</a> With the above you should be able to enter... "!addchronos" And the sheet should appear and you should have control over the date and time...not weather yet... Notes on the calendar Year can be 00000-99999 12 months a year Four season... each three months long.... 28 days in every month except for the middle month of each season (35 days.) 7 days a week 364 days in a year.... 24 hour days.. I will be adding the weather soon.... trying to combine some tables.
1386156970

Edited 1386157521
This is looking epic! So newbie to the scripting side, but the !addchronos command does not seem to create a character sheet for me. however i did combine all the scripts into one inside that campaign... should i break them down in separate? Thanks! ( Unexpected token : ) error
1386162698
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Do you have this in there? var roll20API = roll20API || {};
1386170832

Edited 1386190335
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Updated the scripts: * I would place them in their own scripts and may be hard to debug any changes if all together. * They are larger then the previews here so be sure to pull them down from Gist
1390555381

Edited 1390555609
I am fairly new to this API thing as well, and can't seem to get this to function. It sounds like a terrific idea, and I've copied the coding, but I get the ( Unexpected token : ) error when I try to run all the scripts. The rest of the API do not report any errors, but when I input the "GM command" into its own API script, all I get is the (Unexpected token) error. Advice? I have used the !addchronos command but nothing happens. I have added the var roll20API = roll20API || {}; to all of these scripts as well. Would love to see this work, it is a brilliant idea.
1390610932
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Riley D. said: There's currently a bug where "notes" and "gmnotes" fields aren't functioning properly. It's on my to-do list to get it fixed. It's been broken since Rugged Reroll came out a few weeks ago. Not saying that is the issue... but the "notes" field isn't working properly and this script outputs to that.... I plan to rework this and the E2 record sheet once that issue resolves. Having said that... Unexpected token errors I have run into are were I have used made some subtle mistake in adding a comma or semicolon where it shouldn't be (something like that.)
I have been looking at your script and found that it doesn't handle the cammand for updating so where the script calls for an update or if i wish to manualy update nothing actualy happens to the script. all the other macros you programed in to the script do what they are saposed to.
1391170261
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
I think the notes are screwed up... plan to review this once that is corrected. Likely can be simplified.
How is this going?
1395036951
Alex L.
Pro
Sheet Author
Jarret B. said: How is this going? The bug hasnt been fixed yet, last time Riley spoke about it he said it will come with the changes to character sheets.
Would it work if all I wanted was just the time keeping aspect?
1395101045
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Yea the time should work, just not the weather. This should all get better with this: <a href="https://app.roll20.net/forum/post/712797/new-blog-" rel="nofollow">https://app.roll20.net/forum/post/712797/new-blog-</a>...
1395129377
Alex L.
Pro
Sheet Author
Stephen S. said: Yea the time should work, just not the weather. This should all get better with this: <a href="https://app.roll20.net/forum/post/712797/new-blog-" rel="nofollow">https://app.roll20.net/forum/post/712797/new-blog-</a>... To clarify anything that doesn't output to a note field of some kind (ie a handout) should work.
Would love to add this, looks awesome. Um, ok so if it does the date but cannot output to handouts, where can I see the date, if not just for my own recordkeeping IG? Thanks ahead! DB777
I tried to install this script but I couldn't figure it out, the directions were pretty confusing. And do I need to install a separate script to handle the commands or something? How do I do that?
1395785466
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
I have been traveling a lot and haven't been able to review what I did and improve it... I really think this <a href="http://blog.roll20.net/post/80684919470/data-delve" rel="nofollow">http://blog.roll20.net/post/80684919470/data-delve</a>... is going to enable a lot (sounds like forms will be allowed and with it a better way to approach an API UI.
Any word sir? Would love to get this working :)
1397580026

Edited 1397580244
When someone figures out how to get this going, a tutorial would be great. --- Anyone else looking forward to when we'll be able to have different types of character sheets in the same game (such as one for simple NPCs, one for Players, etc and a variety of types of tools)? This could have it's own type of character sheet to appear more organized. I could see how this might be useful for just about any d20 fantasy game. :-O Very cool
I'm starting a new game in 3-4 weeks and I would love to have at least the time keeping / calander aspect of this script working.
1398384103

Edited 1398386940
I'm perfectly okay with using it in it's current form, I got the standard command script from the stickied thread, and I added your other scripts. Can someone help me out with adding the three things to the command script on the sticky? Where do I put them in the script? I'm getting this error Cannot set property 'processAPIaddChronos' of undefined I'm an idiot, I got it working, thanks! So exactly which part of this script isn't working? Generating the report?
He said the weather portion isn't ready yet.
I can't get it to generate a report, the handout just stays blank.
Jarret B. said: I can't get it to generate a report, the handout just stays blank. That would indeed be part of the weather portion.
Gotcha.
Change line 189 of Process_Report to return reportText; and you can call roll20API.processAPIreportChronos() to get the report, something like sendChat("GM", roll20API.processAPIreportChronos()); works well.
1399265961

Edited 1399266199
I think the bug that you guys were referring to is being fixed tomorrow. <a href="https://app.roll20.net/forum/post/822161/getting-g" rel="nofollow">https://app.roll20.net/forum/post/822161/getting-g</a>... I get this when I try to do that Logan Infinite loop or long running process detected. RangeError: Maximum call stack size exceeded
1399416232

Edited 1399418777
The script correctly generates the report on the Dev server since the update, but I got an error after using !addchronos (Which worked properly) which disabled the script It's as follows: "ERROR: You cannot set the imgsrc or avatar of an object unless you use an image that is in your Roll20 Library. See the API documentation for more info." /home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1 orts, require, module, __filename, __dirname) { function f(a){throw a;}var j=v ^ Error: Firebase.child failed: First argument must be a non-empty string and can't contain ".", "#", "$", "[", or "]". at Error (&lt;anonymous&gt;) at Ha (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:12:204) at G.W.H (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:126:213) at TrackedObj._doSave ( Some bugs I noticed: It always gives a downpour for percipitation The month doesn't give the name, it gives the displaymonth number in the report. Tide seems to always stay at low 12 high 11 Not sure if wind is working properly but it has only given me 0 and 15 mph I don't know how common it's supposed to be, but I've had it generate quite a few different days and I haven't gotten one of the extreme weather events The day of the week doesn't seem to be changing. Stephen, do you plan on updating this script now that they've fixed the report issue?
I would be SO grateful if it was all fixed up. I have been dying to use this! Also, if there is perhaps a new thread, or a cleaned up download and installation instructions, as all the stuff above is a little confusing, how to get it in, all in one script or in many, is there an order, etc. Thanks so much!!
+1
Yeah I would love if this was updated, as it stands right now the time keeping aspect is simply amazing, but to have weather working so it isn't constantly raining would be awesome too! And yeah, the installation instructions are very confusing.
It doesn't look like Stephen is active anymore, because he hasn't posted or replied to anything in over a month. I've also sent him PMs which he has not answered. It's a shame because this script has a ton of potential. I'll probably still use it in it's broken form just for the date. I wish he would fix the problems with it though, because it could be amazing.
Jarret B. said: It doesn't look like Stephen is active anymore, because he hasn't posted or replied to anything in over a month. I've also sent him PMs which he has not answered. It's a shame because this script has a ton of potential. I'll probably still use it in it's broken form just for the date. I wish he would fix the problems with it though, because it could be amazing. Being inactive for month would be highly understandable, especially if he's a college student, This is the end of the semester. Or he could even just be busy with work, it can happen. Just try to give him more time and try not to berate or pester him.
1402355706
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
I plan to fix this script hopefully this weekend.
1402368464

Edited 1402370215
This is excellent news. Edit: I'm sorry for the multitude of messages I sent you while you were inactive.
YES! YES! YES!
1402982625

Edited 1402983297
Any progress? Edit: Hopefully, you'll be simplifying the scripts, and giving a better installation guide. It took me a good hour to install it last time!
I might be willing to sing "Let it Snow" while I play piano in the background to get you motivated to do this!
1403031844
The Aaron
Roll20 Production Team
API Scripter
How about "Let it Go?" =D
I eagerly await a status update..:D is this being worked on?
+1 checking as well
Can we get an update on how this is going...:D
+1 checking
Wow. This does look amazing. I'm giving this a +1 because of how innovative and cool it will be. :)
Giving this a bump because of how amazing this would be.
Yeah, I really wish he would fix it.
I got rid of the unexpected token error by enclosing the gm commands in [ ... ]; and removing the last comma after the } but the !addchronos command doesn't do anything. My sandbox isn't kicking any errors.