Bug #39932

SetTime function has odd behavior when passing minutes > "module minutes/hour" setting

Added by Eric Ladner 10 months ago. Updated 7 months ago.

Status:SubmittedStart date:01/07/2019
Classification:Public ItemDue date:
Assignee:-% Done:


Target version:-
Found In Version:Public Bug Reports - Next Update Category:Scripting


The documentation for SetTime seems like you can set the in-game time to any arbitrary time between 00:00:00.000 and 23:59:59.999.

However, actually trying to set the in-game time (only once, during module startup) to 13:34 (for example) has very odd effects.

The function treats the minutes like they are bound by the minutes/per hour setting of the module. So, for example, if the minutes/per hour of the module is set to "4" and you try to set the time to 00:05 (5 minutes after midnight), it'll actually set the time to 1:00 (1 AM).

The net effect is that you can set the time to 1:03, 15:03 or 22:03, but not 1:30 or 15:45, etc.

It seems like there's some erroneous code in the SetTime function that's rolling over the minutes based on the hours/minute setting where it should be just scaling the hours and minutes given to set the in-game clock. It shouldn't be an unreasonable expectation to set the clock to anything between 00:00 and 23:59 (and certainly the game clock has no problems attaining that range of values during normal module operation).


#1 Updated by Eric Ladner 8 months ago

I will pay a 100 dollar bounty for the fixing of this bug.

#2 Updated by Eric Ladner 8 months ago

Workaround provided by NWNX function. Still, it would be nice to see this fixed once and for all.

#3 Updated by Bill Harper 7 months ago

  • Status changed from New to Submitted

Internal Report #40476

Hi, thanks for the report! I gave this a look, and there is definitely something going wrong with the function (it appeared even worse to me than you had suggested). So I've advanced the matter for our programmers to analyze, and as soon as they figure out what is going wrong we'll get it into the next available build.

Also available in: Atom PDF