2 Attachment(s)
ELI5: Customizing a Calendar
Hey all, I've been writing an ELI5 (Explain to Me Like I'm Five) for people who wish to have their own custom calendar in Fantasy Grounds but are intimidated or not sure what to do. I am in no way a tech guru so hopefully it's written in a way that can be helpful. It's a step-by-step guide that covers how to modify an existing calendar, not build one from the ground up. Give me a shout if anything is unclear, or wrong, or whatever.
1. Download (if you haven't already) Notepad++ here: https://notepad-plus-plus.org/download/
2. Download (if you don't have it already) WinZip or similar software: https://www.winzip.com/win/en/downwz.html
3. Install both programs to your computer.
4. Locate your Fantasy Grounds folder, the one with subfolders like "cache", "campaigns", "docs" etc. Its location depends on where you installed the program. If you have FG open, an easy way to get there is to open the Images window and click the "Folder" - button. It opens one of the subwindows in your main FG folder (you just need to 'move up' a few steps from there). My installation is in the folder "Program Data", which is a hidden file, so you'd need to set invisible files to visible if you have the same structure.
5. Open the "modules" folder by double-clicking it
6. Right-click and then click Copy on the menu or (ctrl+c) the "calendars" file. Make sure you don't (re)move it from the "modules"-folder! You want a copy of the file to tinker with, don't tinker with the original.
7. Paste the copied "calendars" file somewhere else, for example your desktop or in your Documents folder.
8. Click on the copied calendars file and hit F2 (or right-click and choose "Rename" on the menu) and add the following to the file name: .zip (It should now look like this: calendars.zip )
9. Right-click the file and choose "Open with…Winzip"
10. ((Note - I don't know if this is a new thing or not, but today while I was playing around with the files I could just right-click "calendars.mod" without renaming it to calendars.zip first - if you can edit a .mod-file directly without renaming it you save yourself an extra step later))
11. Winzip unpacks the file and shows you the three files that make up the zipped package: db.xml, definition.xml, and thumbnail.png. We'll start with the file named db.xml
12. Right-click the db.xml file and choose to open it with Notepad++. You may have to find it by using the "Search for an app.." feature that shows up.
13. Once you have it open, you will enter the file proper and this is where we get cracking. Here in the file's innards, you will see how calendars are structured (even I can see it - though the complexities of code are just a bit beyond me, it's easy to see the way it is set up).
14. If you scroll down the list of code, you'll see the name of each calendar embedded here, the uppermost being Gregorian Calendar. Since the Gregorian Calendar is the easiest to relate to we'll use this one to build a new calendar. Don't worry about all the code tags, we don't need to know everything to get this working.
15. Use the mouse to mark everything from <gregorian> to the next <gregorian>. To the left (if you use Notepad++) you'll see that the lines are numbered. The second <gregorian> should be on line 83 or thereabouts. These two tags "wrap" the calendar - everything between them is the stuff that makes the Gregorian calendar, well, the Gregorian calendar.
16. Copy the four first lines of code into a new Notepad++ page (xml version, root version, <calendar>, base static). Now copy everything from <gregorian> to </gregorian) right below those four first lines.
17. Now we replace the word gregorian within both code tags <gregorian> with the name you would like to use for your own calendar. Make sure you write them exactly the same. So instead of having two <gregorian> tags you now write your own name for your calendar. In my case I needed a calendar for my homebrew world, and since the setting employs the calendar of an empire I simply renamed the code tags <Imperial> and </Imperial>. Make sure the second tag keeps the backslash, it tells the program that this is where the info on your calendar ends.
18. Right, now you have a renamed calendar, but it is still the gregorian calendar technically, because as you will see, there's still January, February etc. The process here is simple and really the same as renaming those two tags - you step inside each tag and rename stuff. So instead of <January> you would have, as an example, <Winter's Grip> or whatever.
19. Likewise, you can replace the number of each days in the month with a number more to your liking (instead of January having 31 days, add any other number you would need).
20. Below the tag <lunarweek> you likewise replace the names of the days with something more suitable. Instead of Sunday, I have <Moon's Day>, for example.
21. I am not sure if this step is needed, but I did it and my calendar is working - but I replaced all references to <gregorian> to <Imperial> (in my case), such as in the line <lunardaycalc type="string">gregorian</lundardaycalc> and the corresponding one a little further down the list.
22. Finally, if you wish to add your own special days, you og into the <holidays> section . In the Gregorian calendar you'll see one right away, New Year's Day. We'll use it to build our own special days.
23. If you want to rename New Year to something else, just do the same as we did before. I call it <Day of Winter>. If you need more holidays in the first month, simply copy everything from <holiday1> to </holiday1> and paste it on a new line right below </holiday1>. Rename the "wrapping tags" to <holiday2> and </holiday2>, then rename the day. Replace the number with the number of the day you wish to have this second holiday on.
24. When you wish to add holidays to the other months, copy everything from <holidays> to </holidays> and paste it below the tag <days type = "number">, then replace names and numbers as you see fit.
25. Repeat until you have what you want, then save.
26. You're not quite done yet - you also have to go into the definition.xml file. Here, you add your calendar's name between the <name> tags, your name between the <author> tags, and also define which rulesets can import your calendar (I just left it at <Any>). Save.
27. You should now have a stand-alone file with its own name, e.g. YourNamesCalendar.zip. Rename the zipfile to .mod, and put it back in the correct Fantasy Grounds folder.
28. Start FG, open modules, calendars, and if everything was carefully entered with correct tags et al, you should now see your own calendar as a choice.
I'll add two pictures, one of the original calendars file showing the unmodified Gregorian calendar, and one showing my homebrew calendar. This shows how I simply replaced words and numbers and added holidays to make my own calendar.
Attachment 20916
Attachment 20917