PDA

View Full Version : Multi calendar extension



Chris_Seal
April 26th, 2015, 20:51
Hi All,

In addition to the modifier extension I have also written a modification to the calendar scripts found in the Rolemaster Classic ruleset. The modification allows for multiple calendars to be opened and closed within a single campaign whilst maintaining a campaign constant date. In other words I can open a calendar used by the lizard folk of the foetid swamps while travelling there, spend a few days and then return to civilised lands and the date has updated accordingly. I've also added some stuff around specifying BC/AD or the local equivalent and put in code for a zodiac/great cycle.

I have also sorted the days so that different years can start on different days if, for example, the year has 365 days and the week has 7.

I had a quick peek at the CoreRPG scripts and see that they are slightly different to the calendar scripts in RMC, but have not attempted to investigate what the differences are, so I don't know if it will work with CoreRPG derived rulesets. Similarly, I had no need of leap years and accordingly, did not code these in, so leap years will not work. If this is something that is important to people I might have another look at it.

If you are interested, I have commented the code fairly extensively and have marked it with -- Code Added in the lua sections and <!-- Code Added --> in the xml. The files I altered were calendar.xml, manager_calendar.lua and calendar_period_list.lua.

The extension needs the calendar module to be slightly rewritten. Every calendar defined needs an <offset>, which is the number of years different from some arbitrary constant year for the local calendar. If the offset is set to 0 then the calendar is defined as the master calendar (there is nothing particularly special about this, other than it can have a year 0). Optional tags include <bc> and <ad>, which are strings that define the terms used for positive and negative years, and <epochcycle><cycle#> which allows for the definition of things like the Chinese zodiac. This master calendar is needed in order to set negative years in the alternate calendars such that AD/BC or their equivalent can be used.

The attached link leads to both the extension and a sample calendar module for you to try.

I've been using this for a few months now and it seems stable - any comments will be gratefully received.

Finally, none of this would have been possible without the original calendar extension. I'm not sure who the original author was, but I am greatly appreciative of their work.

Cheers
Chris

damned
April 27th, 2015, 12:36
Well done Chris_Seal! 2 extensions in 2 weeks!