FG Spreadshirt Swag
Page 1 of 3 123 Last
  1. #1

    Custom Calendar - help with lunardaycalc

    Howdy folks!

    New to FG and still learning the ropes, but I feel like I've searched every single calendar thread on the forums and can't quite find the answer I'm looking for.

    In short: the Gregorian calendar lunardaycalc option makes a calendar work nicely with Monday the 31st coming before Tuesday the 1st of the next month etc. How do I do this with a non-Gregorian calendar?

    My campaign's custom calendar has 12 months of 30 days each, with five days' worth of holidays spread between the months. Each week has only 7 days. How do I make the dates sync up properly to the week days?


    Code:
    	<Collapse>
    				<name type="string">Calendar of Avarus</name>
    				<setting type="string">Collapse</setting>				
    				<lunarweek>
    					<day1 type="string">Saulesday</day1>
    					<day2 type="string">Selensday</day2>
    					<day3 type="string">Tyrsday</day3>
    					<day4 type="string">Crownsday</day4>
    					<day5 type="string">Geldursday</day5>
    					<day6 type="string">Daliasday</day6>
    					<day7 type="string">Ausrinesday</day7>
    				</lunarweek>
    				<periods>
    					<period1>
    						<days type="number">30</days>
    						<name type="string">Kyzer</name>
    					</period1>
    					<period10>
    						<days type="number">30</days>
    						<name type="string">Tavalas</name>
    					</period10>
    					<period11>
    						<days type="number">30</days>
    						<holidays>
    							<holiday1>
    								<duration type="number">1</duration>
    								<name type="string">Autumn Equinox</name>
    								<startday type="number">21</startday>
    							</holiday1>
    						</holidays>
    						<name type="string">Selene</name>
    					</period11>
    					<period12>
    						<days type="number">30</days>
    						<name type="string">Zauberyn</name>
    					</period12>
    					<period13>
    						<days type="number">30</days>
    						<name type="string">Therran</name>
    					</period13>
    					<period14>
    						<days type="number">30</days>
    						<holidays>
    							<holiday1>
    								<duration type="number">1</duration>
    								<name type="string">Winter Solstice</name>
    								<startday type="number">21</startday>
    							</holiday1>
    						</holidays>
    						<name type="string">Morpheus</name>
    					</period14>
    					<period15>
    						<days type="number">1</days>
    						<name type="string">The Dreaming</name>
    					</period15>
    					<period2>
    						<days type="number">30</days>
    						<name type="string">Noxan</name>
    					</period2>
    					<period3>
    						<days type="number">30</days>
    						<holidays>
    							<holiday1>
    								<duration type="number">1</duration>
    								<name type="string">Spring Equinox</name>
    								<startday type="number">21</startday>
    							</holiday1>
    						</holidays>
    						<name type="string">Kovas</name>
    					</period3>
    					<period4>
    						<days type="number">1</days>
    						<holidays>
    							<holiday1>
    								<duration type="number">1</duration>
    								<name type="string">Rebirth</name>
    								<startday type="number">1</startday>
    							</holiday1>
    						</holidays>
    						<name type="string">Rebirth</name>
    					</period4>
    					<period5>
    						<days type="number">30</days>
    						<name type="string">Epsion</name>
    					</period5>
    					<period6>
    						<days type="number">30</days>
    						<name type="string">Amorien</name>
    					</period6>
    					<period7>
    						<days type="number">30</days>
    						<holidays>
    							<holiday1>
    								<duration type="number">1</duration>
    								<name type="string">Summer Solstice</name>
    								<startday type="number">21</startday>
    							</holiday1>
    						</holidays>
    						<name type="string">Saule</name>
    					</period7>
    					<period8>
    						<days type="number">3</days>
    						<holidays>
    							<holiday1>
    								<duration type="number">3</duration>
    								<name type="string">Midsummer Annual Holiday</name>
    								<startday type="number">1</startday>
    							</holiday1>
    							<holiday2>
    								<duration type="number">1</duration>
    								<name type="string">Leap Year - Every Four Years</name>
    								<startday type="number">1</startday>
    							</holiday2>
    						</holidays>
    						<name type="string">Midsummer</name>
    					</period8>
    					<period9>
    						<days type="number">30</days>
    						<name type="string">Ausrine</name>
    					</period9>
    				</periods>
    			</Collapse>
    Bonus points: is there a way to make my 3 day midsummer holiday *4* days long during a leap year?

    Many thanks!!!

  2. #2

    Join Date
    Jun 2013
    Location
    Isanti, MN
    Posts
    2,922
    Try the attached extension & module:

  3. #3
    This was perfect!!! Thank you so much

    I never would've figured out the coding for the extension. Maybe now if I stare at it long enough I can reproduce it and tweak it if I need to make a new calendar for another game.

    (or I'll just make months of even length )

  4. #4

    Join Date
    Jun 2013
    Location
    Isanti, MN
    Posts
    2,922
    It doesn't handle missing leap years - it just assumes every fourth year is a leap year (which is what eventually led to the Gregorian Calendar Reform, the extra leap years made the calendar slowly move forward through the seasons). You didn't give enough details to do anything else.

  5. #5
    Oh, no, I do not need realism here beyond the weekdays syncing up. This is perfect. You see, magic guarantees that the leap year fixes the calendar for eternity. (Screw you, astrophysics! )

    Thanks again

  6. #6
    Quote Originally Posted by Andraax View Post
    Try the attached extension & module:
    This was super helpful in figuring out my own custom calendar for Matt Mercer's Tal'Dorei campaign setting (which is goofy as it has variable length months). Never even touched LUA before, but this was a good enough example to figure it out. Just wanted to say thanks!

  7. #7

    Join Date
    Jun 2013
    Location
    Isanti, MN
    Posts
    2,922
    Quote Originally Posted by mprigge View Post
    This was super helpful in figuring out my own custom calendar for Matt Mercer's Tal'Dorei campaign setting (which is goofy as it has variable length months). Never even touched LUA before, but this was a good enough example to figure it out. Just wanted to say thanks!
    I had already done an extension for the Tal'Dorei setting...

  8. #8
    Quote Originally Posted by Andraax View Post
    I had already done an extension for the Tal'Dorei setting...
    Oh. Well that sorta sucks. It was a useful learning exercise as I've never used LUA much less tried to create an extension for FG, but still sucks to cross the same ground someone else has crossed.

    Note to self: use google to search FG, not FG to search FG. :-)

  9. #9

    Join Date
    Jun 2013
    Location
    Isanti, MN
    Posts
    2,922
    You can always compare code; I do that occasionally to improve my own.

  10. #10
    Quote Originally Posted by Andraax View Post
    You can always compare code; I do that occasionally to improve my own.
    I already did and it was very helpful! Your LUA is far more compact - you can definitely tell I was learning as I was going. However, the lunar day calc is "wrong" in the sense that you were given the wrong date reference in that thread. There's a whole thread on reddit trying to establish the timeline of CR's first campaign that goes into that in depth, but a "canon" date is Conthsen, 24 Duscar 811 PD which isn't what you were given. But aside from that, yours is far better. :-)

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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