Custom Schedule Keys
First off, if you are a mod user and not a mod author, you've made a wrong turn. This page isn't for you. Begone, user!
Custom Schedule Keys allows you to define specific keys that the game will check for when loading an NPC's daily schedule before it checks any of the vanilla keys. As a quick refresher, a schedule key is something like spring_Mon
, winter_9
, or simply spring
. You can view all of the vanilla keys on this wiki page. With this mod, you can define new ScheduleKeys
that will apply before any of these vanilla keys but only if they match the Conditions
that you specify. If an NPC does not have a schedule using the custom ScheduleKey
in their schedule data, then they will simply not try to use it and vanilla behaviour will apply. If they do have a schedule with a matching custom ScheduleKey
and the Conditions
of that key pass, then they will use that schedule key to load their schedule that day and ignore any vanilla keys.
Again, these keys will apply before any vanilla keys, so it is important to ensure that your Condition
is correct. If a ScheduleKey
has a Condition
that always applies, then an NPC will never use any other schedule! Also, all custom ScheduleKeys
from all installed mods will be collected into one big list of ScheduleKeys
to check. Therefore, the order of all of these keys matters too, as the first one that is found with a valid Condition
is the schedule that is chosen, ignoring all the rest. You can use the MoveEntries
feature of Content Patcher, but you should probably rely on setting a Priority
with your custom ScheduleKey
.
In order to define a custom ScheduleKey
, you will want to do an edit on Spiderbuttons.CustomScheduleKeys/ScheduleKeys
to add a new entry. The model is described below with an example Content Patcher edit further down. Once you've defined a custom ScheduleKey, it can be used in the schedule data of any NPC (e.g. Characters/schedules/Haley
). Again, the schedule will not be used by an NPC if it is not present in their schedule data.
ScheduleKeys Model
Spiderbuttons.CustomScheduleKeys/ScheduleKeys
consists of a list of objects with the following fields:
FIELD | PURPOSE |
---|---|
Id | The Id of your ScheduleKeys list entry. This should be globally unique, so using the {{ModId}}
Content Patcher token is highly recommended. |
ScheduleKey | The custom key to use when attempting to load an NPCs schedule. Because this key will be checked for every NPC, it must be prefixed with your UniqueID in the form of {{ModId}}_ExampleKey to not conflict with other mods who may also be using Custom Schedule Keys. Custom Schedule Keys will not use it otherwise and will yell at you in scary red error text if you try. Don't try and cheat it, either—it will check the mod registry! |
Priority | (Optional) This helps determine the order that all custom schedule keys are checked in. The possible values are Early , Default , and Late . The default value is Default .
The custom ScheduleKeys across all mods are sorted by the following attributes in the following order:
Default + 2 or Late - 10 . The default levels are -1000 (early), 0 (default), and 1000 (late). |
Condition | (Optional) A Game State Query that determines whether this schedule key should be used today.
![]() If you do not include a Condition, this schedule will always apply and no other schedule with later priority, vanilla or modded, will ever be used! |
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | |
15 | |
16 | |
17 | |
18 | |
19 | |
20 | |
21 | |
22 | |
23 | |
24 | |
Console Commands
Custom Schedule Keys also adds one console command to help in debugging and testing schedules: csk_force <schedule key>
. Entering this command in the SMAPI console will force every NPC to attempt to use the schedule key you provided tomorrow, regardless of any other keys that may otherwise have priority (modded or otherwise). For example, entering csk_force spring
will force every NPC to use their generic spring
schedule on the next day, even if it is not actually spring, even if they have other vanilla schedules to apply, and even if you have custom schedule keys defined that should apply. If you force a schedule key but an NPC does not have that schedule key in their schedule data, they will simply default to vanilla schedule loading behaviour. The SMAPI console will output information to let you know which NPCs it successfully forced the schedule for.
Known Issues
Custom schedule keys and csk_force
can potentially work strangely or in unexpected ways if the NPC is currently married. Marriage scheduling is the bane of every NPC mod author's existence, as we all know. Ordinary schedules with custom schedule keys should still work (they will have priority over normal marriage schedules) but keep in mind that the NPC will be starting from the Farmhouse, of course. 0-schedules are more prone to issues and in my testing I found that whether or not they worked was inconsistent for reasons I was unable to figure out. SpaceCore's IgnoreMarriageSchedule
feature may help with this or it may not. Alternatively, you can use Content Patcher When
conditions to make sure that your schedules using custom schedule keys are only added to an NPC's schedule data when they are not married.
If you encounter any issues with using this mod, please feel free to ping me @spiderbuttons in the Stardew Valley Discord in the #making-mods-general
channel. Please do not DM me! Just ping me in the channel.