SetCalendar(int, int, int)

From NWN Lexicon
Jump to: navigation, search

Set the calendar to the specified date.

void SetCalendar(
    int nYear,
    int nMonth,
    int nDay
);

Parameters

nYear
Specific year to set calendar to from 0 to 32000 inclusive.
nMonth
Specific month to set calendar from 1 to 12 inclusive.
nDay
Specific day to set calendar to from 1 to 28 inclusive.

Description

Set the calendar to the specified date.

Time can only be advanced forwards; attempting to set the time backwards will result in no change to the calendar.

If values larger than the month or day are specified, they will be wrapped around and the overflow will be used to advance the next field. e.g. Specifying a year of 1350, month of 33 and day of 10 will result in the calender being set to a year of 1352, a month of 9 and a day of 10.

Remarks

The start module date is setup in the module properties. The values available are the same as this function.

This moves time forward further than SetTime. Therefore setting the calendar also affects anything using the in-game time - ie:

  • Effects and any temporary durations (done with in game seconds)
  • Poison effect times (1 in game minute)
  • Disease incubation times (24 in game hours)
  • DelayCommand() calls (done with in game seconds)

Therefore especially around DelayCommand be aware of when SetCalendar is used. If a DelayCommand fires another DelayCommand, only one is issued (moving forwards a day won't fire 24 hours worth of DelayCommand functions).

SetTime is more suitable for smaller time changes, since this is just basically a longer version of it (going from a day and up).

Known Bugs

No known bugs.

Version

1.30

See Also

functions: 

SetTime GetCalendarYear GetCalendarMonth GetCalendarDay

events: 

OnModuleLoad Event



 author: Jody Fletcher, editor: Lilac Soul, additional contributor(s): Jon Dewey, Lilac Soul