5E Product Walkthrough Playlist
  1. #1
    Valyar's Avatar
    Join Date
    Mar 2018
    Location
    Europe
    Posts
    2,117

    Forbidden Lands Calendar module

    I created simple calendar module for Forbidden Lands for the adventure I will run next week. It is based on the calendar of the humans as stated on page 35 of Gamemaster's Guide. Because the section is not verbose enough for those who are calendar freaks (I am not), I made the following decisions:

    • The festivals that divide the phases are on the 1st of the respective month that they precede
    • There is no information on the days in a week so I took 7 days per week.
    • The name of the week days are taken from Pathfinder. I think they sound quite appropriate for the setting


    Below is the module, the extension and a screenshot. If you think this can be approved to be more in tone with the setting let me know.

    Changelog:
    2019-Mar-02: The .mod file updated with periods of 45 days. Added .ext file specific for calculating the start of each month, specific for Ravenlandian calendar
    2019-Mar-04: Uploaded the final version of the calendar v1.0 with 45 days in period, announcement text and FL logo reference upon loading.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Valyar; March 4th, 2019 at 08:36. Reason: change log update
    The past is a rudder to guide us, not an anchor to hold us back.

  2. #2

    Join Date
    Jun 2013
    Location
    Isanti, MN
    Posts
    2,922
    Looks like the ending days of one month do not match up to the beginning days of the following month.

  3. #3
    Valyar's Avatar
    Join Date
    Mar 2018
    Location
    Europe
    Posts
    2,117
    Indeed there is some mismatch on the day one month ends and the other begins. Probably due to the use of the gregorian tag. Have to check what else I can do to alight the days.
    The past is a rudder to guide us, not an anchor to hold us back.

  4. #4
    The reason your calendars dont line up the days is because you do not have an extension with the necessary LUA code. Check out the tutorial here https://www.fantasygrounds.com/forum...endar-Tutorial

    using the gregorian tag means it is trying to use the logic of the gregorian calendar to wrap the days, but that logic doesnt align with how your calendar is defined. You need to write your own function in order to make them wrap properly.

    Does your calendar have leap years?
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  5. #5
    Valyar's Avatar
    Join Date
    Mar 2018
    Location
    Europe
    Posts
    2,117
    Yes, I figured I have to make my own extension for this calendar. I didn't find this thread and I really thank you for having detailed tutorial one. I am going to explore it as soon as possible tomorrow.

    So far I modified the calendar file to use ravenlandian instead gregorian and based on what I have researched so far there is function that is handling months with variable lengths and want to see if it will work for me. (CalendarManager.registerMonthVarHandler)

    The calendar information for the setting is very brief, so in short:
    • No leap year
    • Different number of days in each month
    • Counting starts from Year 0 where there is events called "The Shift". If 0 is problematic for the calculations then Year 1 is from where all counting starts, Day 1 of of the first month (because it is easy and there is no other setting information)
    The past is a rudder to guide us, not an anchor to hold us back.

  6. #6
    The LUA code you are looking for will look something like this:
    Code:
    function onInit()
    	CalendarManager.registerLunarDayHandler("Forbidden_Lands", Forbidden_LandsLunarDay);
    end
    
    function Forbidden_LandsLunarDay(nYear, nMonth, nDay)
    	local rMonth = nMonth -1;
    	local rMonthDays = 0;
    	if nMonth < 3 then
    		rMonthDays = rMonth*45;
    	end
    	if nMonth > 2 then
    		rMonthDays = 90 + ((nMonth-3)*46);
    	end
    	if nMonth > 7 then
    		rMonthDays = rMonthDays -1;
    	end
    	local rDay = (rMonthDays + nDay)%7;
    	if rDay == 0 then
    		return 7;
    	end
    	return rDay;
    end
    I've attached a working calendar module and extension you can take a look at.
    Attached Files Attached Files
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  7. #7
    Valyar's Avatar
    Join Date
    Mar 2018
    Location
    Europe
    Posts
    2,117
    Amazing, mattekure!

    I will check this out and update the main post! I decided to stop at months with 45 days as I couldn't figure proper formula to tackle the 46 days months yet.
    Last edited by Valyar; March 2nd, 2019 at 21:34.
    The past is a rudder to guide us, not an anchor to hold us back.

  8. #8
    the calendar is nice in that there is no drift, year to year it looks the exact same. thats because it has 364 days, an exact multiple of the number of days in a week (7).

    The 45 vs 46 days I just accounted for with a few if statements. ie
    If the month is less than 3 (1 or 2), then its month-1 times 45 days. so month 1 would return 0, and month 2 would return 45.

    If the month is greater than 2, I add 90 (months 1 & 2) and then multiply the month-3 by 46. so month 3 would be 90+0*46. month 4 would be 90+1*46, etc. this is accurate for all the rest of the months except for month 7. that has one less day, so I check if the month is 8, and subtract one day from the previous calculation.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  9. #9
    Valyar's Avatar
    Join Date
    Mar 2018
    Location
    Europe
    Posts
    2,117
    The formula indeed works but the decision to have half the months with 46 day resulted in a unexpected configuration - the start/end of month/year is always the same, which makes the whole calendar very static and I don't like it. I want the dates to shift so I ended up with 45 days per month.

    Because there is no information under what circumstances there are 46 days in month and the possibilities I will leave it here for now. It works and helps for the immersion during play
    The past is a rudder to guide us, not an anchor to hold us back.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
STAR TREK 2d20

Log in

Log in