[Drop-In] Customizable Calendar,Time and Weather addon

Show off your RPG maps, campaigns, and tokens. Share your gaming experiences and stories under General Discussion and save this forum for things you've created that may help others run their own games. Use the subforums when appropriate.

Moderators: dorpond, trevor, Azhrei, Gamerdude

User avatar
kyuss11
Giant
Posts: 175
Joined: Thu Dec 23, 2010 1:12 am

[Drop-In] Customizable Calendar,Time and Weather addon

Post by kyuss11 »

Hello everyone,its here,lol
Download this campaign and read the information token for instructions.
If you want to add this into your campaign just save the token then drag into your campaign map and copy paste the Campaign Properties to your campaign.Oh and don't forget to export and import the 3 weather Tables as well.
One last thing,if you drag into your campaign make sure you run the onCampaignLoad macro.
Please let me know what you think,or if I forgot anything for this to work.I believe everything works but ya never know,lol
Lastly now that it is done,I want to say a big thank you to my buddy Sam for writing the code and to myself for motivation.ideas,and
"Of course we need this in our campaign,lol"

Here is the campaign file for download.
http://www.4shared.com/file/WdlnwInt/Ca ... furl=d1url

This picture shows how to set the weather.The weather will switch over automatically to night if it is after the event time.The default is set to 7pm,7am which you can change for the seasons.
Image

These are the token's properties for you to switch out names and the amount of days,months,etc.Just don't change the toggles.If you scroll down you will see events,just change the time and text of the event.If you change lets say the amount of months or days to a different number and you edited the token properties,than you also need to edit the fixDays and fixMonths macro to the new number.
Image

This is what the chat will display only when using the 5 minute increment button to prevent spamming in chat.If a event has not been reached then you will only see the image of the Lib:Calendar appear on the chat.There is more events that you could add,for example a lunar eclipse or a festival,a character's birthday.etc.Be creative and let me know what you came up with.
Image
Last edited by kyuss11 on Thu Mar 15, 2012 3:59 pm, edited 5 times in total.

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: Customizable Calendar,Time and Weather addon

Post by aliasmask »

Thank you, thank you, thank you. I can't wait to check it out. I'm curious about what you did for time though. I have some code and graphics for phases of the moon as well as some calendar functions (just no interface). On my really long to-do list, making a Greyhawk Calendar was on there. I'll let you know how things go.

You should post some screen shots and other relevant info about the functions of the addon.

User avatar
jarquafelmu
Cave Troll
Posts: 35
Joined: Fri Dec 31, 2010 4:18 am

Re: Customizable Calendar,Time and Weather addon

Post by jarquafelmu »

Aliasmask, I was the one who wrote the program. What questions do you have about the time? I would like to answer them.

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: Customizable Calendar,Time and Weather addon

Post by aliasmask »

I finally checked it out. I don't have any questions about the time after seeing how you do it. I was thinking this was customizable in the fashion where you can enter your own months and lengths of months easily. I haven't really looked at the code though, so it may be easy to do it the hardcoded way. Personally, I would change the output and interface a bit to be more minimalist, but that's just a personal preference. What calendar is that?

User avatar
mrobviousjosh
Dragon
Posts: 418
Joined: Sun Dec 16, 2007 12:14 am
Location: Fort Smith, Arkansas
Contact:

Re: Customizable Calendar,Time and Weather addon

Post by mrobviousjosh »

VERY Cool. Nice addition to our existing tools! :)

User avatar
kyuss11
Giant
Posts: 175
Joined: Thu Dec 23, 2010 1:12 am

Re: Customizable Calendar,Time and Weather addon

Post by kyuss11 »

Yeah,I use this every session now.I'm planning on releasing a newer version that will have a temperature setting and display with a thermometer pic and additional weather selections.I have also added encounter tables to be used with the time.The calendar has properties to change how often it will remind you when you want to check for a random encounter,plus it will know to run the day or night hostile or friendly encounter tables.All the Gm would have to do is fill in what encounters he wanted and click the macro.:)

Lee
Dragon
Posts: 958
Joined: Wed Oct 19, 2011 2:07 am

Re: Customizable Calendar,Time and Weather addon

Post by Lee »

Thank you for this. I lost my time functions by accident a while back and this got me back on track really quickly.

I've since extended the code a bit to suit my campaign. I'll probably redo it in order to make it generic like you intended for this. A couple of things I added was a background changer that ties into the change of seasons, as well as a year-desc changer using the Chinese Zodiac. I'm also planning to make a property editor for the Lib:Calendar token one of these days

On another note, if you append the ff. lines to the set/increment macros (the yellow-green buttons):

Code: Select all

[h: jsonPlayers = getAllPlayerNames("json")]
[h: playerCount = json.length(jsonPlayers) - 1]
[h, if(playerCount), code:{
[jsonPlayers = json.remove(jsonPlayers, json.indexOf(jsonPlayers, "GMName"))] <!-- substitute GMName for whoever is making the changes --> 
[broadcast(macroLink("<!-- -->", "Dockable Time@Lib:Calendar", "Lib:Calendar"), jsonPlayers, "json")]
}]
it'll automatically refresh the calendar on all clients (if any) connected to your game when you make changes.

@aliasMask If you're willing to share, I'd like to get a copy the code and images for the lunar phase changes you've made :) I was planning to add an arch graphic showing the positions of the sun or moon during the course of the day, and it'll help me get a quick head start if I don't need to do it from scratch :lol: Thanks!

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: Customizable Calendar,Time and Weather addon

Post by aliasmask »

Lee wrote:@aliasMask If you're willing to share, I'd like to get a copy the code and images for the lunar phase changes you've made :) I was planning to add an arch graphic showing the positions of the sun or moon during the course of the day, and it'll help me get a quick head start if I don't need to do it from scratch :lol: Thanks!
It's under user creations and Krynn Moons.

Code isn't that long:
||| showMoons |||

Code: Select all

[H: currentDay = getLibProperty("currentDay")]
[H: currentMonth = getLibProperty("currentMonth")]
[H: currentYear = getLibProperty("currentYear")]
[H, if(json.isEmpty(currentDay)): currentDay = 8]
[H, if(json.isEmpty(currentMonth)): currentMonth = 1]
[H, if(json.isEmpty(currentYear)): currentYear = 2011]
[H: inputStr = json.append("",strformat("currentDay|%{currentDay}|Day|TEXT"),
   strformat("currentMonth|%{currentMonth}|Month|TEXT"),
   strformat("currentYear|%{currentYear}|Year|TEXT"))]
[H: abort(input(json.toList(inputStr,"##")))]
[H: currentMonth = max(0,min(12,currentMonth))]
[H, if(!json.isEmpty(currentDay)): setLibProperty("currentDay",currentDay)]
[H, if(!json.isEmpty(currentMonth)): setLibProperty("currentMonth",currentMonth)]
[H, if(!json.isEmpty(currentYear)): setLibProperty("currentYear",currentYear)]
[H: dayFromYearStart = json.append("",0,31,59,90,120,151,181,212,243,273,304,334)]
[H: daysInYear = 365]
[H: cycleSolnari = 36]
[H: cycleLunitari = 28]
[H: cycleNuitari = 8]
[H: startDay = 7]
[H: startMonth = 10]
[H: startYear = 2005]
[H: leapMod = max(0,currentYear - 2004)/4]
[H, if(floor(leapMod) == leapMod && currentMonth < 3 && !(currentMonth == 2 && currentDay == 29)): leapMod = floor(leapMod) -1; leapMod = floor(leapMod)]
[H: startYearCode = startYear * daysInYear + json.get(dayFromYearStart,startMonth-1) + startDay]
[H: currentYearCode = currentYear * daysInYear + json.get(dayFromYearStart,currentMonth-1) + currentDay + leapMod]
[H: dayDiff = currentYearCode - startYearCode]
[H: phases = 8]
[H: startingPhase = 0]
[H: currentSolnari = startingPhase + ((dayDiff - (floor(dayDiff / cycleSolnari) * cycleSolnari))/cycleSolnari * phases)]
[H: currentLunitari = startingPhase + ((dayDiff - (floor(dayDiff / cycleLunitari) * cycleLunitari))/cycleLunitari * phases)]
[H: currentNuitari = startingPhase + ((dayDiff - (floor(dayDiff / cycleNuitari) * cycleNuitari))/cycleNuitari * phases)]
[H: Solnari = floor(currentSolnari)]
[H: Lunitari = floor(currentLunitari)]
[H: Nuitari = floor(currentNuitari)]
[H, if(Solnari != currentSolnari && Solnari -  2 * floor( Solnari / 2 ) == 0): Solnari = ceiling(currentSolnari)]
[H, if(Lunitari != currentLunitari && Lunitari -  2 * floor( Lunitari / 2 ) == 0): Lunitari = ceiling(currentLunitari)]
[H, if(Nuitari != currentNuitari && Nuitari -  2 * floor( Nuitari / 2 ) == 0): Nuitari = ceiling(currentNuitari)]
[H: SolnariImg = tblImage("KrynnMoons",Solnari)]
[H: LunitariImg = tblImage("KrynnMoons",Lunitari+8)]
[H: NuitariImg = tblImage("KrynnMoons",Nuitari+16)]
[H: phaseNames = json.append("","Full Moon","Waning Gibbous","Third Quarter","Waning Crescent","New Moon","Waxing Crescent","First Quarter","Waxing Gibbous")]
[frame("Moons of Krynn"): {
   [R: strformat("Day: %{currentDay} Month: %{currentMonth} Year: %{currentYear}<br>")]
   [R: strformat('<img src="%{SolnariImg}" width="50" height="50" alt="Solnari: %s"> <img src="%{LunitariImg}" width="50" height="50" alt="Lunitari: %s"> <img src="%{NuitariImg}" width="50" height="50" alt="Nuitari: %s">',
      json.get(phaseNames,Solnari),json.get(phaseNames,Lunitari),json.get(phaseNames,Nuitari))]
}] 
I created the moon images from scratch, so you're welcomed to use them. Since it uses the beginning of year for reference, you can have any number of months for any number of days. Just add the month length to the array by adding the previous total to it. For example Greyhawk has 7 (festival) and 3 months of 28 for each season. So, 0,7,35,63,...

With multiple moons, the start date will be when they are all full. Technically, you can just set each moon individually and that's how I would do it if redoing it, but above is when all are full. If you have no leap days, then just set the variable to 0. You can also set the starting phase to all moons are new moons by setting the start to 4, rather than 0.

If I were to rewrite this (thinking about it now), then I would make if very generic and have the moon names, starts, cycles all be entered and saved on token. I would also maybe add a couple of other moon colors (like blue) and have user select moon color in set up. It would also ask about leap days and month string (just enter list of month lengths and calc year from that). Also, add a menu for month names and alt names.

I also thought about the horizon. If I recall from my research, the moon is only visible 14 hours of the day at the equator. With a cycle of 28 days, it turns out that the moon rise time is +1 hour each day. This is because the rotation of the planet and the moon go in same direction, so the moon is an hour ahead each day in the rotation compared to the sun and the planet has to rotate another hour to catch up. So, on the day of the new moon, it will rise at 5am and set at 7pm. The next day rise at 6am... I'm not sure how the math works out for that though, but the day of the full moon should be setting at 5am (I think, or day before full moon??). If you think about it, you would never see a full moon during the day or a new moon at night (except for that hour overlap on either side due to curvature of planet).

Lee
Dragon
Posts: 958
Joined: Wed Oct 19, 2011 2:07 am

Re: Customizable Calendar,Time and Weather addon

Post by Lee »

these are excellent, thank you! i've always been fond of Krynn, though like you mentioned on the other thread, my group has never played a campaign in it too. my D&D gm would love this im sure. thanks again :)

edit: got it to work. your instructions were very clear and it works like a charm :) I modified it a bit since our gaming world only has one moon, but as you've said, it's pretty easy to configure for multiple moons. very nice. The info on the moon's rise times is very interesting, I'll start on it when I get more free time, and the planned features stated by the OP is something I'm definitely looking forward to.

User avatar
kyuss11
Giant
Posts: 175
Joined: Thu Dec 23, 2010 1:12 am

Re: Customizable Calendar,Time and Weather addon

Post by kyuss11 »

Thanks Lee,I'm glad you are enjoying this addon.I was looking for this for a long time and realized that one had to be made,lol.
I would appreciate it if you would share your modifications,I would like to see the background changer as well as the lunar graph.It sounds interesting,originally this was just a basic idea,but never thought of the moons.Plus having some utility macros that would allow quick customization for different calendars is awesome.

Lee
Dragon
Posts: 958
Joined: Wed Oct 19, 2011 2:07 am

Re: Customizable Calendar,Time and Weather addon

Post by Lee »

Sure, no problem :). I'll post what I come up with once I've completed it. Currently, I only added several properties such as season and season color, and using this for bgcolor in your existing frame. I'll try images next and gauge the aesthetics of that as well. I didn't do it yet since I kind of like having the icons you have for weather being the focal point. With regard to the lunar cycle, I injected a slightly modified version of aliasMask's code for now, displaying the current phase of the moon which only appears when the DayR toggle switches to night.

I do plan on starting on displaying the sky positions of the sun and moon, but I'll have to resize the images a little to make them smaller and figure out how much detail (and effort :lol:) I want to put into it. It's not hard if the cycle is kept static, but as aliasmask mentioned, the dynamics of actual lunar movement is a tricky thing, I found out. Looking in on the math, latitudinal and longitudinal location (among other things) is critical to determine proper referencing for things such as moonrise and moonset. Compared to it, the movement of the sun across the sky is easier. I'd like to make it so that multiple moons can be displayed, tying it to aliasMask's work so that it has better utility for all MT users. I do want it displayed as an arc. Off the top my head, I'd probably make a table / lattice where I can display the sun / moon images using a row, column scheme. I'll have to look into it since I'm not sure which HTML elements are available in MT for this kind of thing.

After that, I'll move to making a simple editor to handle the library token's properties, especially the adding and modifying of calendar events. In any case, you and your friend have done great work with this. I like how it was made and the potential to add to it since everything came neat and tidy :).

Edit: Yup, the code for the arc was fairly easy to do, I'll have to tinker with it some more as the curvature is rather sharp (like an arrow head :lol:) leading to and from the zenith and the table is not yet dynamically generated, though it shouldn't be too hard :)

@aliasMask, would it be possible to get a copy of the moon images? I've never tried extracting images from a table, so I'm not even sure if it's possible. I want to scale down the moon size so I can depict a sky map w/o taking so much MT screen estate :)

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: Customizable Calendar,Time and Weather addon

Post by aliasmask »

Lee wrote:@aliasMask, would it be possible to get a copy of the moon images? I've never tried extracting images from a table, so I'm not even sure if it's possible. I want to scale down the moon size so I can depict a sky map w/o taking so much MT screen estate :)
Sure, but the images are pretty small as is, 40x40 and only use 3k. You can resize the image like so:

Code: Select all

<img src="[r: tableImage("KrynnMoons",0,20)]" />
edit: One trick I found for saving screen real estate is to use tool tips. You can just have a time viewed, but mousing over it will give you all the expanded info.
Attachments
moons.zip
(64.38 KiB) Downloaded 82 times

Lee
Dragon
Posts: 958
Joined: Wed Oct 19, 2011 2:07 am

Re: Customizable Calendar,Time and Weather addon

Post by Lee »

Ah yes, that reminded me that I once got a tip from you all regarding resizing before :lol: Still, I wanted to make images of these sliced in half at the horizontal for moonrise / moonset, so these'll come in handy. Thanks again :D

Lee
Dragon
Posts: 958
Joined: Wed Oct 19, 2011 2:07 am

Re: Customizable Calendar,Time and Weather addon

Post by Lee »

Well, I've gotten the sky tracing for the moon and sun done. Right now it's displaying a 6am/pm-6pm/am cycle but I'll make it so the movement is decoupled from this time reference and move based on offsets / relative time i.e. sun/moon position currently for 6am will be linked to sunrise, whatever the value set for it may be. I'll do that when I have the time as I also want to tackle real lunar tracking, so I'll set this aside for now.

I've attached a screenshot of how it looks like in this early stage. As time changes, so too does the position (and phases) of the sun /moon change. It was really nice that both this add-on and AMs moon module fit well together, as if they were meant to be combined :D. As you can see, I wanted to put day / night weather backgrounds that tie into the settings made by this weather add-on. One of the challenges to this is finding free, but nice vector / banner art. I've been looking, and though there were a lot, the quality wasn't quite up to par for most, while the good ones had licensing / watermarks tied to them. With that being said, I'd like to wait for the updates specified by the OP so I can tie the art and logic from there. If anyone can point me to a good resource for banner type vistas, preferably ones without a sun or moon in them and requiring very little processing, I'll be grateful :D

Anyway, I plan to do the ff. when I get the time
1. art asset hunt
2. proper simulation of solar and lunar positions and movements
3. dynamic backgrounds (cloud "movement", weather shifts)
4. properties and events editor
5. additional controls such as a radio-centric interface etc.

so, my next update will probably take a while :D I'll look forward to the updates till then :)
Attachments
Sky Map.png
Sky Map.png (397.76 KiB) Viewed 2658 times

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: Customizable Calendar,Time and Weather addon

Post by aliasmask »

I use this as a resource for background images:

http://free-photo.gatag.net/en/category ... dscape/sky

Are you looking for gifs with moving images? I found this with a google search: http://www.pbase.com/es839145/animated_sky

Post Reply

Return to “User Creations”