Repository navigation
Scripting Timer
-
TickQuantum- Contains length of a single game tick in seconds. Equivalent to the engine'sCTimer::TickQuantumconstant.
Class for holding timer values measured in CPU cycles.
Constructs a timer value instance with the specified value in seconds. If left unspecified, defaults to 0 CPU cycles.
Arguments:
-
seconds(optional) - Amount of seconds to set to the timer value.
Adds two timer values together.
Right-side operand: Timer.Value
Return value: Timer.Value
Subtracts another timer value from the first one.
Right-side operand: Timer.Value
Return value: Timer.Value
Creates a copy of the timer value instance.
Return value: Timer.Value
Returns timer value in seconds formatted as
%gs.
Return value: string
Read-only variable of the current timer value in milliseconds. Equivalent to the engine's
CTimerValue::GetMilliseconds()function.
| Type | Readable | Writeable |
|---|---|---|
integer |
Yes | No |
Read-only variable of the current timer value in seconds. Equivalent to the engine's
CTimerValue::GetSeconds()function.
| Type | Readable | Writeable |
|---|---|---|
float |
Yes | No |
Consistent across the entire game. Equivalent to the engine's
CTimer::GetRealTimeTick()function.
Return value: float with the current game time in seconds since the beginning.
Returns current game tick in seconds depending on context where it's called from, e.g. game menu processing, NETRICSA processing or world simulation processing. Affected by the speed of the current world. Equivalent to the engine's
CTimer::CurrentTick()function.
Tip
If you need consistent current tick time of the world simulation regardless of context, use World.GetCurrentTick() instead.
Return value: float with the current game tick in seconds.
Returns current frame time in seconds depending on context where it's called from, e.g. game menu rendering, NETRICSA rendering or world rendering. Affected by the speed of the current world. Equivalent to the engine's
CTimer::GetLerpedCurrentTick()function.
The returned value is always betweenTimer.CurrentTick()andTimer.CurrentTick() + TickQuantumdepending on the current value reported byTimer.GetLerpFactor.
Tip
If you need consistent current frame time of the world simulation regardless of context, use World.GetLerpedCurrentTick() instead.
Return value: float with the current frame time in seconds.
Returns lerp factor of the current frame between two game ticks. Equivalent to the engine's
CTimer::GetLerpFactor()function.
Return value: float
Returns secondary lerp factor of the current frame between two game ticks. Equivalent to the engine's
CTimer::GetLerpFactor2()function.
Return value: float
Returns current CPU time. Consistent across all running instances of the game on the same computer. Equivalent to the engine's
CTimer::GetHighPrecisionTimer()function.
Return value: Timer.Value
Designed and developed by Dreamy Cecil since 2022