PDA

View Full Version : Adding a Calender to FG



RedRobed
December 14th, 2017, 21:50
Title sais it all. If you can, how? For people who don't read titles, the question itself is How do I add a custom calendar from donjon specifically to Fantasy Grounds. If you can at all.

LordEntrails
December 14th, 2017, 21:56
Yes you can. There are numerous examples here and there in the forums you should be able to search for (I don't have the links). If you can't find them, I assume someone will be along before too long to point you directly to them.

Andraax
December 14th, 2017, 23:36
Click the "Site Search" button on the menu bar. In the search box, type "custom calendar". Visit some of the returned threads.

RedRobed
December 15th, 2017, 09:53
There seems to be some lacking information as always. Mostly my fault for that one. I've searched Custom Calendar but the only thing that shows up are how to Export and add in custom button extensions. I'm looking to Import from my computer to add to the Calendars readily available on the Calendar module. Is it simply a drag and drop? Because what I have access too is a simple Text File and it doesn't allow me to drop it into said Module. (I'm looking at this from a standard Mod perspective when you add a Mod into a game for example like Skyrim.)

damned
December 15th, 2017, 10:09
When you add a mod in for skyrim you dont just grab some random text off the intrawebs.
If you want to import a calendar you will have to open up an existing calendar and see how it works, dissect your own calendar and understand its components, and then using the example write your own code to marry the fg calendar format with your desired calendar.

damned
December 15th, 2017, 10:16
Doing the search as proposed by Andraax reveals 5 full calendar examples in the first five or so links.

https://www.fantasygrounds.com/forums/showthread.php?40251-Custom-Calendar-Help&p=356084&viewfull=1#post356084
https://www.fantasygrounds.com/forums/showthread.php?39435-Help-with-making-a-custom-Calendar-ext-for-Critical-Role-quot-Tal-dorei-campaign-guide-quot&p=348317&viewfull=1#post348317
https://www.fantasygrounds.com/forums/showthread.php?34716-Custom-Calendar-Guidance&p=297393&viewfull=1#post297393
https://www.fantasygrounds.com/forums/showthread.php?34716-Custom-Calendar-Guidance&p=297399&viewfull=1#post297399
https://www.fantasygrounds.com/forums/showthread.php?40767-Help-with-custom-calendar&p=361076&viewfull=1#post361076

Trenloe
December 15th, 2017, 15:50
@RedRobed - I think there is still confusion what you’re wanting to do. Please clarify - you mentioned drag/drop from a text file. Is his just event data you want to add to an existing FG calendar setup, or do you actually want to make a completely new calendr with different days, months, holidays, etc?

If the former, but copy/paste the text into the specific day entries. If the latter then you will need to code an extension to create the underlying calendar structure specific to your requirements in FG.

fouber
January 4th, 2019, 09:39
I'm not sure I'm posting this is the right place, but...

I'm trying to add a custom calendar to calendars.mod. It was successful EXCEPT that the 1st day of each month starts on the 1st day of the week instead of starting where the last month ended. Looking at the examples that are included in calendars.mod, I noticed that only calendars with 7 day weeks are oriented correctly. Is there something special about the Gregorian model that's required to make the first day start on the correct day of the week?

I have included the custom xml and a screenshot of the resulting calendar. My calendar is a bit unusual in that there are 30 week days, 43-47 days a month, and 8 months.

Thanks in advance.

<dravinian>
<name type="string">Dravinian Calendar</name>
<setting type="string">Any</setting>
<lunardaycalc type="string">dravinian</lunardaycalc>
<lunarweek>
<day1 type="string">Bee</day1>
<day2 type="string">Worm</day2>
<day3 type="string">Newt</day3>
<day4 type="string">Dragonfly</day4>
<day5 type="string">Toad</day5>
<day6 type="string">Mouse</day6>
<day7 type="string">Crab</day7>
<day8 type="string">Bat</day8>
<day9 type="string">Squirrel</day9>
<day10 type="string">Hedgehog</day10>
<day11 type="string">Hare</day11>
<day12 type="string">Owl</day12>
<day13 type="string">Swan</day13>
<day14 type="string">Monkey</day14>
<day15 type="string">Badger</day15>
<day16 type="string">Dog</day16>
<day17 type="string">Pig</day17>
<day18 type="string">Wolf</day18>
<day19 type="string">Goat</day19>
<day20 type="string">Tortoise</day20>
<day21 type="string">Donkey</day21>
<day22 type="string">Dolphin</day22>
<day23 type="string">Tiger</day23>
<day24 type="string">Griffin</day24>
<day25 type="string">Ox</day25>
<day26 type="string">Lion</day26>
<day27 type="string">Bear</day27>
<day28 type="string">Rhino</day28>
<day29 type="string">Elephant</day29>
<day30 type="string">Whale</day30>
</lunarweek>
<periods>
<period1>
<days type="number">43</days>
<name type="string">Serpent</name>
</period1>
<period2>
<days type="number">44</days>
<name type="string">Monkey</name>
</period2>
<period3>
<days type="number">45</days>
<name type="string">Boar</name>
</period3>
<period4>
<days type="number">46</days>
<name type="string">Fox</name>
</period4>
<period5>
<days type="number">47</days>
<name type="string">Bear</name>
</period5>
<period6>
<days type="number">46</days>
<name type="string">Crow</name>
</period6>
<period7>
<days type="number">45</days>
<name type="string">Deer</name>
</period7>
<period8>
<days type="number">44</days>
<name type="string">Dragon</name>
</period8>
</periods>
</dravinian>

25817

damned
January 4th, 2019, 12:06
Hi fouber did you look at the five links in post #6?
https://www.fantasygrounds.com/forums/showthread.php?40251-Custom-Calendar-Help&p=356084&viewfull=1#post356084
https://www.fantasygrounds.com/forums/showthread.php?39435-Help-with-making-a-custom-Calendar-ext-for-Critical-Role-quot-Tal-dorei-campaign-guide-quot&p=348317&viewfull=1#post348317
https://www.fantasygrounds.com/forums/showthread.php?34716-Custom-Calendar-Guidance&p=297393&viewfull=1#post297393
https://www.fantasygrounds.com/forums/showthread.php?34716-Custom-Calendar-Guidance&p=297399&viewfull=1#post297399
https://www.fantasygrounds.com/forums/showthread.php?40767-Help-with-custom-calendar&p=361076&viewfull=1#post361076

Andraax
January 4th, 2019, 12:36
Did you create a custom function in an extension for the "dravinian" calendar?

fouber
January 4th, 2019, 19:43
Did you create a custom function in an extension for the "dravinian" calendar?I just came here to say that I fixed it by studying Andraax's script :D. I was previously focusing on modifying the calendar.mod instead of implementing a whole new mod/extension combo, which is a cleaner way to do it anyways. Thank you both for your help.

function onInit()
CalendarManager.registerLunarDayHandler("dravinian", calcDravinianLunarDay);
end

function calcDravinianLunarDay(nYear, nMonth, nDay)
if nMonth == 0 then
return 0;
end
local dayinyear = { 0, 43, 87, 132, 178, 225, 271, 316 };
local rDay = nDay + (nYear-1)*360 + dayinyear[nMonth] + 4;
rDay = rDay % 30;
if rDay == 0 then
return 30;
end
return rDay;
end

25819

Andraax
January 4th, 2019, 19:45
Very good. :-)