-
Notifications
You must be signed in to change notification settings - Fork 0
Player Gauges (UI)
Pheonix KageDesu edited this page Aug 15, 2025
·
1 revision
- Where to add gauges in Plugin Parameters
- How to add a new gauge (HP/MP/EXP or custom)
- What each UGauge field means
- How the NUI style JSON works and binds to gauge values
- Quick examples and tips
Plugin Manager path:
- Player and Party settings → UI Elements Settings → Gauges → Gauges List (
uiGaugesof typestruct<UGauge>[])
Each entry in Gauges List is a UGauge (one on‑screen gauge).
- Open Gauges List → Add.
- Set “Style” to the NUI gauge style filename (from
data/AABSZ/gauges/without “.json”), e.g.player_hp. - Set scripts:
- maxValueScript: JavaScript returning max value (e.g.
$gameParty.leader().mhp) - currentValueScript: JavaScript returning current value (e.g.
$gameParty.leader().hp)
- maxValueScript: JavaScript returning max value (e.g.
- Position:
- positionX: e.g.
center - 54hdp - positionY: e.g.
bottom - 44hdp
- positionX: e.g.
- Refresh:
- autoRefreshSeconds: e.g.
0.2(0 = disabled) - autoRefreshOnVariable: a Game Variable ID to trigger refresh on change (0 = none)
- autoRefreshSeconds: e.g.
- Optional:
- visibilitySwitch: switch ID that hides/shows the gauge (0 = none)
- opacityWhileMessage: 0–255 opacity while a message window is shown
Save and test.
- visibilitySwitch:int
- Switch ID to toggle visibility (0 = ignore)
- opacityWhileMessage:int
- Opacity (0–255) during message display
- style:string
- The base filename of a NUI style JSON in
data/AABSZ/gauges(e.g.player_hp)
- The base filename of a NUI style JSON in
- maxValueScript:string
- JS expression for the max (e.g.
$gameParty.leader().mmp)
- JS expression for the max (e.g.
- currentValueScript:string
- JS expression for the current (e.g.
$gameParty.leader().mp)
- JS expression for the current (e.g.
- autoRefreshSeconds:number
- Recompute scripts every N seconds (supports decimals, 0 = off)
- autoRefreshOnVariable:int
- Game Variable ID; recompute on change (0 = off)
- positionX:string
- X position expression (e.g.
center,120hdp,center + 40hdp)
- X position expression (e.g.
- positionY:string
- Y position expression (e.g.
bottom - 44hdp,2hdp)
- Y position expression (e.g.
Notes:
- Use
$gameParty.leader().hp,.mhp,.mp,.mmp,.nexp(next level),.cexp(current level progress), etc. - You can also use
$gameVariables.value(3)to bind to a variable.
- Location:
data/AABSZ/gauges/*.json - Example style:
player_hp.json(already included) - Important bindings used by gauges:
-
x:$positionX(provided by UGauge.positionX) -
y:$positionY(provided by UGauge.positionY) -
rate:$rate01(fill rate; assumed 0..1 based on current/max) - Text often uses
$currentValue,$maxValue,$rate(assumed percent)
-
Example (from player_hp.json):
"bindings": {
"x": "$positionX",
"y": "$positionY",
"rate": "$rate01"
}And text:
"text": ["%1", "$currentValue", "$maxValue", "$rate"]Assumptions:
-
$rate01is computed as current/max (0..1),$rateis a percent. The plugin exposes$currentValue,$maxValueto styles.
UGauge entry fields:
- style:
player_hp - maxValueScript:
$gameParty.leader().mhp - currentValueScript:
$gameParty.leader().hp - autoRefreshSeconds:
0.2 - positionX:
center - 54hdp - positionY:
bottom - 44hdp
- style:
player_mp - maxValueScript:
$gameParty.leader().mmp - currentValueScript:
$gameParty.leader().mp - autoRefreshSeconds:
0.2 - positionX:
center + 108hdp - positionY:
bottom - 44hdp
- style:
player_exp - maxValueScript:
$gameParty.leader().nexp - currentValueScript:
$gameParty.leader().cexp - autoRefreshSeconds:
0.2 - positionX:
center - positionY:
bottom - 60hdp
- style:
player_tp - maxValueScript:
$gameParty.leader().mtp - currentValueScript:
$gameParty.leader().tp - autoRefreshSeconds:
0.2 - positionX:
center - positionY:
bottom - 60hdp
Track a Game Variable (ID 3) up to 100:
- style:
player_hp(or your own custom style) - maxValueScript:
100 - currentValueScript:
$gameVariables.value(3) - autoRefreshOnVariable:
3 - autoRefreshSeconds:
0(optional) - positionX:
20hdp - positionY:
20hdp
- Absolute:
100or100hdp - Anchors:
left,center,right,top,bottom - Combine:
center + 40hdp,bottom - 60hdp
- Gauge not moving: check
currentValueScriptandmaxValueScriptboth return numbers, and that refresh is enabled (timer or variable). - Not visible: ensure
visibilitySwitchis 0 or ON; confirm style filename matches a file indata/AABSZ/gauges. - Text shows raw placeholders: your style must bind text to
$currentValue,$maxValue,$rate(as inplayer_hp.json).