API ReferenceGE Extensionsflowgraphnodesui
End Stats (Flowgraph Node)
- **Node Name:** `End Stats`
Overview
- Node Name:
End Stats - Category:
repeat_instant - File:
extensions/flowgraph/nodes/ui/endStats.lua
Gathers end-of-scenario statistics for use with the End Screen node. Provides a configurable number of stat entries, each with label, points, and max points.
Pin Schema
Input Pins
| Pin | Type | Table Type | Description |
|---|---|---|---|
statData | table | endStats | Existing stat data to append to (hidden) |
Dynamic Input Pins (per stat)
For each stat index i (1 to count):
| Pin | Type | Description |
|---|---|---|
label_i | string/table | Label or translation object for stat i |
points_i | number | Points earned for stat i |
maxPoints_i | number | Maximum points for stat i |
Output Pins
| Pin | Type | Table Type | Description |
|---|---|---|---|
statData | table | endStats | Assembled stat data array |
Internals
Key Methods
| Method | Description |
|---|---|
work() | Iterates stats 1..count, builds each {label, points, maxPoints, relativePoints}, appends to output |
drawCustomProperties() | Editor UI with count input to add/remove stat slots |
updatePins(old, new) | Creates or removes dynamic pins when stat count changes |
_onSerialize(res) | Saves count |
_onDeserialized(res) | Restores count and rebuilds pins |
Computed Fields
Each stat entry also gets relativePoints = points * 100 / maxPoints when both values are present.
How It Works
- In the editor, set the Count to determine how many stat entries are available.
- Each stat creates 3 input pins:
label_N,points_N,maxPoints_N. - On each frame,
work()collects all stat values into an array. - If an existing
statDatatable is connected to the input, new stats are appended to it (allows chaining multiple End Stats nodes). - The output
statDatais connected to the End Screen node'sstatsinput.
Usage Example
-- With count = 2, the node creates pins:
-- label_1, points_1, maxPoints_1
-- label_2, points_2, maxPoints_2
--
-- Output table looks like:
{
{ label = "Accuracy", points = 85, maxPoints = 100, relativePoints = 85 },
{ label = "Time", points = 50, maxPoints = 60, relativePoints = 83.33 },
}Key Dependencies
- Used as input provider for the End Screen node (
endStatstable type)
See Also
- Medal / Auto Medal (Flowgraph Node) - Related reference
- Clear Messages (Flowgraph Node) - Related reference
- Context Translation (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide