Reference Verse compiles

heal-agent: Healing Players on a Sunny Cove Island

There's no single "heal agent" device in UEFN — healing an agent means reaching through the agent to its fort_character and calling the real healing API, then wiring that to devices like a trigger and a HUD message. In this article we build a sun-drenched cove healing station: step on the trigger pad by the pirate ship, get patched up, and see a cheerful HUD banner confirm it.

Updated Examples verified on the live UEFN compiler
Watch the Knotagent in ~90 seconds.

Overview

When creators say "heal agent," they're really asking: how do I restore a player's health from Verse? The agent type itself has no methods — it's just a handle to a participant. The healing power lives on the fort_character the agent controls, which implements the healable and healthful interfaces (GetHealth, SetHealth, and heal helpers).

The game problem: a player battles enemies on the shore, gets low, and walks to a healing cove by the pirate ship. You want stepping on a pad to top them off, and a bright HUD banner to say "Patched up!". You solve that by combining three real devices/types:

  • trigger_device — fires TriggeredEvent when a player steps on the pad, handing you the agent.
  • agent / fort_character — unwrap the agent, get its character, read GetHealth() and restore health.
  • hud_message_deviceShow/SetText a cheerful confirmation on that player's screen.

Reach for this whenever you want scripted, conditional healing — heal only on a full circuit lap, only if below a threshold, only for one team, etc. — beyond what a plain Healing Volume device gives you.

API Reference

agent

Full public surface, resolved verbatim from the live Epic digest (Verse.digest.verse). Inherited members are merged from entity.

agent<native><public> := class<unique><epic_internal>(entity):

trigger_device

Used to relay events to other linked devices.

Full public surface, resolved verbatim from the live Epic digest (Fortnite.digest.verse). Inherited members are merged from trigger_base_device.

trigger_device<public> := class<concrete><final>(trigger_base_device):

Events (subscribe a handler to react):

Event Signature Description
TriggeredEvent TriggeredEvent<public>:listenable(?agent) Signaled when an agent triggers this device. Sends the agent that used this device. Returns false if no agent triggered the action (ex: it was triggered through code).

Methods (call these to make the device act):

Method Signature Description
Trigger Trigger<public>(Agent:agent):void Triggers this device with Agent being passed as the agent that triggered the action. Use an agent reference when this device is setup to require one (for instance, you want to trigger the device only with a particular agent.
Trigger Trigger<public>():void Triggers this device, causing it to activate its TriggeredEvent event.
Enable Enable<public>():void Enables this device.
Disable Disable<public>():void Disables this device.
SetMaxTriggerCount SetMaxTriggerCount<public>(MaxCount:int):void Sets the maximum amount of times this device can trigger. * 0 can be used to indicate no limit on trigger count. * MaxCount is clamped between [0,20].
GetMaxTriggerCount GetMaxTriggerCount<public>()<transacts>:int Gets the maximum amount of times this device can trigger. * 0 indicates no limit on trigger count.
GetTriggerCountRemaining GetTriggerCountRemaining<public>()<transacts>:int Returns the number of times that this device can still be triggered before hitting GetMaxTriggerCount. Returns 0 if GetMaxTriggerCount is unlimited.
SetResetDelay SetResetDelay<public>(Time:float):void Sets the time (in seconds) after triggering, before the device can be triggered again (if MaxTrigger count allows).
GetResetDelay GetResetDelay<public>()<transacts>:float Gets the time (in seconds) before the device can be triggered again (if MaxTrigger count allows).
SetTransmitDelay SetTransmitDelay<public>(Time:float):void Sets the time (in seconds) which must pass after triggering, before this device informs other external devices that it has been triggered.
GetTransmitDelay GetTransmitDelay<public>()<transacts>:float Gets the time (in seconds) which must pass after triggering, before this device informs other external devices that it has been triggered.

player

Full public surface, resolved verbatim from the live Epic digest (Verse.digest.verse). Inherited members are merged from agent.

player<native><public> := class<unique><persistent><module_scoped_var_weak_map_key><epic_internal>(agent):

hud_message_device

Used to show custom HUD messages to one or more agents.

Full public surface, resolved verbatim from the live Epic digest (Fortnite.digest.verse).

hud_message_device<public> := class<concrete><final>(creative_device_base):

Events (subscribe a handler to react):

Event Signature Description
ShowMessageEvent ShowMessageEvent<public>:listenable(agent) Called when a Message has been Shown on-screen. Returns an Agent if it was Shown on a specified Agent's screen.
HideMessageEvent HideMessageEvent<public>:listenable(agent) Called when a Message has been Hidden on-screen. Returns an Agent if it was Hidden from a specified Agent's screen.
ClearAllMessagesEvent ClearAllMessagesEvent<public>:listenable(agent) Called when all queued Messages from all players that are affected by this HUD Message Device have been cleared.

Methods (call these to make the device act):

Method Signature Description
Show Show<public>(Agent:agent):void Shows the currently set HUD Message on Agents screen. Will replace any previously active message. Use this when the device is setup to target specific agents.
Show Show<public>():void Shows the currently set Message HUD message on screen. Will replace any previously active message.
Hide Hide<public>():void Hides the HUD message.
Hide Hide<public>(Agent:agent):void Hides the currently set HUD Message on Agents screen. Use this when the device is setup to target specific agents.
Show Show<public>(Agent:agent, Message:message, ?DisplayTime:float Displays a Custom message to a specific Agent that you define.Setting DisplayTime to 0.0 will display the HUD message persistently.If not defined, or less than 0.0 the message will show for the time set on the device.
Show Show<public>(Message:message, ?DisplayTime:float Displays a Custom message that you define for all PlayersSetting DisplayTime to 0.0 will display the HUD message persistently.If not defined, or less than 0.0 the message will show for the time set on the device.
SetDisplayTime SetDisplayTime<public>(Time:float):void Sets the time (in seconds) the HUD message will be displayed. 0.0 will display the HUD message persistently.
GetDisplayTime GetDisplayTime<public>()<transacts>:float Returns the time (in seconds) for which the HUD message will be displayed. 0.0 means the message is displayed persistently.
SetText SetText<public>(Text:message):void Sets the Message to be displayed when the HUD message is activated. Text is clamped to 150 characters.
ClearAllMessages ClearAllMessages<public>():void Clears all queued Messages from all players that are affected by this HUD Message Device.

Walkthrough

Our scene: a cel-shaded cove beside a beached pirate ship. A glowing trigger pad sits on the dock. When a wounded pirate steps on it, we check their health, heal them to full, and flash a golden HUD banner. The trigger only heals people who are actually hurt, and resets after a short cooldown.

using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/SpatialMath }

# A healing station on the cove dock: step the pad, get patched up.
cove_heal_station := class(creative_device):

    # The trigger pad on the dock. Fires TriggeredEvent with the stepping agent.
    @editable
    HealPad : trigger_device = trigger_device{}

    # The HUD banner that confirms the heal.
    @editable
    Banner : hud_message_device = hud_message_device{}

    # How much health a fully-restored pirate has.
    FullHealth : float = 100.0

    # Localized text helper — message params need a localized value, not a raw string.
    HealedText<localizes>(S:string):message = "{S}"

    OnBegin<override>()<suspends>:void =
        # Only let the pad be used a limited number of times before a reset delay.
        HealPad.SetMaxTriggerCount(0)      # 0 = no limit
        HealPad.SetResetDelay(2.0)         # 2s cooldown between heals
        Banner.SetDisplayTime(3.0)         # banner stays up 3 seconds

        # React whenever a player steps on the pad.
        HealPad.TriggeredEvent.Subscribe(OnPadStepped)

    # Event handler — a method at class scope. The event hands us (Agent : ?agent).
    OnPadStepped(Agent : ?agent):void =
        # Unwrap the optional agent.
        if (A := Agent?):
            HealPirate(A)

    HealPirate(A : agent):void =
        # Reach through the agent to the fort_character that actually has health.
        if (Character := A.GetFortCharacter[]):
            CurrentHealth := Character.GetHealth()
            if (CurrentHealth < FullHealth):
                # Restore the pirate to full health.
                Character.SetHealth(FullHealth)
                # Flash a bright banner on THIS player's screen only.
                Banner.Show(A, HealedText("Patched up, sailor! ??"))
            else:
                # Already healthy — tell them so.
                Banner.Show(A, HealedText("You're at full health!"))

Line by line:

  • @editable HealPad : trigger_device and @editable Banner : hud_message_device — these are the fields you drag your placed devices onto in the details panel. A bare trigger_device{} default is just a placeholder until you assign the real device in-editor.
  • HealedText<localizes>(S:string):messagehud_message_device.Show and SetText take a message, not a string. This helper wraps a raw string into a localized message. There is no StringToMessage.
  • In OnBegin, SetMaxTriggerCount(0) lets the pad be used forever; SetResetDelay(2.0) gives a 2-second cooldown; SetDisplayTime(3.0) sets how long the banner lingers.
  • HealPad.TriggeredEvent.Subscribe(OnPadStepped) wires the pad's step event to our handler.
  • TriggeredEvent is listenable(?agent), so the handler receives (Agent : ?agent). We unwrap with if (A := Agent?):.
  • A.GetFortCharacter[] fails (falls through the if) if the agent has no character (e.g. spectating). Only a fort_character exposes GetHealth()/SetHealth().
  • Character.SetHealth(FullHealth) restores the player. Banner.Show(A, ...) targets only that player's screen.

Common patterns

Trigger the pad from code (e.g. from a cinematic cue)

You don't need a player to step on the pad — call Trigger() yourself. Here a countdown "heals" everyone at the start of a round wave by manually firing the pad, which its own TriggeredEvent subscribers react to.

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

auto_pulse_station := class(creative_device):

    @editable
    HealPad : trigger_device = trigger_device{}

    OnBegin<override>()<suspends>:void =
        HealPad.Enable()
        # Every 10 seconds, pulse the pad from code (no agent needed).
        loop:
            Sleep(10.0)
            HealPad.Trigger()   # fires TriggeredEvent with no agent

Read remaining triggers and disable a one-shot medkit pad

A limited-use field medkit: it can heal 3 times, then shuts off. We use SetMaxTriggerCount, GetTriggerCountRemaining, and Disable.

using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }

field_medkit := class(creative_device):

    @editable
    MedkitPad : trigger_device = trigger_device{}

    OnBegin<override>()<suspends>:void =
        MedkitPad.SetMaxTriggerCount(3)   # only 3 uses
        MedkitPad.TriggeredEvent.Subscribe(OnUsed)

    OnUsed(Agent : ?agent):void =
        if (A := Agent?, Character := A.GetFortCharacter[]):
            Character.SetHealth(100.0)
        # When no uses remain, turn the pad off entirely.
        if (MedkitPad.GetTriggerCountRemaining() <= 0):
            MedkitPad.Disable()

Persistent HUD banner + ClearAllMessages

Show a permanent "Healing Cove" sign to everyone with SetDisplayTime(0.0), then wipe it when the event ends via ClearAllMessages.

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

cove_signage := class(creative_device):

    @editable
    Banner : hud_message_device = hud_message_device{}

    SignText<localizes>(S:string):message = "{S}"

    OnBegin<override>()<suspends>:void =
        Banner.SetDisplayTime(0.0)                     # 0 = persistent
        Banner.SetText(SignText("?? Healing Cove — stand here to recover"))
        Banner.Show()                                  # show to everyone
        Banner.ShowMessageEvent.Subscribe(OnShown)
        Sleep(60.0)
        Banner.ClearAllMessages()                      # clear the sign after a minute

    OnShown(Agent : agent):void =
        # Fires each time the banner appears on a player's screen.
        return

Gotchas

  • agent has no GetHealth/SetHealth. Those live on fort_character. Always go A.GetFortCharacter[] first — and it's a failable call ([]), so guard it in an if. A spectating or dead agent may have no character.
  • TriggeredEvent gives ?agent, not agent. You must unwrap: if (A := Agent?):. If the device was triggered from code with Trigger() (no agent), the option is false and your if simply skips — that's expected.
  • Show/SetText need a message, not a string. Use a <localizes> helper. Passing a raw "..." won't compile, and there is no StringToMessage.
  • Show() vs Show(Agent). The no-arg overload shows to everyone; the Show(Agent, ...) overload targets one player's screen. Use the targeted overload when only the healed pirate should see the banner.
  • Health is a float. Verse never auto-converts int↔float. Write 100.0, not 100, for health values.
  • SetMaxTriggerCount is clamped to [0,20], and 0 means unlimited — not zero uses. Don't pass 0 expecting to disable the pad; call Disable() for that.
  • SetResetDelay doesn't block your code — it governs how soon the device can fire again. Rapid re-steps within the delay simply won't re-trigger.

Guides & scripts that use agent

Step-by-step tutorials that put this object to work.

Build your own lesson with agent

Generate a personalized, step-by-step lesson plan built around this object — grounded in this exact reference and our compile-verified knowledge base.

Build a lesson →