Call as
addon.Platform:GetHealthForecastValueObservation(unit, kind)
Available directly through addon; no dependency is needed.
What it does
Read a lazy health scalar after a separate identity gate. Kind current uses exact UnitHealth(unit); maximum uses exact UnitHealthMax(unit). Probe- and restricted-policy clients accept readable finite nonnegative numbers including zero. No repeated existence/GUID call or alternate tuple fallback is added.
Arguments
| Name | Type | What it does |
|---|---|---|
self | RMPlatform | Rotation Master platform adapter (implicit with colon calls). |
unit | string | Selected nonempty unit token; this call alone does not establish presence. |
kind | string | Closed scalar kind: current or maximum. |
Returns
| 1 | number | nil | Finite nonnegative native health scalar, or nil when unavailable. |
|---|---|---|
| 2 | string | nil | Policy, validation or required observation availability reason. |
Editions
Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.
- Not available on that edition (the reason is in the tooltip)
- Only while Blizzard's deprecation fallbacks are on
| Game API | |||||
|---|---|---|---|---|---|
UnitHealth | |||||
UnitHealthMax | |||||
canaccessvalue |
Secret values (Retail and Forever)
On Retail and Forever the game hands addons secret values. This helper checks what it reads (addon.Platform:CanReadValue) and returns nil with a reason such as restricted-value instead of a secret it cannot compare. Treat nil as unavailable, not as false.
Example
local current = addon.Platform:GetHealthForecastValueObservation("target", "current")
local maximum = addon.Platform:GetHealthForecastValueObservation("target", "maximum")
if not current or not maximum or maximum == 0 then return nil end
return current / maximum <= 0.35Dependencies
finite→Platform.health_forecast.finite
Source
Platform/health_forecast.lua, line 81. Read only in game; Duplicate makes an editable copy.
Platform.health_forecast.GetHealthForecastValueObservation(self, unit, kind)
local policy=self:GetCombatDataPolicy()
if policy~='probe' and policy~='restricted' then return nil,'unsupported-policy' end
if not self:CanReadValue(unit) or not self:CanReadValue(kind) then return nil,'restricted-value' end
if type(unit)~='string' or unit=='' then return nil,'invalid-unit' end
local api
if kind=='current' then api=UnitHealth
elseif kind=='maximum' then api=UnitHealthMax
else return nil,'invalid-health-forecast-query' end
if type(api)~='function' then return nil,'missing-api' end
local ok,value=pcall(api,unit)
if not ok then return nil,'api-error' end
if not self:CanReadValue(value) then return nil,'restricted-value' end
if canaccessvalue and not canaccessvalue(value) then return nil,'restricted-value' end
if value==nil then return nil,'health-data-unavailable' end
if not finite(value) or value<0 then return nil,'invalid-api-result' end
return value




