Update Timers node for tutorial#1185
Open
davidmarr wants to merge 23 commits intoTombEngine:developfrom
Open
Conversation
Adjust timer node numerical argument metadata (change numeric field from 1 to 2 and increase upper bound to 65535 in relevant nodes) to allow larger/updated value ranges. Remove ticking checks so GetRemainingTime and GetTotalTime always log when the timer exists. Simplify debug logging in IfRemainingTimeIs by removing operator-specific tick gating and normalize float formatting for log output.
Updated timer argument descriptions to clarify that durations can be rounded to the nearest game frame (1/30 of a second).
Update numeric argument metadata in Timers.lua to allow timer durations up to 65535 seconds (previously 1000). The change updates the argument range for the simple countdown, LevelFuncs callback, volume event, and global event timer nodes in TombLib/TombLib/Catalogs/TEN Node Catalogs/Timers.lua to reflect the expanded maximum duration.
Update the argument metadata in Timers.lua for Timer node conditions: change the Numerical argument upper bound from 1000 to 65535 for both "Remaining time" and "Total Time" (in seconds). This is a comment/metadata change only; no runtime logic was modified. Values are still rounded internally to the nearest game frame (1/30s).
Update timer argument metadata in TombLib/TombLib/Catalogs/TEN Node Catalogs/Timers.lua to allow durations up to 86400 seconds (24 hours) instead of 65535. The numerical range for various timer-related nodes and checks (simple countdown, LevelFuncs callback, volume/global event timers, SetRemainingTime, SetTotalTime, IfRemainingTimeIs, IfTotalTimeIs) was adjusted in the annotation/comments so the editor/UI will accept longer timer values. No runtime logic was changed; only the argument metadata was updated.
Replace incorrect "Deciseconds" label with "Centiseconds" in TEN Node Catalogs/Timers.lua (four occurrences). This clarifies the timer argument unit and normalizes comment syntax for consistency.
Add a missing newline at the end of TombLib/TombLib/Catalogs/TEN Node Catalogs/Timers.lua. This is a non-functional change to satisfy POSIX/editor expectations and avoid spurious diff warnings.
Adjust timer argument documentation in TEN Node Catalogs/Timers.lua to use 0.03 (≈1/30s) as the finer timer increment instead of 0.1. The Numerical argument allowed values were updated for several Timer nodes (simple countdown, LevelFuncs callback, volume event, global event, IfRemainingTimeIs, IfTotalTimeIs) to reflect rounding to the nearest game frame (1/30 of a second). These are comment/meta changes describing argument precision; no runtime logic was modified.
Ensure LevelVars.nodeTimers[name] is initialized before reading .debug in multiple timer functions (StartTimer, StopTimer, SetPausedTimer, SetRemainingTime, SetTotalTime, SetLooping, IfRemainingTimeIs, IfTotalTimeIs) to avoid nil indexing errors and enable per-timer debug logging. Also simplify SetTimerColor and SetTimerPauseColor by setting the alpha on the provided color table (color.a = 255 * tColor / paused) and passing it directly to SetUnpausedColor/SetPausedColor instead of constructing a new TEN.Color.
Refactor timer handling in TEN Node Timers: introduce a local SetTimer function (replacing in-file LevelFuncs.Engine.Node.SetTimer usage) and add a CreateStruct helper to centralize/ensure LevelVars.nodeTimers[name] initialization. Replace many repetitive nil-checks with CreateStruct calls. Also update several node argument comment ranges for timer durations/precision (e.g. max reduced from 86400 to 1000 and rounding/precision values adjusted). Minor comment formatting tweaks included.
Replace the fully-qualified LevelFuncs.Engine.Node.SetTimer call with a direct SetTimer invocation in CreateTimerWithGEventSet. This aligns the call with the intended local/global SetTimer function and ensures consistent resolution without changing timer creation logic.
…arr/Tomb-Editor into Update-timer-node-02-2026
Persist timer alignment and effects in LevelVars.nodeTimers and refactor SetTimerPosition to accept explicit setX/setY flags and simplify value computation. Add new node functions: SetTimerAlignment, SetTimerEffects and SetDebugMessages to modify timer text options and toggle per-timer debug logging. Implement conditional check nodes IfPositionIs and IfScaleIs (with debug logging for position checks) and update argument metadata/comments for the affected timer nodes. Overall improves runtime configurability and debugging for timers.
Reorder parameters for CreateTimer, CreateTimerWithEventSet and CreateTimerWithGEventSet so color/position/alignment/effects/scale come before the debug flag (debug moved to the end). Update the !Arguments annotations: expand Position X/Y ranges to [-1000..1000] with a visible range note, move alignment/effects enumeration entries, and adjust the scale argument metadata/precision. These changes keep the annotation order consistent with the new function signatures.
Rename the parameter named 'debug' to 'show_debug' across timer functions (SetTimer, CreateTimer, CreateTimerWithFunction, CreateTimerWithEventSet, CreateTimerWithGEventSet, and SetDebugMessages) and update their SetTimer calls and assignments to LevelVars.nodeTimers. This is a naming/clarity change only; behavior and stored debug flag remain the same.
This reverts commit 245c951.
Update TEN Node Timers.lua argument annotations and adjust CreateTimerWithFunction signature to match. Position X/Y ranges expanded to -1000..1000 with a visible range note of 0..100; alignment, effects, scale and debug argument declarations reordered. Function parameter order changed accordingly (color/pColor and x/y moved earlier; alignment/effects/scale and debug moved) — callers must be updated to the new parameter order.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request significantly enhances the flexibility and control of timer nodes in the
Timers.luacatalog. The main improvements include expanded argument ranges for timer positioning, new nodes for modifying and querying timer properties (alignment, effects, debug messages, position, and scale), and updates to function signatures to support these changes.Timer Node Argument and Function Signature Updates:
CreateTimer,CreateTimerWithEventSet,CreateTimerWithGEventSet) to match the new argument structure and improve usability. [1] [2] [3]New and Enhanced Timer Property Modification Nodes:
SetTimerAlignment), effects (SetTimerEffects), and debug message settings (SetDebugMessages). These nodes provide runtime control over timer display and debugging.SetTimerPosition) to allow independent X and Y updates using boolean flags, improving flexibility for partial updates.Timer Property Query Nodes:
IfPositionIs) or scale (IfScaleIs) matches specified criteria, enabling advanced logic in event scripts.Internal Data Structure Improvements:
LevelVars.nodeTimersstructure to always storealignmentandeffectsproperties for each timer, ensuring consistent access and modification.These changes collectively make timer nodes much more powerful and configurable, supporting a wider range of gameplay and UI scenarios.
References:
[1] [2] [3] [4] [5] [6] [7]
Nodes with modifications are backwards compatible:


Before:
After the update:

