API ReferenceGE Extensionsflowgraphnodesui
Medal / Auto Medal (Flowgraph Node)
- **Node Name:** `Medal`
Overview
- Node Name:
Medal - Category:
repeat_instant - File:
extensions/flowgraph/nodes/ui/autoMedal.lua
Automatically determines a medal tier (wood/bronze/silver/gold/platinum) based on a numeric score and configurable thresholds.
Pin Schema
Input Pins
| Pin | Type | Default | Description |
|---|---|---|---|
points | number | - | The player's score |
bronze | number | 50 | Threshold for bronze medal |
silver | number | 85 | Threshold for silver medal |
gold | number | 100 | Threshold for gold medal |
platinium | number | 125 | Threshold for platinum medal |
ascending | bool | true | (Hidden) If true, higher points = better medal |
woodText | string | - | Text for wood (no medal) tier |
bronzeText | string | - | Text for bronze tier |
silverText | string | - | Text for silver tier |
goldText | string | - | Text for gold tier |
Output Pins
| Pin | Type | Description |
|---|---|---|
medal | string | Medal name: "wood", "bronze", "silver", "gold", or "platinium" |
bronze | bool | (Hidden) True if at least bronze |
silver | bool | (Hidden) True if at least silver |
gold | bool | (Hidden) True if at least gold |
platinium | bool | (Hidden) True if at least platinum |
text | string | The text attached to the achieved medal tier |
nextScore | number | Score needed for the next medal tier |
nextMedal | string | Name of the next medal tier |
passed | bool | True if bronze or better |
completed | bool | True if platinum achieved |
failed | bool | True if no medal (wood) |
How It Works
work()- Iterates through medal tiers in order (bronze → silver → gold → platinum).- For each tier, compares
pointsagainst the threshold using>=(ascending) or<=(descending). - The highest passing tier becomes the output medal. Falls back to
"wood"if none pass. - Sets
passed,completed, andfailedflags based on the result. - Calculates
nextScoreandnextMedalfor progress feedback.
Notes
- The spelling
"platinium"(with extra 'i') is used throughout - match this in your code. ascending = true(default) means higher scores are better.- Medal text pins allow attaching custom messages per tier for UI display.
Example Usage
-- Points: 90, Thresholds: bronze=50, silver=85, gold=100, platinium=125
-- Result: medal="silver", passed=true, completed=false, failed=false
-- nextMedal="gold", nextScore=100See Also
- Clear Messages (Flowgraph Node) - Related reference
- Context Translation (Flowgraph Node) - Related reference
- ConvertUnit (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide