DICE PACKS BUNDLE
Page 11 of 20 First ... 910111213 ... Last
  1. #101
    Quote Originally Posted by CallMeTheFalcon View Post
    So if you look at the screenshot, specifically in the "Date" category, it lists the date as "Arnesmer, 13rd Mared" instead of "Arnesmer, 13th Mared," with 13rd being the weird issue in this example.

    I'm also using a custom calendar extension, which I have included in the attached zip file.
    Ok, I see what you mean. I took a look at your zip file, specifically the Faustacian Calendar.lua file and I think I see the issue. You are using a leap year system where it adds a day every 4 years. Your calcMyMonthVar() function does that correctly. However, your calcMyLunarDay() function does not take leap years into calculation. So when it is calculating what day of the week it is, it will start to go off for every leap year that has passed. In your screenshot its year 1632, which by your rule of every 4 years would mean adding 408 days for your calculation to be correct. So in your calcMyLunarDay() you would need to account for that by including something like
    Code:
    function calcMyLunarDay(nYear, nMonth, nDay)
    	local rYear = nYear * 365;
    	local rMonth = nMonth-1;
    	local rMonthDays = rMonth * 30;
            local rLeapDays = math.floor(nYear/4);
    	local rDay = (rYear + rMonthDays + nDay+rLeapDays)%7;
    	if rDay == 0 then
    		return 7;
    	end
    	return rDay
    end
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  2. #102
    Thanks for looking into this! I went ahead and updated the calcMyLunarDay() function in the lua file, but I'm still getting the same issue with the 11th, 12th, and 13th of each month being displayed as "11st, 12nd, and 13rd" respectively. I've included the screenshot of the error and how it appears in my calendar as well as a zip containing the extension files in case I did something wrong replacing the code.
    Attached Images Attached Images
    Attached Files Attached Files

  3. #103
    Quote Originally Posted by CallMeTheFalcon View Post
    Thanks for looking into this! I went ahead and updated the calcMyLunarDay() function in the lua file, but I'm still getting the same issue with the 11th, 12th, and 13th of each month being displayed as "11st, 12nd, and 13rd" respectively. I've included the screenshot of the error and how it appears in my calendar as well as a zip containing the extension files in case I did something wrong replacing the code.
    can you post your calendar mod file. I'll take a closer look at it tomorrow
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  4. #104

  5. #105
    Quote Originally Posted by CallMeTheFalcon View Post
    Sure!
    Ok, there is still a calculation issue. I'll post my edits in a little bit. But the error you are reporting with the 11, 12, and 13 is actually an error in CoreRPG calendar code. I will create a thread over on the FGU support forum to bring it to the devs attention.

    EDIT: Error thread posted here https://www.fantasygrounds.com/forum...705#post624705
    Last edited by mattekure; October 25th, 2021 at 14:35.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  6. #106
    Quote Originally Posted by CallMeTheFalcon View Post
    Sure!
    OK, I've fixed the calculation issue you were having. Its the primary reason the days of the week would not line up around your intercalary month. Here is the resulting function. The calculation you were missing was accounting for the fact that there was a month that didnt have 30 days, but you were calculating as if every month had 30 days. So during the year, if the date comes after the intercalary month, you need to subtract either 25 days, or 24 if its a leap year since that month is either 5 or 6 days long.

    Code:
    function calcMyLunarDay(nYear, nMonth, nDay)
    	local rYear = nYear * 365;
    	local rMonth = nMonth-1;
    	local rMonthDays = rMonth * 30;
    	if nMonth >=8 then
    		if nYear % 4 == 0 then
    			rYear = rYear - 24
    		else
    			rYear = rYear - 25;
    		end
    	end
    	local rLeapDays = math.floor(nYear/4);
    	local rDay = (rYear + rMonthDays + nDay+rLeapDays)%7;
    	if rDay == 0 then
    		return 7;
    	end
    	return rDay
    end
    Last edited by mattekure; October 25th, 2021 at 15:42.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  7. #107

  8. #108
    Okay, I accidentally deleted all of the OLD calendars while trying to add my custom one. Can anyone help me?

  9. #109
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,674
    Blog Entries
    1
    The calendars are in a module file called calendars.mod

    If you deleted that rerun the updater.
    If you replaced it with your own version rename your file to something else and rerun teh updater.

  10. #110
    This has been amazing and has allowed me to mostly model the imperial calendar for Warhammer Fantasy (crazy stuff with holidays not existing as days of the week or being numbered were ignored).

    The one thing that I am trying to figure out now is if there is a way to change the formatting for multiple holidays falling on the same day. They are currently separated with a "/" and I would prefer that they are on different lines or separated with line breaks. Is this possible within the ext similar to how the date format can be changed? I have no idea how this would be accomplished.

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
  •  
Starfinder Playlist

Log in

Log in