A construct plugin to manage in-game time.
Author: piranha305
Website: https://piranha305.itch.io/
Addon Url: https://www.construct.net/en/make-games/addons/1101/time-system
Download Latest Version : Version: 1.1.0.2
Made using c3ide2-framework
To build the addon, run the following commands:
npm i
node ./build.js
To run the dev server, run
npm i
node ./dev.js
The build uses the pluginConfig file to generate everything else. The main files you may want to look at would be instance.js and scriptInterface.js
| Property Name | Description | Type |
|---|---|---|
| Enabled | Enable or disable the timne system behavior. (if disabled will not tick) | check |
| Tick Rate | How many seconds between each tick. (default 1) | float |
| Tick Duration Type | The type of tick duration. | combo |
| Ticks Per X | How many ticks per X(duration type). | float |
| Current Minute | The current minute. | integer |
| Current Hour | The current hour. | integer |
| Current Day | The current day. | integer |
| Current Month | The current month. | integer |
| Current Year | The current year. | integer |
| Auto Determine Day | Determines the day based on the defined date, if false the current day will be caluclated from defined current day of week | check |
| Current Day Of Week | The current day of the week. | combo |
| Day Phases | How many phases will trigger in the day. | combo |
| Action | Description | Params |
|---|---|---|
| Start Time System | Starts the time system, enabled ticking | |
| Stop Time System | Stops the time system, disables ticking | |
| Set Tick Rate | Sets the tick rate. | Rate (number) |
| Set Ticks Duration | Sets the ticks per {x} duration. | Ticks (number) Type (combo) |
| Set Date | Sets the date. | Day (number) Month (number) Year (number) |
| Set Time | Sets the time. | Hour (number) Minute (number) Time Phase (combo) |
| Set Date Time | Sets the date and time. | Day (number) Month (number) Year (number) Hour (number) Minute (number) Time Phase (combo) |
| Set Auto Determine Day | Sets the auto determine day. Determines the day based on the defined date, if false the current day will be caluclated from defined current day of week | Auto (boolean) |
| Set Day Of Week | Sets the day of week. (does not manipulate time) | Day (combo) |
| Add Date Time | Adds the specified amount of time to the current date and time. | Minutes (number) Hours (number) Days (number) Months (number) Years (number) |
| Set Alarm | Sets the alarm. will trigger OnAlaram condition when time is reached. | Tag (string) Hour (number) Minute (number) Time Phase (combo) Repeat (boolean) |
| Remove Alarm | Removes the alarm. | Tag (string) |
| Set Date Trigger | Sets the date trigger. will trigger OnDateTrigger condition when date is reached. | Tag (string) Day (number) Month (number) Year (number) |
| Remove Date Trigger | Removes the date trigger. | Tag (string) |
| Set Monthly Trigger | Sets the monthly trigger. will trigger OnMonthlyTrigger condition when date is reached. | Tag (string) Day (number) |
| Remove Monthly Trigger | Removes the monthly trigger. | Tag (string) |
| Set Yearly Trigger | Sets the yearly trigger. will trigger OnYearlyTrigger condition when date is reached. | Tag (string) Day (number) Month (number) |
| Remove Yearly Trigger | Removes the yearly trigger. | Tag (string) |
| Go To Next Hour | Goes to the next hour. | |
| Go To Next Day | Goes to the next day. | |
| Go To Next Month | Goes to the next month. | |
| Go To Next Year | Goes to the next year. | |
| Go To Next Day Phase | Goes to the next day phase. | Phase (combo) |
| Go To Next Season | Goes to the next season. | |
| Load Json | Loads the json. | Json (string) |
| Condition | Description | Params |
|---|---|---|
| Is Ticking | Check if the time system is enabled and is ticking. | |
| On Tick | Triggered every tick. | |
| On Minute | Triggered every minute. | |
| On Hour | Triggered every hour. | |
| On Day | Triggered every day. | |
| On Week | Triggered every week. | |
| On Month | Triggered every month. | |
| On Year | Triggered every year. | |
| On Date/Time Changed | Triggered when any date/time value changes. | |
| On Day Phase Change | Triggered when the day phase changes. | |
| Day Phase Is | Check if the current day phase is the specified phase. | Phase (combo) |
| Is Day Time | Check if the current day phase is day. [6:00am - 8:00pm] | |
| Is Night Time | Check if the current day phase is night. [8:00pm - 6:00am] | |
| On Noon | Triggered when the time is noon. | |
| On Midnight | Triggered when the time is midnight. | |
| On Season Changed | Triggered when the season changes. | |
| Season Is | Check if the current season is the specified season. | Season (combo) |
| Date/Time Is | Check if the current date/time is the specified date/time. | Day (number) Month (number) Year (number) Hour (number) Minute (number) Time Phase (combo) |
| Date Is | Check if the current date is the specified date. | Day (number) Month (number) Year (number) |
| Time Is | Check if the current time is the specified time. | Hour (number) Minute (number) Time Phase (combo) |
| Hour Is | Check if the current hour is the specified hour. | Hour (number) Time Phase (combo) |
| Day Is | Check if the current day is the specified day. | Day (number) |
| Day Of Week Is | Check if the current day of the week is the specified day of the week. | Day (combo) |
| Month Is | Check if the current month is the specified month. | Month (number) |
| On Alarm | Triggered when the alarm is triggered. | Tag (string) |
| On Date Trigger | Triggered when the date trigger is triggered. | Tag (string) |
| On Monthly Trigger | Triggered when the monthly trigger is triggered. | Tag (string) |
| On Yearly Trigger | Triggered when the yearly trigger is triggered. | Tag (string) |
| On Solar Term Changed | Triggered when the solar term changes. | |
| Solar Term Is | Check if the current solar term is the specified solar term. | Solar Term (combo) |
| Expression | Description | Return Type | Params |
|---|---|---|---|
| CurrentTick | The current tick. | number | |
| CurrentMinute | The current minute. | number | |
| CurrentHour | The current hour. | number | |
| CurrentDay | The current day. | number | |
| CurrentWeek | The current week. | number | |
| CurrentMonth | The current month. | number | |
| CurrentYear | The current year. | number | |
| CurrentDayOfWeek | The current day of the week. | string | |
| CurrentDayName | The current day of the week. (full-name) | string | |
| CurrentDayShortName | The current day of the week. (short name) | string | |
| CurrentMonthName | The current month. (full-name) | string | |
| CurrentMonthShortName | The current month. (short name) | string | |
| CurrentTime24 | The current time in 24 hour format. | string | |
| CurrentTime12 | The current time in 12 hour format. | string | |
| CurrentDayPhase | The current day phase index. (0=dawn, 1=morning, 2=afternoon, 3=day, 4=dusk, 5=night, 6=late-night) | number | |
| CurrentDayPhaseName | The current day phase. (full-name) | string | |
| CurrentSeason | The current season index. (0=spring, 1=summer, 2=fall, 3=winter) | number | |
| CurrentSeasonName | The current season name. | string | |
| TickRate | The tick rate. | number | |
| TicksPer | The ticks per {x} duration. | number | |
| AsJson | The time system as json. | string | |
| CurrentDayInYear | The current day in the year. (1-365) | number | |
| CurrentSolarTerm | The current solar terms index (0-23). | number | |
| CurrentSolarTermName | The current solar terms. (full-name) | string | |
| CurrentSolarTermLongitude | The current solar terms longitude. in degrees. | number |


