PDA

View Full Version : Custom Calendar question - holidays not assigned to a date



Casimir
June 27th, 2019, 16:55
I've combed through the forums, and in particular Mattekure's tutorial (https://www.fantasygrounds.com/forums/showthread.php?47885-Fantasy-Grounds-Custom-Calendar-Tutorial) for an answer to this but haven't found anything that really answers this question.

Is it possible within the FG code (particularly for DnD 5E) to set up a calendar where holidays don't necessarily get assigned to a fixed date? For example, let's say I have a 3 day holiday called the Midsummer Fire Festival - it's pretty clear how to set that up if it always happens on the 15th of a given month in the year. But what if I want to set that 3 day holiday up so that it always starts on the 2nd Friday of June (to use the Gregorian calendar as the example)? Is that possible to do? Would it be similar (and I assume, a lot more complicated as well) to the LUA script that determines leap years?

Andraax
June 27th, 2019, 18:18
You would have to replace the "isHoliday" and "getHolidayName" functions.

Casimir
June 28th, 2019, 04:13
You would have to replace the "isHoliday" and "getHolidayName" functions.

I apologize, but I'm not familiar with where to find these... I assume, however, that they are core functions within the 5E ruleset itself, correct?

Andraax
June 28th, 2019, 04:53
No, they're part of CoreRPG.

Casimir
June 29th, 2019, 17:57
Thanks, found them both.

Unfortunately, I'm by no means a LUA expert and have no real idea how to begin to make the changes necessary to do this - it already looks like it would be rather complicated, as both functions are based upon specific start days. It looks like it would have to change the calendar's XML file a bit also in order to get the LUA functions to recognize a non-specific start date for the holiday(s).