Skip to main content
Flow Core Documentation
Menu

Flow Stats

Run Turn-Based Status Effects

Advance a Manual Status Effect only when gameplay resolves a turn.

Audience
Gameplay designers and developers
Time
20 minutes
Requires
A FlowStats owner and a turn-resolution action
Modules
Flow Stats
On this page

Goal

Use Manual time when an Effect should advance through simulated turns instead of Unity frames. Create a three-turn regeneration Effect and advance it by one simulated second per turn.

Prerequisites

  • Import the Flow Core examples.
  • Have a turn-resolution action that can run a Flow Instruction or call a runtime method.
  • Use a project-owned tutorial folder for the temporary scene and Effect asset.

The supplied 7. Stats scene contains a Scaled Regeneration Effect and no Manual-tick control. Use a duplicated scene and a new tutorial Effect asset for this walkthrough.

What You Will Build

Starting Health after Damage 10: 50 / 100
Turn 1: 51 / 100
Turn 2: 52 / 100
Turn 3: 53 / 100, Effect expires

Steps

1. Create the Manual Effect

  1. Save a copy of 7. Stats in a project-owned tutorial folder.
  2. Create Flow Core > Stats > Status Effect and name it Turn Regeneration.
  3. In Main, configure these fields:
FieldValue
Duration ModeTimed
Duration3
Time ModeManual
ModeAggregate
Maximum Stacks1
Tick PhaseAfter Interval
PersistOn

Keep the generated Stable ID unique. Do not duplicate another Effect and leave both assets with the same Stable ID. Persist makes the active Effect eligible for Snapshot capture; it does not change Manual ticking.

Turn Regeneration configured with Manual time, a three-second duration, and one aggregate stack.

2. Add one periodic operation

Open Contributions and add one entry under Periodic Operations:

FieldValue
Target ResourceHealth
OperationAdd
Value1
Interval Seconds1
Contribution ModePer Stack

With one active stack, each completed one-second interval restores exactly one Health. After Interval prevents an immediate heal when the Effect is applied.

3. Apply the tutorial Effect

  1. Select Standalone Stats Demo in the duplicated scene.
  2. On FlowStatsExampleController, replace its Regeneration reference with Turn Regeneration.
  3. Confirm the assigned Profile uses Effect Filter Mode: None. For a Whitelist, add the Effect under Allowed Effects; for a Blacklist, keep it out of Blocked Effects.
  4. Enter Play Mode, select Damage 10 once, then select Regeneration +1 once.

Health now reads 50 / 100, and one Manual Effect is active. Waiting in real time does not advance its native duration or periodic interval.

4. Advance one turn

At the point where one actor finishes a turn, use Stats Tick Manual Effects:

FieldValue
StatsThe actor with Flow Stats
Step1

The equivalent runtime call is:

actorStats.TickManualEffects(1f);

Invoke the tick once per resolved turn. Use Stats Tick All Manual Effects only when every active, enabled, and initialized Stats owner shares the same global turn boundary.

The Manual Effect after one explicit tick, with Health increased from 50 to 51 and its remaining duration reduced.

Verify the Result

  1. Wait for several real-time seconds and confirm Health remains 50.
  2. Resolve one Manual step and confirm Health becomes 51.
  3. Resolve a second step and confirm Health becomes 52.
  4. Resolve a third step and confirm Health becomes 53 and the Effect exits.

Common Mistakes

SymptomCheck
The Effect advances every frameConfirm Time Mode is Manual, not Scaled or Unscaled.
Applying the Effect heals immediatelyUse Tick Phase: After Interval; On Apply intentionally performs the first periodic operation immediately.
A turn produces no changeStep must resolve to a finite value greater than zero, and the Effect must already be active.
More than one Health is restoredConfirm one active stack and Value: 1; Per Stack scales by the active stack count.
A copied Effect behaves like the originalGive every Status Effect a unique Stable ID and apply the intended asset.
Other waits still advanceManual controls native Effect timing only; Flow waits, coroutines, and ordinary Update logic keep their own clocks.

What You Built

You authored an Effect whose duration, periodic work, continuous work, and expiry advance only through explicit simulated-time steps.