DICE PACKS BUNDLE
  1. #1

    Barovian Calendar

    I've been digging into the calendar stuff lately and noticed that it seems the barovian calendar entry may be incomplete. I know there isnt an official published standard for the barovian calendar, so its implementation is subject to interpretation.

    In the calendar.mod db.xml, the barovian calendar includes the tags:
    Code:
    <lunardaycalc type="string">barovian</lunardaycalc>
    and 
    <periodvarcalc type="string">barovian</periodvarcalc>
    However, in the corerpg manager_calendar.lua file, there are no registered or defined LunarDayHandler or MonthVarHandler functions for the Barovian calendar. So these tags from the calendar appear to be ignored. The calendar is defined to have 30 days per month except Oct which has 31, and without a barovian lunardayhandler defined the months all start on the first day of the week. If the month were 28 days instead, the function wouldnt be needed. Also, I cant find any reference that Barovia has leap years, so that tag can probably be removed.

    calendar of barovia.jpg
    Last edited by mattekure; February 12th, 2019 at 13:20.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  2. #2
    The following lunar day calculator works for the barovian calendar as currently defined in the FG calendar.

    Code:
    function calcBaroviaLunarDay(nYear, nMonth, nDay)
    	local rYear = nYear%7;
    	if (rYear % 2) == 0 then
    		rYearDay = (rYear/2);
    	else
    		rYearDay = (rYear/2)+3.5;
    	end
    
    	local rMonthDays = (nMonth-1)*30;
    	if nMonth > 10 then
    		rMonthDays = rMonthDays + 1;
    	end
    	local rDay = (rYearDay + rMonthDays + nDay)%7;
    	if rDay == 0 then
    		return 7;
    	end
    	return rDay;
    end
    Last edited by mattekure; February 12th, 2019 at 15:09.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

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