I’m finally happy to announce the official release of my custom time system macros for Sugarcube, which I have creatively called DATESYSTEM The Datesystem macros are intended to provide an entire drop-in date/time system, capable of imitating a Gregorian calendar, or supporting an entirely custom date/time system. It offers a variety of macros, and corresponding JS functions.
These macros are intended for anyone who’d like a complex date/time system in their Twine/Sugarcube game, but don’t want to write their own. Need more features? Let me know and I’ll be happy to look at adding them.
Features
* Fully customisable date system (min/hour/day/month/year lengths) - defaults to Gregorian
* Custom month names
* Custom day names
* Custom time unit names
* Leap year support
* Set to real-world time
* Sends custom event when time changes
* Supports multiple time systems in one game
* Time tracked in a single story variable for each time system
Macros
* <<date>> outputs a formatted date or time, with full format control
* <<dateset>> sets the date/time
* <<dateto>> sets to an absolute time
* <<dateadd>> moves the time forward by some unit(s)
* <<datesubtract>> moves the time backwards by some unit(s)
* <<datenext>> moves the time forward to the next minute/hour/day/year (i.e discards fractions of that time unit)
* <<datereset>> sets the new base time and resets the time counter
* <<dateperiod>> outputs a time as a period/duration
* <<dateticker>> creates a ticking clock with 1s precision
* <<datesetup>> handles the setup of the date system
Functions
* Functional versions of every macro
* dateCompare() function to compare parts of dates