Reference Devices

vehicle_spawner_siege_cannon_device: Siege Cannons Under Verse Control

The siege cannon is the heavy artillery of a castle-defense map — a slow, powerful cannon a player climbs into to lob shells at a wall. The vehicle_spawner_siege_cannon_device places one in your level, and from Verse you can spawn it, assign who drives it, destroy it, and react when crews climb in or out.

Updated
The code on this reference page is provided as-is and did not pass the latest compile check — treat the examples as a starting point and verify in your project.
Watch the Knotvehicle_spawner_siege_cannon_device in ~90 seconds.

Overview

The vehicle_spawner_siege_cannon_device is a specialized vehicle_spawner_device that puts a siege cannon in your map. Think of a medieval-siege round: attackers must blast through a wall, and the cannon is the tool that does it. The device handles spawning the physical vehicle, but the interesting gameplay — who is allowed to drive, when the cannon respawns, what happens when it gets destroyed — is all driven from Verse.

Reach for this device when you want:

  • A cannon that only appears for the attacking team when a round starts (call Enable/RespawnVehicle).
  • A cannon that auto-seats a chosen player the instant the round begins (AssignDriver).
  • Logic that fires when a crew member enters or exits the cannon, or when the cannon is spawned or destroyed (the listenable events).

Because it inherits everything from vehicle_spawner_device, every method and event below is shared with the tank, sportbike, UFO, and other vehicle spawners — learn it once, reuse it everywhere.

API Reference

vehicle_spawner_siege_cannon_device

Specialized vehicle_spawner_device that allows a siege cannon to be configured and spawned.

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

vehicle_spawner_siege_cannon_device<public> := class<concrete><final>(vehicle_spawner_device):

Events (subscribe a handler to react):

Event Signature Description
AgentEntersVehicleEvent AgentEntersVehicleEvent<public>:listenable(agent) Signaled when an agent enters the vehicle. Sends the agent that entered the vehicle.
AgentExitsVehicleEvent AgentExitsVehicleEvent<public>:listenable(agent) Signaled when an agent exits the vehicle. Sends the agent that exited the vehicle.
SpawnedEvent SpawnedEvent<public>:listenable(fort_vehicle) Signaled when a vehicle is spawned or respawned by this device. Sends the fort_vehicle who was spawned.
VehicleSpawnedEvent VehicleSpawnedEvent<public>:listenable(tuple()) Signaled when a vehicle is spawned or respawned by this device. Deprecated, use SpawnedEvent instead.
VehicleDestroyedEvent VehicleDestroyedEvent<public>:listenable(tuple()) Signaled when a vehicle is destroyed. Deprecated, use DestroyedEvent instead.
DestroyedEvent DestroyedEvent<public>:listenable(tuple()) Signaled when a vehicle is destroyed.

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.
AssignDriver AssignDriver<public>(Agent:agent):void Sets agent as the vehicle's driver.
DestroyVehicle DestroyVehicle<public>():void Destroys the vehicle if it exists.
RespawnVehicle RespawnVehicle<public>():void Spawns a new vehicle. The previous vehicle will be destroyed before a new vehicle spawns.

vehicle_spawner_device

Base class for various specialized vehicle spawners which allow specific vehicle types to be spawned and configured with specialized options.

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

vehicle_spawner_device<public> := class<abstract><epic_internal>(creative_device_base):

Events (subscribe a handler to react):

Event Signature Description
AgentEntersVehicleEvent AgentEntersVehicleEvent<public>:listenable(agent) Signaled when an agent enters the vehicle. Sends the agent that entered the vehicle.
AgentExitsVehicleEvent AgentExitsVehicleEvent<public>:listenable(agent) Signaled when an agent exits the vehicle. Sends the agent that exited the vehicle.
SpawnedEvent SpawnedEvent<public>:listenable(fort_vehicle) Signaled when a vehicle is spawned or respawned by this device. Sends the fort_vehicle who was spawned.
VehicleSpawnedEvent VehicleSpawnedEvent<public>:listenable(tuple()) Signaled when a vehicle is spawned or respawned by this device. Deprecated, use SpawnedEvent instead.
VehicleDestroyedEvent VehicleDestroyedEvent<public>:listenable(tuple()) Signaled when a vehicle is destroyed. Deprecated, use DestroyedEvent instead.
DestroyedEvent DestroyedEvent<public>:listenable(tuple()) Signaled when a vehicle is destroyed.

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.
AssignDriver AssignDriver<public>(Agent:agent):void Sets agent as the vehicle's driver.
DestroyVehicle DestroyVehicle<public>():void Destroys the vehicle if it exists.
RespawnVehicle RespawnVehicle<public>():void Spawns a new vehicle. The previous vehicle will be destroyed before a new vehicle spawns.

Walkthrough

Let's build a siege round controller. When the game begins the cannon is disabled and hidden. A trigger (the "attack horn") starts the siege: we enable the spawner, spawn a fresh cannon, and auto-seat the first player on the attacking team. We track entries/exits to keep a live crew count, and when the cannon is destroyed we automatically respawn a replacement after the explosion.

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

siege_round_controller := class(creative_device):

    # The placed siege cannon spawner. Set this in the Details panel.
    @editable
    CannonSpawner : vehicle_spawner_siege_cannon_device = vehicle_spawner_siege_cannon_device{}

    # A trigger the attackers step on to start the siege.
    @editable
    AttackHorn : trigger_device = trigger_device{}

    # How long to wait after the cannon blows up before sending a new one.
    @editable
    RespawnDelay : float = 5.0

    # Live count of players sitting in the cannon.
    var CrewCount : int = 0

    OnBegin<override>()<suspends>:void =
        # Start the round with no cannon in play.
        CannonSpawner.Disable()

        # Wire up the horn that kicks off the siege.
        AttackHorn.TriggeredEvent.Subscribe(OnHornBlown)

        # React to crew movement and the cannon's lifecycle.
        CannonSpawner.AgentEntersVehicleEvent.Subscribe(OnCrewEnters)
        CannonSpawner.AgentExitsVehicleEvent.Subscribe(OnCrewExits)
        CannonSpawner.SpawnedEvent.Subscribe(OnCannonSpawned)
        CannonSpawner.DestroyedEvent.Subscribe(OnCannonDestroyed)

    # The horn was triggered — start the siege.
    OnHornBlown(Agent : ?agent) : void =
        CannonSpawner.Enable()
        # Spawn a brand-new cannon (any previous one is destroyed first).
        CannonSpawner.RespawnVehicle()
        # Auto-seat the player who blew the horn as the gunner.
        if (Driver := Agent?):
            CannonSpawner.AssignDriver(Driver)

    # A player climbed into the cannon.
    OnCrewEnters(Agent : agent) : void =
        set CrewCount += 1
        Print("Crew aboard: {CrewCount}")

    # A player climbed out of the cannon.
    OnCrewExits(Agent : agent) : void =
        set CrewCount = Max(0, CrewCount - 1)
        Print("Crew aboard: {CrewCount}")

    # The cannon (re)appeared in the world.
    OnCannonSpawned(Vehicle : fort_vehicle) : void =
        Print("Siege cannon ready on the field.")

    # The cannon was destroyed — send a replacement after a beat.
    OnCannonDestroyed() : void =
        Print("Cannon down! Reinforcements inbound.")
        spawn { RespawnAfterDelay() }

    RespawnAfterDelay()<suspends> : void =
        Sleep(RespawnDelay)
        CannonSpawner.RespawnVehicle()

Line by line:

  • The @editable fields let you drop the real placed vehicle_spawner_siege_cannon_device and trigger_device into this Verse device's Details panel. Without the editable field, calling CannonSpawner.Enable() would be an Unknown identifier — a bare device reference doesn't work.
  • var CrewCount : int = 0 is mutable state we update from event handlers; set is required to reassign it.
  • In OnBegin we disable the spawner so no cannon exists at match start, then subscribe every handler. Subscriptions must happen here in OnBegin.
  • OnHornBlown receives (Agent : ?agent) because TriggeredEvent is a listenable(?agent). We unwrap with if (Driver := Agent?) before passing it to AssignDriver, which takes a plain agent.
  • RespawnVehicle() destroys any existing cannon and spawns a fresh one — perfect for starting a clean round.
  • SpawnedEvent hands us a fort_vehicle; DestroyedEvent hands us tuple() (nothing), so its handler takes no parameter.
  • When the cannon dies we spawn a suspending function so we can Sleep(RespawnDelay) without blocking the event handler, then call RespawnVehicle() again.

Common patterns

Pattern 1 — A button that destroys the cannon (sabotage)

Let defenders sabotage the attackers' cannon by interacting with a control panel. This calls DestroyVehicle directly.

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

cannon_sabotage := class(creative_device):

    @editable
    CannonSpawner : vehicle_spawner_siege_cannon_device = vehicle_spawner_siege_cannon_device{}

    @editable
    SabotageButton : button_device = button_device{}

    OnBegin<override>()<suspends>:void =
        SabotageButton.InteractedWithEvent.Subscribe(OnSabotage)

    OnSabotage(Agent : agent) : void =
        # Blow up whatever cannon is currently on the field.
        CannonSpawner.DestroyVehicle()
        Print("The siege cannon has been sabotaged!")

Pattern 2 — Toggle the spawner with Enable / Disable on a timer phase

Keep the cannon offline during a "build phase" and bring it online when combat starts.

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

siege_phase_manager := class(creative_device):

    @editable
    CannonSpawner : vehicle_spawner_siege_cannon_device = vehicle_spawner_siege_cannon_device{}

    @editable
    BuildPhaseSeconds : float = 30.0

    OnBegin<override>()<suspends>:void =
        # No cannon during the build phase.
        CannonSpawner.Disable()
        Sleep(BuildPhaseSeconds)
        # Combat begins: bring the spawner online and put a cannon down.
        CannonSpawner.Enable()
        CannonSpawner.RespawnVehicle()
        Print("Combat phase! Siege cannon deployed.")

Pattern 3 — React to spawns and track the live vehicle

Use SpawnedEvent to grab the fort_vehicle reference each time a cannon appears.

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

cannon_tracker := class(creative_device):

    @editable
    CannonSpawner : vehicle_spawner_siege_cannon_device = vehicle_spawner_siege_cannon_device{}

    var Spawns : int = 0

    OnBegin<override>()<suspends>:void =
        CannonSpawner.SpawnedEvent.Subscribe(OnSpawned)
        # Put the first cannon on the field immediately.
        CannonSpawner.RespawnVehicle()

    OnSpawned(Vehicle : fort_vehicle) : void =
        set Spawns += 1
        Print("Cannon #{Spawns} has rolled out.")

Gotchas

  • Declare the device as an @editable field. You cannot call vehicle_spawner_siege_cannon_device.Enable() on a bare type. Add a field, then assign the placed device in the Details panel, then call methods on that field.
  • AssignDriver takes a plain agent, but TriggeredEvent gives you ?agent. Always unwrap with if (Driver := Agent?): before passing it along — passing the optional directly won't compile.
  • SpawnedEvent hands you a fort_vehicle; DestroyedEvent hands you tuple(). Match your handler signatures: OnSpawned(Vehicle : fort_vehicle) vs OnDestroyed() with no parameter. Mismatched handler arity is a compile error.
  • Prefer SpawnedEvent/DestroyedEvent over the deprecated VehicleSpawnedEvent/VehicleDestroyedEvent. The new events were added precisely because the old ones returned tuple() and couldn't give you the spawned vehicle. The deprecated ones still compile but you lose the fort_vehicle reference.
  • RespawnVehicle destroys the old cannon first. If you call it while a player is driving, they'll be ejected. Don't spam it; use Disable/Enable to gate availability and RespawnVehicle only when you truly want a fresh vehicle.
  • Don't Sleep inside an event handler. Event handlers run synchronously; if you need a delay (like the respawn cooldown), spawn a separate <suspends> function and Sleep there.
  • Subscribe in OnBegin. Subscribing elsewhere (or forgetting to subscribe) means your handlers never fire even though the methods compile fine.

Build your own lesson with vehicle_spawner_siege_cannon_device

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 →