Board Thread:The Scriptorium/@comment-25172533-20140803184211/@comment-24150802-20140806112305

This comment starts by explaining cron in (hopefully good) detail, then talks about Resting in the Inn, and finally mentions non-default custom day starts. Please DO ask ANY questions about anything I've written that doesn't make sense, no matter how minor you think it might be! Note that I might have some details a bit wrong but I think it's pretty close to perfect. ;)

To start with, assume we're talking about a player with a custom day start of 0 (midnight) which is the default. This means that each day starts at midnight.

HabitRPG is built so that when you take your FIRST action on a day, then just BEFORE that action is applied, Habit does various start-of-day things ("cron"): it looks for incomplete Dailies and damages you for them; it unticks all Dailies so you can use them again; it applies progress to your quest; etc (a more complete list is below). It then checks to see if your Health is less than zero, and if so, it makes you die. AFTER that, it applies the first action that you took.

That first action that you took which triggered cron could have been anything. It could have been logging in to the site, or (if you are still logged in from yesterday) ticking off a task, or hitting the sync button, or reloading the page, or buying a reward, or changing equipment, or casting a skill - literally ANY action that you take will trigger the start-of-day things (cron) IF that action is your first action of the day.

Here is the (mostly) complete list of cron actions (the *** asterisks are explained later):

- For each incomplete Daily:

- reset the Daily's streak to zero

- apply damage to you

- if you are on a boss quest, apply extra damage to you and to all other party members on that quest

- change the value of the Daily to make it slightly more red

- untick all of the Daily's checkboxes

- For each Daily that you had ticked off:

- untick all of the Daily's checkboxes

- untick the Daily itself

- For each Habit that has only a "+" action or only a "-" action, change the value of the Habit to make it slightly more yellow (i.e., less red OR less blue).

- For each To-Do, change its value to make it slightly more red.

- Check your Health to see if it is less than zero, and if so do the Death_Mechanics things.

- Reset your drop count to zero (allowing you to find more drops today even if you reached your drop cap yesterday). ***

- Remove any buffs you had gained the previous day (this happens after the above actions so that your buffs are still helping you during the cron actions). ***

- Work out if a Perfect Day buff has been earned and if so apply it.

- Give you extra mana (this happens after the Perfect Day buff has been applied so that you gain even more mana from it).

- If you are on a quest (boss or collection), take the quest progress that you personally had built up since the previous cron (i.e., damage to the boss or collection items found), apply that progress to the quest, and then return your personal quest progress to zero (then check to see if the quest is finished and if so, do end-of-quest things like giving out rewards).

I said above "when you take your FIRST action on a day, just BEFORE that action is applied, Habit does various start-of-day things". The very first thing that Habit does is check to see if you are Resting in the Inn. If so, it skips ALL of the other start-of-day things EXCEPT for those two items that I marked above with ***. And that is how Resting in the Inn works. :) I.e., it prevents everything in the list above from happening except that your drop count is still reset to zero and your buffs from the previous day are removed.

Note that Resting in the Inn does NOT prevent you yourself from taking any actions. You can still tick off tasks (including any Dailies that are not already ticked), you can untick Dailies if you wish to, etc, etc, etc. This means that, as you noticed above, when you stop Resting in the Inn, your dailies might NOT be in the same state they were in when you started Resting - if you yourself changed your Dailies, then they'll stay changed.

To put it another way, Resting in the Inn does NOT change your Dailies in any way - all that it does is it prevents cron from taking actions.

You wrote above "If you continue to check off Dailies, this makes it sound like they would count as complete when cron restarts" -- Yes, exactly!

And now, about the custom day start:

I said above "HabitRPG is built so that when you take your FIRST action on a day, just BEFORE that action is applied, Habit does various start-of-day things". The "FIRST action on a day" is taken to be the first action AFTER your custom day start. So, if your custom day start is set to midnight, then if you take your first action at 1 minute past midnight, that is when cron would be triggered (if you are not Resting!); alternatively if you take your first action at 8am, cron would be triggered at 8am.

If your custom day start is not midnight, everything above still works exactly the same way, but the start time for the day is different. So, if your custom day start is 2am, and you take your "first action" at 2:01am, then cron would be triggered at 2:01am. If your custom day start is 2am, and you take your "first action" at 8am, then cron would be triggered at 8am.

One final point:

A common misunderstanding about cron is that cron happens at midnight (or at whatever time your custom day start is). It does not. As described above, cron happens only when you take your first action of the day (i.e., your first action after your custom day start time has passed). From what I've seen, this misunderstanding largely came about because those of us who have a good understanding of cron have sometimes spoken about it using careless terminology - we always knew exactly what we meant, but we didn't think to speak carefully enough that non-technical people would also know! The wiki used to perpetuate this myth, unfortunately, but I think we corrected that a little while ago.

There's probably still more that I can say, but I think this is enough for now. Questions or requests for clarification are welcome. :)