Skip to content

Add a status

A status is one icon of the status column, such as hunger, pain or panic. It has four tiers, each with a label, a tooltip, a colour, stat modifiers and a health cost. The icon appears at the first tier, and the tiers reach the owning player only.

Steps

  1. Declare its tag under Status. in Edit > Project Settings > Gameplay Tags.
  2. In Content/ZombieSurvival/DataAssets/Status/Childs/, duplicate a DA_Status_* (class PDA_StatusDef) and fill its fields (tables below).
  3. Add it to Statuses in DA_StatusSet_Default, in the same folder, at the place you want it in the column. The set lists the statuses in display order, and the column builds a row for yours.
  4. Give it a source (below). This is the one step with a graph.
Field What it does
StatusTag Its tag, under Status..
DisplayName The status name.
Icon The 32 × 32 icon of its row in the column. The shipped ones are Textures/UI/T_Icon_*.
bHigherIsWorse Ticked: a tier is reached when the value is at or above its threshold, as for pain, panic and load. Unticked: when it falls below it, as for hunger, thirst, fatigue, exertion and hypothermia.
Tiers Four tiers, from the mildest to the worst (table below).

Each tier holds:

Tier field What it does
Threshold The value that reaches the tier.
Label The tier name at the top of the tooltip.
Tooltip The sentence under it.
Color The background of the icon.
Modifiers Stat modifiers, as for a trait: a stat tag, add or multiply, a value.
HealthPerMinute Health lost per game minute at that tier.

On the shipped statuses the first tier only warns. Give yours a label and a tooltip, and no modifier. Panic is the one exception: its first tier already slows reloading.

Give it a source

The value comes from a component of the survivor that implements Blueprints/Interfaces/BPI_StatusSource. Its GetStatusValue(StatusTag) answers with bProvided ticked and the value when the tag is yours, and with bProvided unticked for any other tag. An existing source can provide one more tag with one more branch in its GetStatusValue.

Once a second, on the host, AC_Status asks every component of the survivor that implements the interface, and keeps the first that provides the tag.

A medicine can act on the status. A row of PDA_MedicineDef.Effects with your tag as TargetTag, an Amount and a DurationMinutes moves the value before the tier is read.

A set of your own

AC_Status on the survivor and WBP_HUD both read the set. If you make a set of your own, point AC_Status.Settings and WBP_HUD.StatusSet at it, and the Status component of BP_Survivor too, which keeps its own copy.

Test it

  1. Open Content/ZombieSurvival/Maps/L_World and press Play.
  2. Do what raises your source's value past the first threshold.
  3. The icon appears in the status column with the tier's colour. Hover it: the tooltip shows the tier's label and sentence.
  4. Push it further and check that the higher tiers change the stats and the health as set.

If it does not work

  • The icon never shows: the status has no source, and stays at tier 0.
  • No icon and no effect: the status is missing from DA_StatusSet_Default. A status that is not in the set is never read.