Lumberyard
Legacy Reference

Time Nodes

Flow Graph is deprecated and will be removed in a future version of Lumberyard. Learn about Script Canvas, Lumberyard's new visual scripting environment.

This topic references tools and features that are legacy. If you want to use legacy tools in Lumberyard Editor, disable the CryEntity Removal gem using the Project Configurator or the command line. To learn about the latest features, see the Amazon Lumberyard User Guide.

You can use these flow graph nodes to define time settings.

Delay

Delays passing the signal from [In] to [Out] for the specified length of time (seconds).

Inputs

Port Type Description
In Any

Value to pass after the specified delay time

Delay Float

Delay time in seconds

Default value: 1

Valid values: 0100

resetOnInput Boolean

When set to true, resets the node with each input, setting the delay counter to 0 and erasing previous inputs

Default value: 0

Valid values: 0=false | 1=true

Outputs

Port Type Description
out Any

Value that is passed after the specified frame delay

FrameDelay

Delays passing the signal from [In] to [Out] for the specified number of frames.

Inputs

Port Type Description
In Any

Value to pass after the specified delay time

NFrames Integer

Number of frames to delay passing the signal from [In] to [Out]

Default value: 1

Valid values: 0100

Outputs

Port Type Description
out Any

Value that is passed after the specified frame delay

MeasureTime

Measures the elapsed time.

Inputs

Port Type Description
Start Any

Trigger to begin measuring time as it passes

Stop Any

Trigger to stop measuring the elapsed time

Outputs

Port Type Description
Started Any

Triggered on start

Stopped Any

Triggered on stop

Elapsed Any

Elapsed time in seconds

RandomDelay

Delays passing the signal from [In] to [Out] for a random amount of time (seconds) within the [MinDelay, MaxDelay] interval.

Inputs

Port Type Description
In Any

Value to pass after the specified delay time

MinDelay Float

Minimum random delay time in seconds

Default value: 1

Valid values: 0100

MaxDelay Float

Maximum random delay time in seconds

Default value: 2

Valid values: 0100

Outputs

Port Type Description
Out Any

Value that is passed after the specified delay time

RealTime

Reads your system time. RealTime can be used to display time on screen (such as a player's watch) or synchronize the time of day with real world time.

Inputs

Port Type Description
force_update Any

Forces an update of the system time

Outputs

Port Type Description
Hours Integer

Current hour as reported by your system time

Minutes Integer

Current minutes as reported by your system time

Seconds Integer

Current seconds as reported by your system time

Datetime String

Outputs your system date and time

Epoch Integer

Current epoch as reported by your system time

ServerTime

Reads the server time and reports the current time (seconds or milliseconds) for the specified period.

Inputs

Port Type Description
Basetime Float

Base time in seconds. The server time output is relative to the base time

Default value: 0

Valid values: 0100

Period Float

Number of seconds that should pass before the timer resets to 0

Default value: 0

Valid values: 0100

Outputs

Port Type Description
Secs Integer

Current time in seconds, relative to the base time

Msecs Integer

Current time in milliseconds, relative to the base time

Period Boolean

Triggers the Period output once for each period of time, as specified by the Period input

Valid values: 0=false | 1=true

Time

Outputs the total number of seconds from the start of the game, ticking once per frame.

Inputs

Port Type Description
Paused Boolean

Pauses the time output when set to true.

Default value: 0

Valid values: 0=false | 1=true

Outputs

Port Type Description
seconds Float

Current time in seconds

tick Any

Triggers a tick once per frame

TimeOfDay

Changes the speed at which the time of day progresses and reads the current TimeOfDay setting.

Inputs

Port Type Description
Time Float

Time of day in hours

Default value: 0

Valid values: 024

SetTime Any

Trigger to change the time of day to the value specified for the Time parameter

ForceUpdate Boolean

Immediately updates the sky when set to true.

Default value: 0

Valid values: 0=false | 1=true

GetTime Any

Retriggers the CurTime output without updating the value of the output

Speed Float

Sets the speed at which the time of day changes.

Default value: 1

Valid values: 0100

SetSpeed Any

Trigger to change the time of day speed to the value specified for the Speed parameter

GetSpeed Any

Retriggers the CurTime output without updating the value of the output

Outputs

Port Type Description
CurTime float

Current time of day based on when the Set input was last triggered. Use the Get input to retrigger this output and keep the current value for the output

CurSpeed float

Speed for the current time of day based on when the SetSpeed input was last triggered. Use the GetSpeed input to retrigger this output and keep the current value for the output

TimeOfDayLoadDefinitionFile

Loads a Time of Day (TOD) definition file.

Inputs

Port Type Description
Load Any

Trigger to load and read the Time of Day definition file

Filename String

Name of the XML file to load and read. The file must be in the level directory

Outputs

Port Type Description
Success Any

Triggered when the Time of Day definition file has successfully loaded

Fail Any

Triggered if the Time of Day definition file was not successfully loaded

TimeOfDayTransitionTrigger

Triggers sun position transitions when a specific time of day is reached.

Inputs

Port Type Description
Time Float

Total length of time to blend the level's current time to the specified time. Set this value to -1 to disable time of day blending

Default value: 1

Valid values: 024

Duration Float

Blend duration in seconds.

Default value: 0

Valid values: 0100

SunLatitude Float

Blends the level's current sun latitude value to the specified latitude in degrees. Set this value to -1 to disable latitude blending.

Default value: -1

Valid values: 0100

SunLongitude Float

Blends the level's current sun latitude value to the specified latitude in degrees. Set this value to -1 to disable latitude blending

Default value: -1

Valid values: 0100

SunPositionUpdateInterval Float

Amount of time in seconds between updates to reposition the sun. Set this value to 0 seconds to constantly update the sun position during the transition

Default value: 1

Valid values: 0100

ForceUpdateInterval Float

Amount of time in seconds between updates to the time of day. Set this value to 0 seconds to constantly update the time of day during the transition

Default value: 1

Valid values: 0100

Start Any

Starts the transition.

Pause Any

Pauses or resumes the transition

Outputs

Port Type Description
Done Any

Triggered when the transition is finished

TimeOfDayTrigger

Triggers an action when a specific time of day is reached.

Inputs

Port Type Description
Active Boolean

Set this value to true to enable the trigger

Default value: 1

Valid values: 0=false | 1=true

Time Float

Triggers the action at the specified time of day

Default value: 0

Valid values: 0100

Outputs

Port Type Description
Trigger Float

Displays the current value for TimeOfDay. Triggered when the specified time of day has been reached

TimedCounter

Counts the number of ticks. Starting from 0, the counter increments by 1 every time the amount of time specified for the Period input has passed. When the counter reaches the value specified for the Limit input, the Finished output is triggered.

Inputs

Port Type Description
Start Any

Trigger to start the counter. If it is already running, this resets the counter.

Stop Any

Stops the counter

Continue Any

Resumes the counter

Period Float

Tick period in seconds

Default value: 1

Valid values: 0100

Limit Integer

Default value: 0

Valid values: 0100

Outputs

Port Type Description
Finished Any

Trigger indicating the counter is finished. The value that was provided as the Start input is the same as the Finished value.

Count Integer

Value for the tick counter

Timer

Outputs the count from minimum to maximum, ticking for the specified period.

Inputs

Port Type Description
period Float

Tick period in seconds

Default value: 0

Valid values: 0100

min Integer

Minimum value for the timer

Default value: 0

Valid values: 0100

max Integer

Maximum value for the timer

Default value: 0

Valid values: 0100

paused Boolean

Pauses the timer when set to true.

Default value: 0

Valid values: 0=false | 1=true

Outputs

Port Type Description
Out Integer

Total count for the specified period