Reference Unreal Engine compiles

value_setter_device: Flip a Setting Mid-Game

The Value Setter device is your runtime remote control for other Patchwork devices — it can flip a setting on a linked device the moment something happens in your island. Imagine a sun-drenched cove where a treasure chest trigger arms a cannon, or a clifftop where stepping on a pressure plate disables a rival's trap. This article shows you exactly how to wire a Value Setter to a trigger and a HUD message so players feel every toggle.

Updated Examples verified on the live UEFN compiler

Overview

The Value Setter device (value_setter_device) belongs to the Patchwork family of devices. Its single job is to modify a setting on another linked Patchwork device when it is itself triggered — think of it as a one-shot (or repeatable) configuration patch that fires at runtime.

When should you reach for it?

  • You want to enable or disable another device dynamically (a trap, a spawner, a barrier) based on player actions.
  • You need to chain device state changes without writing a full Verse script — but you can also drive it from Verse for precise control.
  • You want a clean separation between "what changes" (the Value Setter) and "when it changes" (a trigger, a button, or Verse code).

In Verse you interact with value_setter_device through two methods: Enable and Disable. These turn the Value Setter itself on or off, controlling whether it will apply its payload when triggered in-editor. Combine them with trigger_device events and hud_message_device calls to build reactive island moments.

API Reference

value

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

value<native><public> := class:

value_setter_device

Modify a setting on another Patchwork device when triggered.

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

value_setter_device<public> := class<concrete><final>(patchwork_device):

Methods (call these to make the device act):

Method Signature Description
Enable Enable<public>():void Enables this device.
Disable Disable<public>():void Disables this device.

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.

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

Scenario — The Sunlit Cove Cannon Arm: On a bright, cel-shaded pirate cove island, two pressure-plate triggers sit on the dock. When a player steps on the first trigger (the arming plate), a Value Setter enables a cannon trap device, and a HUD message tells the player "Cannon Armed!". When a player steps on the second trigger (the disarm plate), the Value Setter is disabled so it can no longer arm the cannon, and the HUD shows "Cannon Disarmed!".

This example uses:

  • trigger_device.TriggeredEvent — to detect a player stepping on each plate
  • value_setter_device.Enable / Disable — to arm/disarm the setter
  • hud_message_device.Show(Agent, Message) — to give per-player feedback
  • hud_message_device.SetDisplayTime — to control how long the message lingers
using { /Fortnite.com/Devices }
using { /Fortnite.com/Devices/Patchwork }
using { /Verse.org/Simulation }
using { /Verse.org/Native }

# Localised message helpers
ArmedText<localizes>(S : string) : message = "{S}"
DisarmedText<localizes>(S : string) : message = "{S}"

cove_cannon_manager := class(creative_device):

    # The trigger players step on to ARM the cannon
    @editable ArmTrigger : trigger_device = trigger_device{}

    # The trigger players step on to DISARM the cannon
    @editable DisarmTrigger : trigger_device = trigger_device{}

    # The Value Setter that patches the cannon trap device
    @editable CannonValueSetter : value_setter_device = value_setter_device{}

    # HUD message device for player feedback
    @editable StatusHUD : hud_message_device = hud_message_device{}

    OnBegin<override>()<suspends> : void =
        # Configure HUD display time once at startup
        StatusHUD.SetDisplayTime(3.0)

        # Start with the cannon disarmed — disable the setter
        CannonValueSetter.Disable()

        # Wire up both triggers
        ArmTrigger.TriggeredEvent.Subscribe(OnArmTriggered)
        DisarmTrigger.TriggeredEvent.Subscribe(OnDisarmTriggered)

    # Called when a player steps on the arming plate
    OnArmTriggered(MaybeAgent : ?agent) : void =
        if (A := MaybeAgent?):
            # Enable the Value Setter so it can patch the cannon
            CannonValueSetter.Enable()
            # Show a per-player HUD message
            StatusHUD.Show(A, ArmedText("⚓ Cannon Armed!"))

    # Called when a player steps on the disarm plate
    OnDisarmTriggered(MaybeAgent : ?agent) : void =
        if (A := MaybeAgent?):
            # Disable the Value Setter so it can no longer arm the cannon
            CannonValueSetter.Disable()
            # Show a per-player HUD message
            StatusHUD.Show(A, DisarmedText("🏳 Cannon Disarmed!"))```

**Line-by-line breakdown:**

| Lines | What's happening |
|---|---|
| `ArmedText` / `DisarmedText` | `message` requires a `<localizes>` function  you cannot pass a raw string to `Show`. |
| `StatusHUD.SetDisplayTime(3.0)` | Configures the HUD device once so every subsequent `Show` call uses a 3-second display. |
| `CannonValueSetter.Disable()` | Starts the island in a safe state  the setter cannot fire until a player arms it. |
| `ArmTrigger.TriggeredEvent.Subscribe(OnArmTriggered)` | Registers the handler at class scope; the handler signature must match `(?agent)`. |
| `if (A := MaybeAgent?)` | `TriggeredEvent` sends `?agent` (optional). Unwrap before using  if no agent triggered it (e.g. code-triggered), the block is skipped. |
| `CannonValueSetter.Enable()` | Turns the Value Setter back on so its in-editor payload will fire next time it is triggered. |
| `StatusHUD.Show(A, ArmedText(...))` | Targets the message to the specific player who stepped on the plate. |

## Common patterns

### Pattern 1 — Broadcast HUD message to everyone when the setter is enabled

Sometimes you want the *whole island* to know the cannon is armed, not just the player who stepped on the plate. Use the no-argument `Show()` overload.

```verse
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Verse.org/Native }

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

cove_broadcast_arm := class(creative_device):

    @editable ArmTrigger : trigger_device = trigger_device{}
    @editable CannonValueSetter : value_setter_device = value_setter_device{}
    @editable GlobalHUD : hud_message_device = hud_message_device{}

    OnBegin<override>()<suspends> : void =
        # Set a persistent display (0.0 = show until explicitly hidden)
        GlobalHUD.SetDisplayTime(0.0)
        CannonValueSetter.Disable()
        ArmTrigger.TriggeredEvent.Subscribe(OnArm)

    OnArm(MaybeAgent : ?agent) : void =
        CannonValueSetter.Enable()
        # No agent argument — shows to ALL players
        GlobalHUD.Show(BroadcastArmed("⚠ Cannon is now ARMED for everyone!"))

Pattern 2 — Use trigger's own Enable/Disable to create a one-shot arm sequence

After the cannon fires once, disable the arm trigger so it cannot be re-armed, and clear the HUD for all players.

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

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

cove_one_shot_arm := class(creative_device):

    @editable ArmTrigger    : trigger_device      = trigger_device{}
    @editable FireTrigger   : trigger_device      = trigger_device{}
    @editable CannonSetter  : value_setter_device = value_setter_device{}
    @editable StatusHUD     : hud_message_device  = hud_message_device{}

    OnBegin<override>()<suspends> : void =
        CannonSetter.Disable()
        # Allow the cannon to fire at most once
        FireTrigger.SetMaxTriggerCount(1)
        ArmTrigger.TriggeredEvent.Subscribe(OnArm)
        FireTrigger.TriggeredEvent.Subscribe(OnFire)

    OnArm(MaybeAgent : ?agent) : void =
        CannonSetter.Enable()
        StatusHUD.Show(FiredText("Cannon armed — fire when ready!"))

    OnFire(MaybeAgent : ?agent) : void =
        # Cannon has fired — lock everything down
        CannonSetter.Disable()
        # Disable the arm trigger so nobody can re-arm
        ArmTrigger.Disable()
        # Wipe HUD for all players
        StatusHUD.ClearAllMessages()
        StatusHUD.Show(FiredText("💥 Cannon fired! Sequence complete."))

Pattern 3 — Delayed re-arm using SetResetDelay and GetTriggerCountRemaining

Show the player how many arm attempts remain, and add a cooldown before the arm trigger can fire again.

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

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

cove_delayed_rearm := class(creative_device):

    @editable ArmTrigger   : trigger_device      = trigger_device{}
    @editable CannonSetter : value_setter_device = value_setter_device{}
    @editable InfoHUD      : hud_message_device  = hud_message_device{}

    OnBegin<override>()<suspends> : void =
        CannonSetter.Disable()
        # Allow 3 arm attempts total
        ArmTrigger.SetMaxTriggerCount(3)
        # 5-second cooldown between arm presses
        ArmTrigger.SetResetDelay(5.0)
        InfoHUD.SetDisplayTime(4.0)
        ArmTrigger.TriggeredEvent.Subscribe(OnArm)

    OnArm(MaybeAgent : ?agent) : void =
        if (A := MaybeAgent?):
            CannonSetter.Enable()
            Remaining := ArmTrigger.GetTriggerCountRemaining()
            InfoHUD.Show(A, AttemptsText("Cannon armed! Attempts left: {Remaining}"))

Gotchas

1. value_setter_device has NO events — it is driven, not listened to

The value_setter_device exposes only Enable and Disable. There is no TriggeredEvent on it. If you need to react to when a value is set, listen to the downstream device (e.g. a trigger or item spawner) instead.

2. TriggeredEvent sends ?agent, not agent

The handler signature must be (MaybeAgent : ?agent) : void. Always unwrap with if (A := MaybeAgent?) before calling any agent-typed method. Forgetting this is the #1 compile error with trigger subscriptions.

3. message is NOT a string — use a <localizes> function

Every method that accepts message (like hud_message_device.Show, SetText) requires a localized value. Declare a helper:

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

There is no StringToMessage function. Passing a raw string literal directly will fail to compile.

4. Enable/Disable on value_setter_device control the setter, not the target device

Calling CannonSetter.Enable() does not enable the cannon trap device — it enables the Value Setter so that when it is triggered (in-editor wiring), it will apply its payload. To also enable the target device from Verse, you need a separate @editable reference to that device.

5. SetDisplayTime(0.0) means persistent, not instant

Passing 0.0 to SetDisplayTime (or the DisplayTime named param on Show) keeps the message on screen until you call Hide or ClearAllMessages. Use a positive float for timed display.

6. SetMaxTriggerCount clamps between 0 and 20

0 means unlimited. Values above 20 are silently clamped to 20. Plan your arm-attempt logic accordingly.

7. All @editable device fields must be placed in the class body, not inside functions

Declaring ArmTrigger inside OnBegin or a helper method will fail with "Unknown identifier". Every device reference must be a class-level @editable field.

Guides & scripts that use value

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

Build your own lesson with value

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 →