Calendar Error?

This is a new one I haven’t seen before:

release-790 (x64)[M]
…hearth/services/server/calendar/calendar_service.lua:292: invalid duration passed to calendar set timer, "-3060"
stack traceback:
[C]: in function ‘assert’
…hearth/services/server/calendar/calendar_service.lua:292: in function ‘_create_timer’
…hearth/services/server/calendar/calendar_service.lua:182: in function 'set_timer’
stonehearth/ai/actions/run_effect_timed_action.lua:38: in function <stonehearth/ai/actions/run_effect_timed_action.lua:28>
[C]: ?
[C]: ?
[C]: in function ‘execute’
…arth/ai/actions/sleeping/run_sleep_effect_action.lua:14: in function <…arth/ai/actions/sleeping/run_sleep_effect_action.lua:9>
[C]: ?
[C]: ?
[C]: in function ‘execute’

[C]: in function 'run’
stonehearth/components/ai/ai_component.lua:515: in function <stonehearth/components/ai/ai_component.lua:499>
[C]: in function 'xpcall’
radiant/modules/commons.lua:66: in function 'xpcall’
stonehearth/components/ai/ai_component.lua:499: in function '_thread_main’
stonehearth/services/server/threads/thread.lua:273: in function <stonehearth/services/server/threads/thread.lua:270>
[C]: in function 'xpcall’
radiant/modules/commons.lua:66: in function 'xpcall’
stonehearth/services/server/threads/thread.lua:270: in function 'f’
radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>

1 Like

Are you using that mod that makes everyone have super stats?
This error is from someone trying to sleep a negative amount of time. Probably resulted from the super stats

1 Like

Yep that would be it then - I’m using the 1-10 random one - I didn’t see the mod name in the error so I wasn’t sure if it was a mod error or not - thanks!! :smiley:

Go to the Super Stats mod then there’s a way there to solve this bug.

My game had the same. :slight_smile:
I took the liberty to send SwitchLove a message regarding this issue.

Edit:
So… I couldn’t wait… :S

Sleep time for hearthlings is being set by:

 "sleep_duration": {
    "type": "derived",
    "equation": "140 - 1.8 * diligence",
    "min": 60
 },

“diligence” is being set by:

 "diligence": {
    "type": "derived",
    "equation": "mind * 10 + diligence_adjustment"
 },

and “mind” is being set by:

{
“mind”: {
“type”: “random_range”,
“base”: 1,
“max”: 6
},

The good’ol [(-X)^2]/X wouldn’t help here either since the equation value might be too high making the Hearthlings comatosed…
“min”: 60 should kick in but for some reason it doesn’t, or is it?

What’s going on?

This is the mod I’m using:

Should but it doesn’t at least it’s what I have seen.

1 Like

That’s the same mod I was referring to and I have set a const value as well. :slight_smile:
We both know that this is only a workaround and I would like to see a better solution than that. :\