Clock 

The Clock addon extends the game application to implement date and clock features, with reward system, timer and last active features.

It implements general clock features, easy rewards and daily rewards system, last active features to get the last active session datetime data of the application since it was last closed and global clock timer features.

It supports high precision time sync with the local device time, or server time like PlayFab's.

Extend your Construct 3 games with these clock features, with full support with the Date object.

Features

The Clock addon extends the game application to implement date and clock features, with reward systemtimer and last active features. 

It implements general clock features, easy rewards and daily rewards system, last active features to get the last active session datetime data of the application since it was last closed, and global clock timer features.

It also supports high precision time sync with the local device time, or server time like PlayFab's.

Features :

  • Full clock and date feature implementations.

  • Complete Reward system.

  • Complete Daily Reward system.

  • Complete Clock Timer features.

  • Easy to use and no programming required.

  • Well-supported and fully tested.

  • Last Active Session features.

  • Datetime tools and converters.

  • Device time sync.

  • PlayFab online time sync.

  • Custom time sync, with time correction system.

  • High-Precision timers.

  • Extremely efficient.

  • C3 Debugger support.

  • Construct 3 editor support.

  • Construct 3 runtime.

  • Construct 3 worker.

Actions, Conditions & Expressions

Actions

Initialize :

  • Preload Reward - Preload a reward from a previously saved state.

    • Name - The name of the reward.

    • Data - The saved state data, in JSON string.​

  • Preload Daily Reward - Preload a daily reward from a previously saved state.

    • Name - The name of the daily reward.

    • Data - The saved state data, in JSON string.

  • Preload Master - Preload all rewards and daily rewards, using a previously saved unified state.

    • Data - The saved state data, in JSON string.

  • Initialize - Initialize the Clock object, while also loading all the preloaded rewards and daily rewards.

    • Timestamp - The timestamp to base the time now, in milliseconds.


Reward :

  • Create Reward - Create a reward, with a duration before it can be claimed.

    • Name - The name of the reward.

    • Duration - The duration before the reward can be claimed.

    • Duration Type - The unit of time of the duration.

    • Count - The number of times the reward is reset, before it is removed. 0 if indefinite.

    • Expiration - The number of days the reward expires, if unclaimed. 0 if indefinite.

    • Penalty - The penalty if the reward expired.

  • Stop Reward - Remove a reward.

    • Name - The name of the reward.

  • Reset Reward - Reset a reward's duration, this will subtract the remaining reset count.

    • Name - The name of the reward.


Daily Reward :

  • Create Daily Reward - Create a daily reward, with each day is a claim of its own reward.

    • Name - The name of the daily reward.

    • Days Count - The number of days to run the daily reward system. Should be set to at least 1.

    • Cycle - Linear will run continuously, while Repeat will reset the cycle upon clearing all the days.

    • Clamp - If in Linear cycle, check this to limit the number of days to the specified Days Count.

    • Penalty - The penalty if the daily reward expired.

  • Stop Daily Reward - Remove a daily reward.

    • Name - The name of the daily reward.

  • Reset Daily Reward - Reset a daily reward to its first unclaimed day.

    • Name - The name of the daily reward.


General :

  • Claim Reward - Claim a completed reward or daily reward.

    • Name - The name of the reward or daily reward.

    • Reward Type - Either Reward or Daily Reward.

  • Update Time - Update the current time now, with a specified timestamp. Useful for syncing with an online server time, like PlayFab's.

    • Timestamp - The timestamp to base the time now, in milliseconds.


Timer :

  • Start Timer - Start a one-off or regular clock timer.

    • Duration - Enter the time in seconds after which to trigger On Timer.

    • Type - Whether to run this clock timer once, or regularly until cancelled.

    • Tag - Enter a name to identify this timer.

 

  • Start Timer On - Start a one-off or regular clock timer, on a specified timestamp.

    • Timestamp - Enter the timestamp of the date in which to start the timer.

    • Duration - Enter the time in seconds after which to trigger the On Timer.

    • Type - Whether to run this clock timer once, or regularly until cancelled.

    • Tag - Enter a name to identify this timer.

  • Start Timer In - Start a one-off or regular clock timer, with a specified fuse time before firing.

    • Fuse Time - Seconds until the timer starts.

    • Duration - Enter the time in seconds after which to trigger On Timer.

    • Type - Whether to run this clock timer once, or regularly until cancelled.

    • Tag - Enter a name to identify this timer.

  • Stop Timer - Stop a clock timer.

    • Tag - Enter the name of the clock timer to stop.


Expiration :

  • Set Expiration Listen - Whether to enable or disable the reward and daily reward expiration listener.

    • State - Check to enable the expiration listener.

  • Check All Expiration - Scan all rewards and daily rewards if expired. Useful if expiration listener is disabled.

  • Check Expiration - Scan a reward or daily reward if expired. Useful if expiration listener is disabled.

    • Name - The name of the reward or daily reward.

    • Reward Type - Either Reward or Daily Reward.

Conditions

Initialize :

  • Is Initialized - Check if the Clock object has been initialized.​

  • On Initialize - Trigger fires upon initialization.​​

Reward :

  • On Reward - Trigger fires when a reward is completed.

    • Name - The name of the reward.

  • On Any Reward - Trigger fires when any reward is completed.

  • Is Reward Running - Check if a reward is currently running.

    • Name - The name of the reward.


Daily Reward :

  • On Daily Reward - Trigger fires when a daily reward is completed.

    • Name - The name of the daily reward.

  • On Any Daily Reward - Trigger fires when any daily reward is completed.

  • Is Daily Reward Running - Check if a daily reward is currently running.

    • Name - The name of the daily reward.


Timer :

  • On Timer - Trigger fires when a clock timer has elapsed.

    • Tag - Enter the name of the clock timer.

  • Is Timer Running - True if a clock timer with the given tag is currently running.

    • Tag - Enter the name of the clock timer.

  • Is Timer Waiting - Check if a delayed clock timer with the given tag is currently awaiting its fire time to start.

    • Tag - Enter the name of the clock timer.


Reward Lookup :

  • For Each Reward - Loops through all the rewards.

  • For Each Daily Reward - Loops through all the daily rewards.

  • Is Reward Claimable - Check if a reward or daily reward is claimable.

    • Name - The name of the reward or daily reward.

    • Type - Choose the type of reward.


Last Active :

  • Is Last Active - Check if a previous active session state was found.


Expiration :

  • On Expire - Trigger fires upon expiration of a specified reward or daily reward.

    • Name - The name of the reward or daily reward.

    • Type - Check the type of reward.

    • Penalty - Check the expiration penalty.

  • On Any Expire - Trigger fires upon expiration.

Expressions

Reward :

  • RewardName - The name of the reward.

  • RewardStart - The timestamp when the reward started.

    • Name - The name of the reward.

  • RewardEnd - The timestamp when the reward is completed.

    • Name - The name of the reward.

  • RewardElapsedTime - The elapsed time since the reward started, in milliseconds.

    • Name - The name of the reward.

  • RewardTimeLeft - The time left until you can claim the reward, in milliseconds.

    • Name - The name of the reward.

  • RewardDuration - The specified duration until the reward is ready to be claimed, in milliseconds.

    • Name - The name of the reward.

  • RewardCycleCount - The specified number of times the reward can reset, before it is removed.

    • Name - The name of the reward.

  • RewardCurrentCycle - The number of times the reward has been claimed.

    • Name - The name of the reward.

  • RewardExpiration - The specified number of days the reward expires, if unclaimed. 0 if indefinite.

    • Name - The name of the reward.

  • RewardPenalty - Either Reset or Stop. The specified penalty of the reward.

    • Name - The name of the reward.


Daily Reward :

  • DailyName - The name of the daily reward.

  • DailyStart - The timestamp when the daily reward started.

    • Name - The name of the daily reward.

  • DaysPassed - The number of days claimed from the daily reward. If Clamp is checked, it will limit to the specified Days Count.

    • Name - The name of the daily reward.

  • WeeksPassed - The number of weeks claimed from the daily reward. If Clamp is checked, it will limit the number of weeks to the specified Days Count.

    • Name - The name of the daily reward.

  • DayStart - The timestamp when the current day started.

    • Name - The name of the daily reward.

  • DayEnd - The timestamp when the current day is completed.

    • Name - The name of the daily reward.

  • DayElapsedTime - The elapsed time since the day started, in milliseconds.

    • Name - The name of the daily reward.

  • DayTimeLeft - The time left until you can claim the daily reward, in milliseconds.

    • Name - The name of the daily reward.

  • DaysCount - The specified number of days for the daily reward to run.

    • Name - The name of the daily reward.

  • DailyCycle - Either Linear or Repeat. The specified cycle of the daily reward.

    • Name - The name of the daily reward.

  • DailyClamp - Either True or False. The specified clamp property of the daily reward.

    • Name - The name of the daily reward.

  • DailyPenalty - Either Reset or Stop. The specified penalty of the daily reward.

    • Name - The name of the daily reward.


General :

  • RewardData - The save state data of a reward, in JSON string.

    • Name - The name of the reward.

  • DailyRewardData - The save state data of a daily reward, in JSON string.

    • Name - The name of the daily reward.

  • MasterData - The save state data of all rewards and daily rewards, in JSON string.


Timer :

  • StartTime - The timestamp when the clock timer first started.

    • Tag - Enter a name to identify this timer.

  • CurrentTime - Seconds since the start, or the last 'On Timer' event.

    • Tag - Enter a name to identify this timer.

  • TotalTime - Seconds since the clock timer was started.

    • Tag - Enter a name to identify this timer.

  • Duration - The duration in seconds until the next 'On Timer".

    • Tag - Enter a name to identify this timer.


Reward Lookup :

  • CurReward - The current reward name from the 'For Each Reward' loop.

  • CurDailyReward - The current daily reward name from the 'For Each Daily Reward' loop.

  • RewardsCount - Retrieve the current number of rewards.

  • DailyRewardsCount - Retrieve the current number of daily rewards.


Last Active :

  • LastActiveTime - The last recorded timestamp from the previous application session.

  • LastActiveElapsedTime - The elapsed time since the previous application session, to the start of the current, in seconds.

  • CurrentActiveTime - The latest recorded timestamp, of this current application session.

  • RecordInterval - The interval in which the current session's active timestamp is updated for recording, specified in the plugin properties.


Get :

  • Now - Get a timestamp for the current time.

  • Time - Get the current clock time, with respect to the timestamp upon initialization and its delay.


Convert :

  • Parse - Convert a date string to a timestamp.

    • DateString - The date string to parse.

  • ToUTCString - Convert a timestamp to a string using the UTC time zone.

    • Timestamp - The timestamp to convert.


Expiration :

  • ExpiredName - The name of the expired reward or daily reward.

  • ExpiredType - The type of expired reward, either Reward or Daily Reward.

  • ExpiredPenalty - The penalty of the expired reward, either Reset or Stop.

Properties

Full Properties.png

Configuration - The plugin configuration section.

  • Debug - Check to log debugging information in the console.


Clock - The features configuration section.

  • Listen Interval - The interval (ticks) to run the clock processes, greater is more efficient, lower is more accurate. The min is 0, while max is 15.

  • Last Active - Check to continuously record the last active timestamp, to be able to get the last active time in the next application session.

  • Record Interval - The interval (sec) to record the last active timestamp. The minimum is 1.0, recommended is greater or equal 15.0.

  • Expiration Listener - Check to enable the reward and daily reward expiration listener.


Danger Zone - The dangerous configuration section, only change when necessary.

  • Safe Mode - Check to clear the offline data, which is used for the last active feature.

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 toggle enables info logs in the console.

4. Set the listen interval (ticks) to run the clock processes, 
greater is more efficient, lower is more accurate. The min is 
0
while max is 
15.

5. Set the last active to continuously record the last active 
timestamp, to be able to get the last active time in the next 
application session.

6. Set the record interval, in seconds, in which to record the last active 
timestamp.
 The minimum is 1.0, recommended is greater or equal 15.0

7. Check the expiration listener toggle to enable the reward and daily reward expiration listener.

 

8. The Danger Zone's safe mode, if checked, clears the last active features data on startup.
This is best used for debugging your application, but remember to turn this off for production builds.
This is dangerous if ran on production, the players will not be able to get their last active session datetime data.

 
 
 

Feature Showcase

The Clock addon extends the game application to implement date and clock features, with reward system, timer and last active features.
Here are some preview of the demo projects, in using the features.

 
 

Full 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

Daily Reward System

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

Reward System

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

Timer System

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

PlayFab Server Time

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

General Features

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

Last Active System

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 2021 • All rights reserved

Contact Information: