A frequent question for RPG-devs on the SugarCube channels is “how do I make an NPC schedule or calendar”. Since I already have a set of date/time macros, which have seen some use, it made sense to me to make a Scheduler addon for it.
Features
Create schedules with <<schedule>> or new Schedule()
Store schedules in normal story variables
Assign dates, partial dates, or date ranges to events
Check if a given event is live, or get a list of all active events on a schedule
Make as many schedules as you like, attach them to different datesystems
Write schedule times in easy notation like 7mo 10d or 5mo -> 10mo
Note: This release also updates the base DATESYSTEM to v1.1, which switches the meaning of [y] and [Y] in date formats, renames some methods, and fixes some bugs with dateCompare() .
Hi! Great, amazing idea. I have been using your Date plugin for my game. However, I get the following error as a popup when I boot my game with the new schedules on. Error [StoryInit]: cannot execute macro <<schedule>>: ["$","_"].contains is not a function.
I have tried to replace with .includes in all three instances but it seems to just return more errors.
I have even tried updating to Dates 1.1.
Thanks for the plugin!
That looks like a SugarCube 2.37 issue, in that it removes contains() and switches to includes().
Making the three changes (which I assume are the ones you did) the code runs fine in 2.37 for me (and I’ve pushed the updated version to gitHub), so I’d be interested in knowing what the other errors you are seeing are.
Ok, I tried getting your updated version but it has the same error as I had when I switched the JS myself.
It returns a black game (there is no Passage or Story title, just the Save and Restart buttons) and when I go into Debug mode and press Play I get this error:
d.split is not a function or its return value is not iterable.
I play around with it a bit more and it seems to be an issue with the <<schedule $schedule>> macro. Whenever I add it it gives me what’s above, not the Javascript itself though.
I think the issue was a problem reviving the Schedule, where it ended up trying to parse the event it had already parsed. I’ve pushed a new version that should hopefully fix that.