Advertisement Create a free account

[Script] Mystara Calendar

1402031673

Edited 1402061606
The Aaron
Forum Champion
API Scripter
I threw together a little script for tracking the date in a Mystara campaign, and displaying the date and calendar in the chat window. Mystara's calendar is pretty simple as every month has 28 days. In future versions I'll try to support arbitrary calendars, but for now it's just Mystara. Commands: !cal -- Shows the current month, with phases of the moon. !cal month -- Same as above. !cal year -- Shows the whole year. !cal today -- Shows a banner with today's date and moon phase. !cal next -- Advances the day to the next day and shows a banner as above. If followed by an integer, it will advance that many days. !cal prev -- as above, but backwards. Switches: --lunar -- shows lunar phases --nolunar -- hides lunar phases <a href="https://gist.github.com/shdwjk/1bb1db1e40ecf064ceb6" rel="nofollow">https://gist.github.com/shdwjk/1bb1db1e40ecf064ceb6</a> Suggestions welcome. Here are some screenshots, with their commands sent to chat before their display (commands are not echoed normally):
Hi, great job on the script. Do you have any plans for this script, such as weather, a more specific time tracker (Minutes/Hours), or anything else? This is the only script which has a representation like an actual calendar. Great job.
1402060809
The Aaron
Forum Champion
API Scripter
My plans are as follows, in roughly priority order: Add GM/player separation of capabilities Add Selection to whisper to the caller instead of broadcast to everyone Add specific date setting Add displaying a specific date instead of the current date Add player and GM annotations to days/date ranges Add popup/tooltip style display of annotations (only show GM annotations on whispers to GM) Add daily agenda style display of annotations on a date/ date range Add symbols that can be used to mark dates Add support for arbitrary calendars Add support for multiple simultaneous calendars
1402060999
The Aaron
Forum Champion
API Scripter
Is tracking specific time of day of interest? Would you see weather as a randomly generated feature, or something set by the GM?
1402062483

Edited 1402062511
That's greatly of interest to me. Randomly generated based on time of year would be awesome. Maybe with the option to set it manually too.
1402065814
The Aaron
Forum Champion
API Scripter
I'm certainly open to giving that a shot. =D How do you see that panning out?
Are you talking about my pm?
1402067123
The Aaron
Forum Champion
API Scripter
I actually just saw your PM. I haven't participated in the groups much yet, so it eluded my attention. I replied there. =D Let's start fleshing out what features you'd like to see in this script and how you think they should work, and we'll see where it goes. =D
1402067877

Edited 1402067922
Well the features I want are: A function to add minutes/hours, and for it to roll over to the next day when the day ends (24 hours) Non standard months (I have 12 months of 28 days, with 4 7-day festivals throughout the year) Holidays (I was thinking mouse over text on the number in chat?) Weather (there's several ways you can do this. Perhaps the best would be to allow the DM to enter in custom weather, allowing them to use an outside source for weather generation, that suites their world) An option to display the current time if that's added.
1402069720
The Aaron
Forum Champion
API Scripter
Time is certainly no harder than days/months/years, I can do that easily enough. Non standard months is on my list. I'd like to flesh out it's features a bit more. Would need months of varying days Would need years of varying days Would need out of month days, like your festivals Holidays fit well with the annotations and symbols I have planned Weather is a big topic, but sounds like fun. Would be region specific Would be seasonal Would need to be overridable. Showing current time is easily done.
1402070124
Brian
Sheet Author
API Scripter
Neat! I could see this being easily adapted for Exalted, too. A week in Exalted has seven days (Sunday, Moonday, Marsday, Mercuryday, Jupiterday, Venusday, Saturnday). A month has 28 days (new moon on the 1st, full moon on the 15th). A season has three months (Ascending-&gt;Resplendent-&gt;Descending). The year has five seasons (Air-&gt;Water-&gt;Earth-&gt;Wood-&gt;Fire). After the 28th of Descending Fire and before the 1st of Ascending Air is Calibration, five days when the gods reset the calendar; there is no moon nor any stars in the night sky during Calibration, but the stars return on the 1st of Ascending Air (a new moon). "Present Day" is generally Realm Year 764, although obviously games are run at different points in the timeline. Abyssal and Infernal characters don't even exist until 763, and there are only a few dozen Solar characters in the world between ~750 years before RY 0 and RY 763.
1402078531

Edited 1402078917
The Aaron
Forum Champion
API Scripter
Awesome. The more calendars I can take into account, the easier to support them. Static calendars are easiest of course. What do dates look like during calibration, and where do seasons fall? Would it be right to say something like: "...on Air Resplendent 23rd, RY 764." "...on Calibration the 2nd, RY 763" Also, is there a numerical way of writing dates? 1:2/23/764 etc
1402084589

Edited 1402084799
Brian
Sheet Author
API Scripter
A date would generally be written in a form similar to "...on the 23rd day of Resplendent Air, RY 764" or "...23 Resplendent Air, RY 763", or somewhere in-between. The month always precedes the season (Resplendent Air, not Air Resplendent). You could probably shorten the month (eg, R.Air or Resp.Air), but the canon material doesn't get that deep into the calendar; similarly, there's no canon information on a fully numeric depiction of the date. There are two conflicting presentations of the seasons. The first I'm not a fan of, as it goes from the hottest month of the year (Descending Fire) to the coldest month of the year (Ascending Air) over the course of five days (Calibration). Considering the weather is entirely controlled by gods and elementals it's not impossible within the setting, but going from high summer to dead winter just doesn't sit right with me. The version I prefer has summer starting 1 R.Fire, autumn at 15 A.Air, winter at 1 D.Air, and spring at 1 D.Earth. The second version provides a much more gradual change from summer to winter, and puts Calibration at the tail end of summer rather than making it the shortest autumn ever. This seems appropriate to me: Calibration is the only time during the year when third circle demons (the most powerful type of demon) can be summoned, and a summoned demon crosses through Cecelyne, the Endless Desert to reach Creation. (Yu-Shan, the city of Heaven, also holds the biggest party in the world on the 3rd day of Calibration, initially held specifically so that powerful sorcerers would attend a party and not summon third circle demons.) There are other calendars in the game (notably the Calendar of Setesh in the Underworld, and people in the First Age would have definitely been using a year-numbering system other than "Realm Year", since the Realm did not exist yet), but they have even less detail. Of course, the Calendar of Setesh isn't simply a date-numbering system; it's also a machine that makes the Underworld's version of the sun and moon move across the sky.
1402105609
The Aaron
Forum Champion
API Scripter
So, is the calendar layout you favor: <a href="http://thor.divnull.com/pub/exalted/sheets/democritus/dcs-calendar.pdf" rel="nofollow">http://thor.divnull.com/pub/exalted/sheets/democritus/dcs-calendar.pdf</a>
1402109392
Brian
Sheet Author
API Scripter
It's got the seasons out of order, but basically that, yeah.
1403988094
The Aaron
Forum Champion
API Scripter
So Brian, what was the order of the seasons in the Exalted calendar that you prefer? Air Water Earth Wood Fire Calibration
1403990439
Brian
Sheet Author
API Scripter
That's correct, Aaron
1403994920
The Aaron
Forum Champion
API Scripter
Cool. I'm working on generalizing and refactoring, wanted to make sure I had the right order. =D
1405533902

Edited 1405534260
Great script! After adding your initiative script to my campaign, I immediately dove into your profile and looked for more APIs. I'm having a little difficulty Implementing this script however & my lack of experience with scripting may be to blame. I am trying to edit the stored state & rename the months & days for my "Conan, The Hyborian Age campaign". The calendar is identical to the 12 months years, 28 day months, 7 day weeks. A link to what I have changed in the script follows <a href="https://gist.github.com/anonymous/84f82ff4ce2b9037" rel="nofollow">https://gist.github.com/anonymous/84f82ff4ce2b9037</a>... When I attempt to calculate the calendar in game now, It still shows the default Mystara calendar with the default dates. Is there a command to recalculate stored state? Is imputing my own month & day names and date possible ATM? *p.s.* Also one request if it's at all possible. I'd like the year's date to read with a comma. "32,498 BC" as opposed to "32498 BC" Thanks
1405535121
The Aaron
Forum Champion
API Scripter
Hi William. Thanks for the kind words. This script is on my list to rewrite, I've learned a bunch about javascript since then. I'm actually in the middle of a rewrite to abstract the calendar and support hours/minutes if desired, etc. But addressing your interim concerns: 1) On line 2, change version: 1.4, to version: 1. 5 , This will cause the check on line 37 (line 2 of your gist) to reset the calendar on next API restart. 2) You can get the commas in the year, you can add .toLocaleString() after the use of the year on lines 233 and 240: +'&lt;div style="border-bottom: 2px solid #8B0000;margin: 3px 3px;font-weight: bold; font-size: 130%; text-align: center;"&gt;'+s.yearPrefix+d.year .toLocaleString() +'&lt;/div&gt;' return s.monthsOfTheYear[date.month-1]+' '+date.day+Calendar._Ordinal(date.day)+', '+s.yearPrefix +date.year .toLocaleString() ; Thanks again for using my script, and please let me know if there are any other features or scripts you're looking for! =D
1405545787
Thom
Pro
Hi Aaron - Your script is brilliant. Very cool. As it happens I also use a calendar with 12 28-day months plus four 7-day festivals at season transitions, though in addition midsummer & midwinter are two days without months. Other cultures use other calendars but I can just use a lookup table whenever a PC has reason to care about that. It would be handy to also have access to a simple "day of year" value to make it easier to use these lookup tables for other calendars, at least until the day of multiple simultaneous calendar support arrives. So this is basically a +1. I'm looking forward to your next release. Thom
1405546171
The Aaron
Forum Champion
API Scripter
Thanks Thom! The next version ( which is in development right now) will support multiple simultaneous calendars with different layouts. I hadn't thought about synchronizing them before but that's a great idea. It will also support multiple moons on different schedules, multiple month and season layouts, and hopefully annotations. It would be great if we had a /direct for whispers. The current work around of just sending html with a /w has some filtering issues that are a little problematic. Anyway, I'll do my best. =D
1405577783
Wow this is awesome Aaron!
1405604260
The Aaron
Forum Champion
API Scripter
Thanks! Now I really want to get back to work on it! :)
Aaron said: The next version ( which is in development right now) will support multiple simultaneous calendars with different layouts. I hadn't thought about synchronizing them before but that's a great idea. It will also support multiple moons on different schedules, multiple month and season layouts, and hopefully annotations. This looks great. Good work, Aaron! The multiple moons on different schedules sounds like just the thing I've been looking for.
1405658690
The Aaron
Forum Champion
API Scripter
Thanks Dennis! If you have any other features you want me to consider, post away! :)
This rocks!!!! GREAT WORK!
1405705652
The Aaron
Forum Champion
API Scripter
Thanks Dragonsbane777!
Aaron, could this easily be updated to use the standard January - December with just 28 days each month.
1407852278
The Aaron
Forum Champion
API Scripter
Yes. Just change lines 49-55 to be Sunday-Saturday, and lines 58-69 to January-December.
1411212058
Kevin the Barbarian
Plus
Sheet Author
API Scripter
This looks pretty interesting. Would love a Greyhawk calendar for my campaign (not a feature request, just rambling...).
1411219812
The Aaron
Forum Champion
API Scripter
Cool. I'm partway finished with a version that supports multiple calendars. Adding Greyhawk should be easy. What's the calendar like?
1411226274

Edited 1411226348
Kevin the Barbarian
Plus
Sheet Author
API Scripter
12 months in a year, 28 days in every month, 7 days in every week. There is a holiday week between each quarter that exists between months. This PDF breaks it down pretty well. If it matters, the 4th day of every week is the holy day and the 7th day is the equiv. of Saturday.
1411228024
The Aaron
Forum Champion
API Scripter
Ah! As it turns out, this is the calendar that Jarret uses, so I already have it in the new version. =D New version supports time as well as date. Here's a sample output for that calendar. (The final version will be well formatted and configurable.) !cal Godsday, Fireseek the 4th, 1000 at 12:23
1411230795
Kevin the Barbarian
Plus
Sheet Author
API Scripter
I see, I should've read the whole thread first. Pretty awesome! I configured it for Greyhawk sans the holiday weeks and added a yearSuffix (e.g. 567 CY). Weather would be interesting. I'm currently just "manually" using a script someone wrote that uses the random tables that were in a Greyhawk boxed set. It uses time of year and latitude to generate it.
1411231156
The Aaron
Forum Champion
API Scripter
I didn't know that was Jarret's calendar, I just recognized the months and days and holidays. =D He has a few changes to it, but I'll just clone it and make a stock Greyhawk one. =D
1412347949

Edited 1412348256
This is just plain beautiful. Quick question, for it to default with no lunar instead of lunar, you just change line 245 on the gist from true to false, right? And I cant wait for the next release. +1 Edit: Never mind, that was just for the today command, I found the others. Month: line 124, Year: line 214, and Today: 245.
1412348472
The Aaron
Forum Champion
API Scripter
Thanks! I'm looking forward to finishing it up!
1416374039
Falcon
Pro
Sheet Author
Aaron, As always you are awesome. I have a random weather generator as an Excel document that uses Greyhawk's weather system rules (in the original book). It is an overall great tool for generating weather based on lattitude. Let me know if you are interested and I can send it over to you.
1416403196
The Aaron
Forum Champion
API Scripter
Thx, I'll PM you. :)
Ooo...Greyhawk Calendar & weather tables?! Count me in! *waits anxiously*
1418745708
The Aaron
Forum Champion
API Scripter
=D I need to take a month off from work so I can work on things I want to work on like this. =D
1421935338

Edited 1421935397
Heya, super cool script here, totally awesome stuff. I had 2 questions. My first is, is there an easy way to change year and year affix in game without going back into the script, like change the year from 1000 ad to 11000 bc, for let's say time travel hehe (on that topic is there a way to quickly change month as well). Second, I saw mention of a new version, is there a link to this or yet in production? Either way thanks so much for this awesome script!
1421938827
The Aaron
Forum Champion
API Scripter
In this version, everything is by days, so you'd have to pass it something like !cal prev 336000 or similar. The next version is much better, and understands things like 11000Y. However, it is unfinished as yet. :/