API ReferenceGE Extensionsflowgraphnodesui
Monologue (Flowgraph Node)
- **Node Name:** `Monologue`
Overview
- Node Name:
Monologue - Category:
once_f_duration - File:
extensions/flowgraph/nodes/ui/monologue.lua
Shows a sequence of messages one after another using the ui_message toast system. Each message has its own duration. The node has a duration behaviour - it starts, plays through all messages, then finishes.
Pin Schema
Input Pins
| Pin | Type | Default | Description |
|---|---|---|---|
category | string | "flowgraph" | Message category for the toast system |
icon | string | "error" | Icon for the messages |
message_1 | any | - | Message 1 to display |
duration_1 | number | 5 | Duration for message 1 |
| (dynamic) | any / number | - | Additional message/duration pairs added via count |
Dynamic Pins
The node supports a configurable count. For each index i, two pins are created:
message_<i>(any) - the message textduration_<i>(number, default 5) - duration in seconds
Internals
| Field | Purpose |
|---|---|
self.count | Number of message slots |
self.time | Elapsed time since start |
self.endTime | Total duration of all messages combined |
self.current | Index of the currently displayed message |
How It Works
workOnce()- Resetstimeto 0 and sets duration state to'started'.work()- Called each frame:- On first call, computes
endTimeby summing all durations. - If
time >= endTime, sets duration state to'finished'. - Otherwise, advances
timebydtSimand iterates through messages:- Accumulates elapsed time per message.
- When the current time falls within a message's window and it hasn't been shown yet, calls
ui_message()with the message text, duration, category, and icon.
- On first call, computes
drawCustomProperties()- Editor UI with an integer input to change the message count.updatePins(old, new)- Adds or removesmessage_<i>/duration_<i>pin pairs.
Serialization
_onSerialize()- Savesmodeandcount._onDeserialized()- Restores count and rebuilds pins viaupdatePins(1, count).
Lua Code Example
-- What the node does internally for each message:
ui_message("Watch out for the turn!", 5, "flowgraph", "error")
-- After 5 seconds, the next message appears:
ui_message("Great job!", 3, "flowgraph", "error")Key Dependencies
ui_message()- BeamNG toast message function- Duration behaviour mixin - provides
setDurationState()for started/finished lifecycle
See Also
- Medal / Auto Medal (Flowgraph Node) - Related reference
- Clear Messages (Flowgraph Node) - Related reference
- Context Translation (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide