Zum Hauptinhalt springen

First Survival Setup

Minimal Health and Food Test​

  1. Add SurvHealthComponent and SurvFoodComponent, or the supplied Blueprint children, to a Pawn/Character.
  2. On the authority branch of the Pawn's startup logic, call SetComponentActive on each component. Native BeginPlay
    and InitializeComponent only call Super; they do not call this activation routine.
  3. Use Get Game Instance Subsystem to obtain SurvivalSubSystem. GetHealthComponent and GetFoodComponent resolve the
    corresponding native component on the supplied Pawn.
  4. Query GetHealth, GetArmor, GetFoodValue and GetWaterValue using their interfaces. With default settings after
    activation, values start at 100.
  5. On the server, Apply Damage to the Pawn to test armor absorption. AddHealth/AddArmor and AddFood/AddWater are
    interface calls for replenishment.
  6. Read the values again and bind UI change delegates with an initial snapshot.

Activation loads settings, sets state defaults and binds update delegates. Calling it repeatedly resets values;
do not use it as a routine HUD refresh. Deactivation also calls SetData and resets state/values, rather than only pausing simulation.


Verify Automatic Updates Separately​

Check the SurvivalSubSystem log for timer initialization. Default server-only timer logic accepts ListenServer
and DedicatedServer but excludes Standalone. The current world-ready/external-pulse paths also have
initialization gaps. See Timer Setup before expecting food drain or regeneration.

For an initial numeric/API test, automatic timers are not necessary: authoritative replenishment and damage calls
can be verified independently. For a complete simulation, confirm that pulses fire in your actual PIE/packaged mode.

Debug and Testing lists the required checks.