This GUI and associated scripts allows you to create your own custom calendar of an arbitrary number of days, including support for zero or one leap days.
You do this by creating a calendar.2da file, for which a Faerun based calendar is provided as an example.
In game a player will see a clock icon off to the side (whose hands move every game hour) Clicking on the clock will expand the pane and show the following:
The current day of the year such as:
"1st of Hammer"
An additional line of text such as
"Summer Solstice"
An icon that displays whether or not the sun is rising, setting, or normal. If it is night, it will show the phase of the moon.
The GUI information gets updated every in game hour for each logged in player.
You can choose via a script setting to turn off the sun/moon phase icon.
There are several useful function in the provided scripts that will help you in reconciling your custom calendar with the games internal fixed calendar.
The custom calendar scripts tracks its information against the internal fixed game calendar, by determining the number of days elapsed since a universal "sync date" that you designate.
This allows you to no longer be bound by a fixed 12 month 28 day cycle as is the default in NWN2. You can have any number of months, with any number of days within them according to how you want to set up your 2DA file.
The UI files need to be distributed to the clients, the calendar.2da file should be server side only.
I'd sure love to start using something like this with my HCR2 Pathfinder base module I'm building. Any chance this could be updated to HCR2 and 1.23?
Posted by Lance Botelle at 2008-09-22 07:41:42 Voted 8.00 on 09/22/08
Hi,
OK, I am going for a halfway vote of 8.0, and here is why ....
I ripped out all my own scripts again (which worked) and ensured I set up the original scripts as they had worked in the original mod. And would you believe it, I had the same problems ... again!
And this was after ensuring I was using the custom year script provided. For some reason, the functions that calculate the number of passed days fail to work in my mod (after passing the year end). At this stage, it may be something down to the fact that I also have MotB installed and this hak is only set to work with v1.06.
So, unless I do find out what is going on, I will leave this as it stands.
Edward ... If you do read this and know what may be happening, please contact me. :)
Cheers!
Lance. _________________________ World of Althéa Blog: Link
Posted by Lance Botelle at 2008-09-22 07:03:03 Voted 8.00 on 09/22/08
Hi,
Back to a 9.00, as I discovered that this module works exactly as it says. I must have set mine up wrong somewhere. :( I did notice a function that I could use GetCustomCalendarYear() that helped sort out the year issue.
Anyway, that will teach me for not looking close enough in the first place. ;)
Lance. _________________________ World of Althéa Blog: Link
Posted by Lance Botelle at 2008-09-21 14:40:58 Voted 8.00 on 09/22/08
Hi,
I had to write a new function to make the calendar work with the year crossover issue I discovered. I used campaign variables to help keep track of actual days passed and incremented them as required. This was then used in the GetDaysPastSyncDate function (instead of the supplied code) to recall the correct number of passed days. I also had to revise the Onload section to recall the stored days to date.
In light of this, I revised my score as an indication that there is an issue with this at the moment which looks as though people need to do some extra coding to get this to work as it should.
I have not yet heard anything to the contrary. If I do (and I have it all wrong), I will revise my score again :)
It is still a "VERY GOOD, DESERVES A LOOK", but the error due to the year switch over problem, unfortunately, knocks it down a bit.
Finally, if anybody wants information on my additions that I made (in detail) that made it work, contact me via the Vault email link that I supply in my details (or in the bioware forums).
Lance. _________________________ World of Althéa Blog: Link
Posted by Lance Botelle at 2008-09-18 17:32:01 Voted 8.00 on 09/22/08
Re Above ....
Actually, I have a nasty feeling that you cannot treat time with NWN2 this way (if its like NWN1) and will not be able to "go back in time" for calendars that have more than 336 days to a year.
I think you may need to set another variable to keep track of the year and not make reference to the offcial calendar year as a tracking reference (if you see what I mean) apart from actual passed time. Mind you, I have not studied your scripts too closely yet, and so it may just be me misunderstanding the code and setting it up wrong.
Let me know when you get the chance. :)
Thanks, Lance. _________________________ World of Althéa Blog: Link
Posted by Lance Botelle at 2008-09-18 17:14:09 Voted 8.00 on 09/22/08
Hi,
I am using this code for my own calendar and have my own 360 day year 2da set up fine. As a test, I set the date to 28 day 12th month 1197 year (last day of 1197 in the normal calendar) as the module start date and in the constants.
In testing, this returns the 6th Mortall (which I expected). However, when I rested to allow the day to move forward by one day (not the end of my year), the date suddenly moved to 27th Irion 1198 and not 7th Mortall 1197.
The problem was the year jumped forward and onto a new date (at the end of the normal calendar year) and did not reflect the correct date for my calendar.
Is there a fault in the scripts?
By the way, could you type out what the following means in "long hand" please so that I can understand the scripts better. Thanks:
int nRemainderDays = nDaysPastSyncDate % CustomCalendarDaysPerYear;
(I don't know what the % means or does here.)
Thanks in advance, Lance. _________________________ World of Althéa Blog: Link
Posted by Lance Botelle at 2008-08-31 01:04:37 Voted 8.00 on 09/22/08
This looks very useful and is something I was after for my own world. Thanks for providing this.
Lance. _________________________ World of Althéa Blog: Link
Posted by Arvirago at 2008-03-17 13:43:47 Voted 8.25 on 03/17/08
Excellent work. _________________________ Reino de Aldor
Posted by jallaix at 2007-09-19 07:20:26 Voted 9.50 on 09/19/07
Posted by jallaix at 2007-08-01 01:16:10 Voted 9.50 on 09/19/07
I think you forgot to provide the Faerun-based calendar.2da in your zip. _________________________ Spellcasting Framework Wild/Dead Magic Zone (Spellcasting Framework add-on)
You must be Logged In to post comments in this section.
10 - A Masterpiece, Genuinely Groundbreaking 9 - Outstanding, a Must Have 8 - Excellent, Recommended to Anyone 7 - Very Good, Deserves a Look 6 - Good, Qualified Recommendation 5 - Fair, Solid yet Unremarkable 4 - Some Merit, Requires Improvements 3 - Poor Execution, Potential Unrealized 2 - Very Little Appeal 1 - Not Recommended to Anyone