5E Product Walkthrough Playlist
Page 18 of 19 First ... 816171819 Last
  1. #171
    I've been having issues adding leap years to my calendar.
    I'm trying to do something similar to the Gregorian, but extra days on years that are multiples of two (instead of four), not multiples of 10 (instead of 100) except for multiples of 50(instead of 400).
    Unfortunately, the extra days are not being added.
    Experimentally, I've tried applying rollover days and that appears to work, however I do not want them.
    Attached Files Attached Files

  2. #172
    Quote Originally Posted by Berwind View Post
    I've been having issues adding leap years to my calendar.
    I'm trying to do something similar to the Gregorian, but extra days on years that are multiples of two (instead of four), not multiples of 10 (instead of 100) except for multiples of 50(instead of 400).
    Unfortunately, the extra days are not being added.
    Experimentally, I've tried applying rollover days and that appears to work, however I do not want them.
    You are missing a <periodvarcalc> tag in your module db.xml.

    For example, in the gregorian calendar you have both a lunardaycalc tag so that the days of the week line up correctly on the calendar (ie, if Feb 28 is a Wed, then Mar 1 is a Thur). And it has a periodvarcalc to add days to Feb when the conditions are correct.

    Code:
    				<lunardaycalc type="string">MKgregorian</lunardaycalc>
    				<lunarweek>
    					<day1 type="string">Sunday</day1>
    					<day2 type="string">Monday</day2>
    					<day3 type="string">Tuesday</day3>
    					<day4 type="string">Wednesday</day4>
    					<day5 type="string">Thursday</day5>
    					<day6 type="string">Friday</day6>
    					<day7 type="string">Saturday</day7>
    				</lunarweek>
    				<periodvarcalc type="string">MKgregorian</periodvarcalc>
    Your code only has a lunardaycalc, which is never being used/called because you are not registering a lunar day handler. you are registering a monthvar handler which should be defined in the periodvarcalc tag. I recommend you rename the lunardaycalc tag to periodvarcalc and it should start adding the leap years according to your code.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  3. #173
    Quote Originally Posted by mattekure View Post
    You are missing a <periodvarcalc> tag in your module db.xml.

    For example, in the gregorian calendar you have both a lunardaycalc tag so that the days of the week line up correctly on the calendar (ie, if Feb 28 is a Wed, then Mar 1 is a Thur). And it has a periodvarcalc to add days to Feb when the conditions are correct.

    Code:
    				<lunardaycalc type="string">MKgregorian</lunardaycalc>
    				<lunarweek>
    					<day1 type="string">Sunday</day1>
    					<day2 type="string">Monday</day2>
    					<day3 type="string">Tuesday</day3>
    					<day4 type="string">Wednesday</day4>
    					<day5 type="string">Thursday</day5>
    					<day6 type="string">Friday</day6>
    					<day7 type="string">Saturday</day7>
    				</lunarweek>
    				<periodvarcalc type="string">MKgregorian</periodvarcalc>
    Your code only has a lunardaycalc, which is never being used/called because you are not registering a lunar day handler. you are registering a monthvar handler which should be defined in the periodvarcalc tag. I recommend you rename the lunardaycalc tag to periodvarcalc and it should start adding the leap years according to your code.
    That was it. I was so focused on the LUA I didn't catch my mistake in the db.XML.
    Thanks for the extra set of eyes!

  4. #174
    I want to do the Mayan calendar which has two calendars that interlink and the same day combination only repeats every 52 years.

  5. #175
    Quote Originally Posted by Deathloc View Post
    I want to do the Mayan calendar which has two calendars that interlink and the same day combination only repeats every 52 years.
    There is no way currently to run two calendars. You would have to write an extension to add that functionality
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  6. #176
    Mach5RR's Avatar
    Join Date
    Jun 2019
    Location
    San Diego, CA
    Posts
    59
    Out of curiosity, does anyone know how to do a month with two different lengths of the week (7 day/8 day)?

    We have a setting that has a 7 day week, a fortnight which consists of two weeks with a Festival day inbetween, and a month that consists of two fortnights (30 days). I figured the easiest way is to code the first and third week as 8 days, and the 2nd and 4th as 7 day weeks.
    Right now, our workaround is to just make a 15 day week, with seven of the days repeating themselves. But this is ... inelegant to look at.

  7. #177
    How many moons can this track?

  8. #178
    Quote Originally Posted by GM Ithril View Post
    How many moons can this track?
    This thread is about creating custom calendars, it does not do anything with moons. You might get better answers with this moon tracking extension. https://forge.fantasygrounds.com/shop/items/172/view
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  9. #179
    I was under the impression that the lunar day handler had a lunar tracking function?
    Also, will that extension handle 'moons' whose period is greater than a year?
    Last edited by GM Ithril; January 3rd, 2024 at 23:45.

  10. #180
    Quote Originally Posted by GM Ithril View Post
    I was under the impression that the lunar day handler had a lunar tracking function?
    Ah, super easy mistake to make, and mostly my fault. Too much code on the brain when I named it. Inside the FG calendar system is a function which returns the day of the week a particular date falls on. So for example, if you were to pass it the Mar 3, 1542, it would return some value which represents Sun-Sat. That function is called a lunar day handler (I dont know why, I didnt name it) and has nothing to do with the moon. The extension attached is a generic form of that function which allows for calendars without leap years to easily calculate what day of the week a particular date falls on. Without it, each calendar would have to include its own custom extension with this function defined.
    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
  •  
FG Spreadshirt Swag

Log in

Log in