5E Product Walkthrough Playlist
Page 1 of 3 123 Last
  1. #1

    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.


    calendarexample_gregorian.jpg
    calendarexample_homebrew.jpg

  2. #2

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    Nominate this for sticky.

  3. #3
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    17,147
    Blog Entries
    9
    Stickied or put in a post of resource links (which I don't know if there is one that really fits yet).

    Problems? See; How to Report Issues, Bugs & Problems
    On Licensing & Distributing Community Content
    Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
    Note, I am not a SmiteWorks employee or representative, I'm just a user like you.

  4. #4
    Is it possible to modify the number of months in a custom calendar (more or less than 12)?
    Aaron Smalley
    FG2- Ultimate License Holder since 2012, upgraded to FGU in 2021
    Freelance Writer for Iron Crown Enterprises/Guild Companion Publishing (Rolemaster/HARP)
    Developer of the Channel Cities and World of Ærnth setting
    Fan of Rolemaster since 1983
    40+ years of RPG GMing
    Also a fan of Eclipse Phase, The Everlasting, MERP, and many others

  5. #5
    This is a nice post, thanks for putting it together. You can also take a look at the custom calendar tutorial I put together here https://www.fantasygrounds.com/forum...endar-Tutorial It shows how to customize all the elements of a calendar including using extensions to calculate leap years, and making the days of the week flow properly from month to month.

    For your reference, in the calendar there are 2 tags which call out and refer to code that is either defined within the corerpg ruleset, or you have to provide it as an extensions.

    <lunardaycalc> - the text within this tag is used to point to a lua function that calculates what day of the week a specific date should fall. the gregorian one takes into account all of the little oddities around leap years and such. this is so that if you have Mar 31 land on a tuesday, you want Apr 1 to land on a Wednesday. without this function, FG will have April 1 start on a sunday. Just putting in a name wont make it work unless that function is defined either in the underlying ruleset, or in an extension. All of the calendars in the provided calendar module have their codes defined within the CoreRPG ruleset (and inherited by 5e and others).

    <periodvarcalc> the text within this tag is used to determine if there are any leap days to be added to the calendar year. If your calendar has no leap days, you dont need this tag. the gregorian calendar has a function to add the 29 of Feb pre-defined. putting in a name without the function defined will just be ignored.
    Last edited by mattekure; April 8th, 2019 at 14:58.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  6. #6
    Quote Originally Posted by adsmalley View Post
    Is it possible to modify the number of months in a custom calendar (more or less than 12)?
    Yes, you can have any number of months, at least 1.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  7. #7
    If I'm using a ruleset created before Core, is there a way of using a calendar with it? I'm lookin g for a Calendar for the WFRP Old Word

  8. #8
    Quote Originally Posted by Thete View Post
    If I'm using a ruleset created before Core, is there a way of using a calendar with it? I'm lookin g for a Calendar for the WFRP Old Word
    yes you can, you just have to have any code portion of the calendar be in an extension. The calendar module itself doesnt have to change. So the portsions that would have to be in an extension is the code for any leap years, and code needed to make the days of the week flow correctly. This is the code pointed to by the <lunardaycalc> and <periodvarcalc> tags.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  9. #9
    Quote Originally Posted by Thete View Post
    If I'm using a ruleset created before Core, is there a way of using a calendar with it? I'm lookin g for a Calendar for the WFRP Old Word
    Do you have a link to the definition of the calendar you are wanting to use?
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  10. #10
    I have not created anything files at this stage, I guess I'f be looking at a reference like this https://www.windsofchaos.com/wp-cont...-shorthand.pdf

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