API ReferenceGE Extensionsflowgraphnodesui
Set UI Timer / Corner Timer (Flowgraph Node)
- **Node Name:** `Set UI Timer`
Overview
- Node Name:
Set UI Timer - Category:
repeat_instant - File:
extensions/flowgraph/nodes/ui/cornerTimer.lua - Author: BeamNG
Sets the UI timer app to display a specific time value. Supports both the legacy race timer and the generic mission data app.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
value | number | Time in seconds to display. If not connected, clears the timer. |
color | string | Timer color: white, red, green, blue (default: white) |
useGenericMissionDataApp | bool | If true, uses the Generic Mission Data App instead of the race timer |
How It Works
postInit()- Sets up color hard templates (white, red, green, blue).work()- Two code paths:- Generic Mission Data App: Formats time as
MM:SS, sends viaui_apps_genericMissionData.setData(). Clears with{category, clear=true}when no value. - Legacy race timer: Sends
{time, timeColor}viaguihooks.trigger('raceTime', data). Clears withguihooks.trigger('ScenarioResetTimer').
- Generic Mission Data App: Formats time as
Key Dependencies
ui_apps_genericMissionData.setData(data)- the generic mission data display systemguihooks.trigger('raceTime', data)- legacy race timer UI hookguihooks.trigger('ScenarioResetTimer')- clears the legacy race timer
Generic Mission Data Format
{
title = "missions.missions.general.time",
txt = "02:30",
minutes = "02",
seconds = "30",
category = "cornerTimer_virtual",
style = "text",
order = 100
}Example Usage
-- Show 90 seconds on the timer:
-- value=90 → displays "01:30"
-- Clear the timer:
-- Disconnect or nil the value pin
guihooks.trigger('ScenarioResetTimer')See Also
- Medal / Auto Medal (Flowgraph Node) - Related reference
- Clear Messages (Flowgraph Node) - Related reference
- Context Translation (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide