Clock (Legacy)

The Clock addon extends the game application to implement date and clock features.

It primarily functions as a built-in session monitor, so when a player closes an application, it can trace the last time the application was running, capable of both online and offline.

It also has custom session monitors for other tasks.

And it has date-time features, such unix time, utc and local time getters, setters, converters and tools which are convenient in managing data and time implementations.​

The addon implements session and custom monitors, and date-time features.

Intstructions

1. The first step is to add the Clock addon into the project.

2. Setup the plugin's unique properties section.

3. The debug mode toggle enables information logs in the console.

4. The Session Monitor's mode combo box with options off, local, online and both. Determines which session monitors will run, if not none.

5. The timer input is the time in milliseconds where the session monitor will keep updating the internal local storage to record the latest session.

6. The Danger Zone's safe mode, if checked, clears all the clock data on startup, which will reset the internal timer.


This is best used for debugging your application, but remember to turn this off during production.
This is dangerous if ran on production, the players will lose their clock timer data.

 

Features

The Clock is an addon that allows the implementation of session monitors, custom monitors and date-time features into an application made by with Construct 3 for c3runtime.

It allows the developer to record the latest session time the application was previously opened, either online or offline.
Create and manage custom session timers for customized tracking

And also implement get, set and convert date-time for time-based functionalities, including convenience tools to manage time, with support for unix timestamps, utc and local time.

Features :

  • Full date-time feature implementations.

  • Session Monitors, for both local and online.

  • Custom Monitors, for both local and online.

  • Date-time getters, setters and converters.

  • Easy to use and no programming required.

  • Well-supported and fully tested.

  • Built-in internal persistent storage records of sessions.

  • Unix timestamps, UTC and Local Time support.

  • Convenient date-time tool support.

  • Safe mode for debugging.

  • Construct 3 editor support.

  • Construct 3 runtime.

  • Dedicated c3runtime optimization.

  • ES6 API features. 

 
 

Actions, Conditions & Expressions

Actions

Session Monitor :

  • Set Monitor - Sets the session monitor's configuration.

    • Mode - The mode of the session monitor. Either local, online, both or off.

    • Timer - The cycle time it takes to record the recent session.

Custom Monitor :

  • Start Monitor - Start a monitor for an active session in a customized task.

    • Mode - The mode of the session monitor. Either local or online.

    • Timer - The cycle time it takes to record the recent session.

    • Enabled - Set whether the custom monitor is initially disabled or enabled.

    • Tag - A tag, which can be anything you like, to distinguish different monitors.

  • Stop Monitor - Stops the active session monitoring of a customized task.

    • Tag - A tag, to distinguish the monitor to stop.

  • Pause Monitor - Pauses the monitor of a customized task.

    • Tag - A tag, to distinguish the monitor to pause.

  • Resume Monitor - Resumes the monitor of its customized task.

    • Tag - A tag, to distinguish the monitor to resume.

 


Initialization :

  • Initialize - Initialize to start the Clock plugin's features.

Conditions

Session Monitor :

  • On Local Record - Triggers when the session monitor has recorded the last active local time.

  • On Online Record - Triggers when the session monitor has recorded the last active online time.

  • Is Active - Checks if the session monitor is active. Locally, online or both.

    • Mode - Choose the mode of session.

Custom Monitor :

  • On Custom Monitor - Triggers when a custom monitor's timer, distinguished by a tag, has finished a cycle.

    • Tag - Tag string to distinguish different custom monitors.

  • On Any Custom Monitor - Triggers when any custom monitor's timer has finished a cycle.

  • Is Custom Active - Checks if a custom monitor is active locally, online or both, from a tag.

    • Tag - The tag string name to distinguish between different custom monitors.


Custom Monitor : Loop :

  • For Each Monitor - Loops through all the custom monitors, returns the current loop tag on the expression "LoopMonitorTag".

  • Compare Current Tag - Compare the current tag from the "For Each Monitor" loop.

    • Comparison - How to compare the current tag in the For Each Monitor loop.

    • Tag - The tag to compare to.


Tools :

  • On Restore - Triggers on initialization, best time to collect last session's last active expressions before being overwritten by new records.


Initialization :

  • On Initialized - Triggers when the clock plugin features just have finished initializing.

  • Is Initialized - Checks if the initialization has already finished.

Expressions

Session Monitor :

  • SessionTimer - Returns the timer cycle duration of the session monitor, in seconds.

  • OnlineLastActive - Return the latest recorded online active date of the session, in ISO 8601 Extended Format.

  • OnlineLastTimestamp - Return the latest recorded online active timestamp of the session.

  • OfflineLastActive - Return the latest recorded offline active date of the session.

  • OfflineLastTimestamp - Return the latest recorded offline active timestamp of the session.

Custom Monitor :

  • CustomTimer - Returns the timer cycle duration of the custom monitor, in seconds.

    • Tag - The tag to distinguish between different custom monitors.

  • RecentCustomMonitor - Returns the recent custom monitor tag name that completed a timer cycle for active session recording.

  • CustomLastActive - Return the latest recorded custom active timestamp of the session, in ISO 8601 Extended Format if online, or in datetime if local.

    • Tag - The tag to differentiate between different custom monitors.

  • CustomLastTimestamp - Return the latest recorded custom monitor active timestamp of the session.

    • Tag - The tag to differentiate between different custom monitors.


Custom Monitor : Loop :

  • LoopMonitorTag - Returns the current custom monitor tag from the For Each Monitor loop.

  • CountCustomMonitors - Returns the number of custom monitors.


Locale :

  • Day - Returns the day of the month (1-31) according to local time & date. Input the date parameters for customized dates, example: "Day(DateTime)", "Day(Year, Month, ...)" or "Day(Milliseconds)".

  • WeekDay - Returns the day of the week (0-6) according to local time & date. Input the date parameters for customized dates, example: "WeekDay(DateTime)", "WeekDay(Year, Month, ...)" or "WeekDay(Milliseconds)".

  • Year - Returns the year (4 digits) according to local time & date. Input the date parameters for customized dates, example: "Year(DateTime)", "Year(Year, Month, ...)" or "Year(Milliseconds)".

  • Hours - Returns the hour (0-23) according to local time & date. Input the date parameters for customized dates, example: "Hours(DateTime)", "Hours(Year, Month, ...)" or "Hours(Milliseconds)".

  • Milliseconds - Returns the milliseconds (0-999) according to local time & date. Input the date parameters for customized dates, example: "Milliseconds(DateTime)", "Milliseconds(Year, Month, ...)" or "Milliseconds(Milliseconds)".

  • Minutes - Returns the minutes (0-59) according to local time & date. Input the date parameters for customized dates, example: "Minutes(DateTime)", "Minutes(Year, Month, ...)" or "Minutes(Milliseconds)".

  • Month - Returns the month (0-11) according to local time & date. Input the date parameters for customized dates, example: "Month(DateTime)", "Month(Year, Month, ...)" or "Month(Milliseconds)".

  • Seconds - Returns the seconds (0-59) according to local time & date. Input the date parameters for customized dates, example: "Seconds(DateTime)", "Seconds(Year, Month, ...)" or "Seconds(Milliseconds)".

  • TimeZOffset - Returns the time-zone offset in minutes for the current locale. Input the date parameters for customized dates, example: "TimeZOffset(DateTime)", "TimeZOffset(Year, Month, ...)" or "TimeZOffset(Milliseconds)".


UTC :

  • UTC_Day - Returns the day of the month (1-31) according to universal time & date. Input the date parameters for customized dates, example: "UTC_Day(DateTime)", "UTC_Day(Year, Month, ...)" or "UTC_Day(Milliseconds)".

  • UTC_WeekDay - Returns the day of the week (0-6) according to universal time & date. Input the date parameters for customized dates, example: "UTC_WeekDay(DateTime)", "UTC_WeekDay(Year, Month, ...)" or "UTC_WeekDay(Milliseconds)".

  • UTC_Year - Returns the year (4 digits) according to universal time & date. Input the date parameters for customized dates, example: "UTC_Year(DateTime)", "UTC_Year(Year, Month, ...)" or "UTC_Year(Milliseconds)".

  • UTC_Hours - Returns the hour (0-23) according to universal time & date. Input the date parameters for customized dates, example: "UTC_Hours(DateTime)", "UTC_Hours(Year, Month, ...)" or "UTC_Hours(Milliseconds)".

  • UTC_Milliseconds - Returns the milliseconds (0-999) according to universal time & date. Input the date parameters for customized dates, example: "UTC_Milliseconds(DateTime)", "UTC_Milliseconds(Year, Month, ...)" or "UTC_Milliseconds(Milliseconds)".

  • UTC_Minutes - Returns the minutes (0-59) according to universal time & date. Input the date parameters for customized dates, example: "UTC_Minutes(DateTime)", "UTC_Minutes(Year, Month, ...)" or "UTC_Minutes(Milliseconds)".

  • UTC_Month - Returns the month (0-11) according to universal time & date. Input the date parameters for customized dates, example: "UTC_Month(DateTime)", "UTC_Month(Year, Month, ...)" or "UTC_Month(Milliseconds)".

  • UTC_Seconds - Returns the seconds (0-59) according to universal time & date. Input the date parameters for customized dates, example: "UTC_Seconds(DateTime)", "UTC_Seconds(Year, Month, ...)" or "UTC_Seconds(Milliseconds)".


UNIX Epoch :

  • DateNow - Returns the local number of milliseconds elapsed since January 1, 1970 00:00:00 UTC.


Date :

  • Date - Returns the current date and time, specified in the local time zone.

 

  • UNIXToDate - Returns the date and time from the specified UNIX Epoch Time, in milliseconds.

    • Milliseconds - An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the Unix epoch).

  • StringToDate - Returns the date and time from the specified Date String.

    • DateString - A string value representing a date.

  • InputToDate - Returns the date and time from the input. Syntax: "InputToDate(Year, Month)", Optional Syntax: "InputToDate(Year, Month, Day, Hrs, Mins, Secs, Mills)". 'Month' is (0 - 11) and 'Hours' is (0 to 24).

    • Year - Integer value representing the year. Values from 0 to 99 map to the years 1900 to 1999.

    • Month - Integer value representing the month, beginning with 0 for January to 11 for December.


Tools :

  • UnixTime - Returns the elapsed UNIX Epoch Time according to the current datetime, in milliseconds. Input the date parameters for customized dates, example: "UnixTime(DateTime)", "UnixTime(Year, Month, ...)" or "UnixTime(Milliseconds)".

  • msToSeconds - Tool to convert milliseconds to seconds.

    • Milliseconds - The number of milliseconds to convert to seconds.

  • msToMinutes - Tool to convert milliseconds to minutes.

    • Milliseconds - The number of milliseconds to convert to minutes.

  • msToHours - Tool to convert milliseconds to hours.

    • Milliseconds - The number of milliseconds to convert to hours.

  • msToDays - Tool to convert milliseconds to days.

    • Milliseconds - The number of milliseconds to convert to days.

  • msToWeeks - Tool to convert milliseconds to weeks.

    • Milliseconds - The number of milliseconds to convert to weeks.


Miscellaneous :

  • PerformanceNow - Returns the time elapsed since the start of the application document.


Converters :

  • ToISOString - Returns the current date converted to a string following the ISO 8601 Extended Format. Input the date parameters for customized dates, example: "ToISOString(DateTime)", "ToISOString(Year, Month, ...)" or "ToISOString(Milliseconds)".

  • ToUTCString - Returns the current date converted to a string using the UTC timezone. Input the date parameters for customized dates, example: "ToUTCString(DateTime)", "ToUTCString(Year, Month, ...)" or "ToUTCString(Milliseconds)".

  • ToDateString - Returns the current date portion converted to a human-readable string like 'Thu Apr 12 2018'. Input the date parameters for customized dates, example: "ToDateString(DateTime)", "ToDateString(Year, Month, ...)" or "ToDateString(Milliseconds)".

  • ToLocaleDateString - Returns the current date converted to a string with a locality sensitive representation of the date portion based on the system settings. Input the date parameters for customized dates, example: "ToLocaleDateString(DateTime)", "ToLocaleDateString(Year, Month, ...)" or "ToLocaleDateString(Milliseconds)".

  • ToLocaleString - Returns the current date converted to a string with a locality sensitive representation. Input the date parameters for customized dates, example: "ToLocaleString(DateTime)", "ToLocaleString(Year, Month, ...)" or "ToLocaleString(Milliseconds)".

  • ToLocaleTimeString - Returns the current date converted to a string with a locality sensitive representation of the time portion based on the system settings. Input the date parameters for customized dates, example: "ToLocaleTimeString(DateTime)", "ToLocaleTimeString(Year, Month, ...)" or "ToLocaleTimeString(Milliseconds)".

  • ToTimeString - Returns the current date converted to the "time" portion of the Date as a human-readable string. Input the date parameters for customized dates, example: "ToTimeString(DateTime)", "ToTimeString(Year, Month, ...)" or "ToTimeString(Milliseconds)".

Properties

Configuration - The clock configuration section.

  • Debug Mode - Toggle enabled to check for logs, warnings and errors from the clock plugin to the Chrome Developer Console. [F12]

  • Session Monitor - The configuration section for the automated monitor for the player's last active session.

  • Mode - The session monitor's configuration to collect the last active session.

    • Off

    • Local

    • Online

    • Both

  • Timer - The cycle duration to which the session monitor records the last activity. The standard is 5mins. (300 secs).


Danger Zone - Professional Clock configuration, please be wary when applying changes to this section.

  • Safe Mode - If enabled, all recorded data are cleared on every app startup. This is for debugging purposes only, not for production!

 

Feature Showcase

The Clock is an addon that allows the implementation of date-time features including session and custom session monitoring of both local and online time into an application. The addon comes with different sample implementations, the first one (1st) is to show the features of the session monitor, the second (2nd) is to show the features of the custom session monitor and the final two (3rd & 4th) are to show the features of the date-time management features, including the getters, setters, converters and convenience tools.

 
 

Custom Monitor Project

Sample Setup Project

Specifications

  • Instructions - The sample project has comments and instructions on how to use the addon and its features.

  • A.C.E. Coverage - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks to a better use of the addon and of the event-sheet system alongside it.

Supporters

Only

Session Monitor Project

Sample Setup Project

Specifications

  • Instructions - The sample project has comments and instructions on how to use the addon and its features.

  • A.C.E. Coverage - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks to a better use of the addon and of the event-sheet system alongside it.

Supporters

Only

Expressions Tutorial 1

Sample Setup Project

Specifications

  • Instructions - The sample project has comments and instructions on how to use the addon and its features.

  • A.C.E. Coverage - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks to a better use of the addon and of the event-sheet system alongside it.

Supporters

Only

Expressions Tutorial 2

Sample Setup Project

Specifications

  • Instructions - The sample project has comments and instructions on how to use the addon and its features.

  • A.C.E. Coverage - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks to a better use of the addon and of the event-sheet system alongside it.

Supporters

Only

Get the tools

for your pro games!

Constuct Master Collection - Itch.io
Constuct Master Collection - Discord
Constuct Master Collection - Construct 3

© Construct Master Collection 2020 • All rights reserved

Contact Information: