Items that fast-forward time to Dawn or Dusk?
Dark_Ansem
Member Posts: 992
So, I'm trying to create a consumable magic item that will fast forward time to the module's designated dawn or dusk hour. I can't find any "fast forward" time function, perhaps it's not possible?
0
Comments
https://nwnlexicon.com/index.php?title=SetCalendar
https://nwnlexicon.com/index.php?title=SetTime
You would have to do some basic calculations yourself by using GetHour(), etc.
https://nwnlexicon.com/index.php?title=Category:Time_Functions
You could also fake it with NightToDay/DayToNight. Those don't change time, just changes what PC sees (so, it can be high noon, but looks like Night time, etc)
https://nwnlexicon.com/index.php?title=NightToDay
https://nwnlexicon.com/index.php?title=DayToNight
But the hour of Dawn and Dusk is customisable. Would this take it into account ?
It won't be hard to calculate. Worse case if DUSK < CURRENT HOUR you are increment DAY and then simply setting the HOUR/MIN. Otherwise just set HOUR/MIN.
int GetIsDaytime() { return GetIsDawn() || GetIsDay(); } void main() { int nHour = GetTimeHour(); int bDaytime = GetIsDaytime(); // Advance time until the time of day changes while (bDaytime == GetIsDaytime()) SetTime(++nHour, 0, 0, 0); }