hud.setVanillaBar 2
Shows or hides only the vanilla half of the bar: faction flags, tickets, capture squares and objectives. Fields added by the script stay visible.Useful for non-linear or scripted missions where the standard capture progress means nothing, but you still want a bar of your own.
Return value
| Return Type | Description |
|---|---|
| void | This function doesn't return anything |
Parameters
| Parameter | Type | Description |
|---|---|---|
| 1 | bool | True to show the vanilla part of the bar, false to hide it. |
Examples
Custom conquer bar
-- Replace the vanilla conquer bar with two fields of our own.
-- Runs on every client: no network sync needed.
hud.setVanillaBar(false) -- hide flags, tickets and capture squares
hud.setPhases(false) -- this mission does not advance through phases
local wave = 1
local left = 12
local function refresh()
hud.setField("wave", "hud_icon_wave", "Wave " .. wave)
hud.setField("enemies", "hud_icon_enemy", tostring(left))
-- keep the counter from making the bar jump as digits change
hud.setFieldWidth("enemies", 60)
-- turn the counter red when the position is about to fall
if left <= 3 then
hud.setFieldColor("enemies", 1, 0.35, 0.35)
else
hud.setFieldColor("enemies", 1, 1, 1)
end
end
refresh()