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_devicethat 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
@editablefields let you drop the real placedvehicle_spawner_siege_cannon_deviceandtrigger_deviceinto this Verse device's Details panel. Without the editable field, callingCannonSpawner.Enable()would be an Unknown identifier — a bare device reference doesn't work. var CrewCount : int = 0is mutable state we update from event handlers;setis required to reassign it.- In
OnBeginwe disable the spawner so no cannon exists at match start, then subscribe every handler. Subscriptions must happen here inOnBegin. OnHornBlownreceives(Agent : ?agent)becauseTriggeredEventis alistenable(?agent). We unwrap withif (Driver := Agent?)before passing it toAssignDriver, which takes a plainagent.RespawnVehicle()destroys any existing cannon and spawns a fresh one — perfect for starting a clean round.SpawnedEventhands us afort_vehicle;DestroyedEventhands ustuple()(nothing), so its handler takes no parameter.- When the cannon dies we
spawna suspending function so we canSleep(RespawnDelay)without blocking the event handler, then callRespawnVehicle()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
@editablefield. You cannot callvehicle_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. AssignDrivertakes a plainagent, butTriggeredEventgives you?agent. Always unwrap withif (Driver := Agent?):before passing it along — passing the optional directly won't compile.SpawnedEventhands you afort_vehicle;DestroyedEventhands youtuple(). Match your handler signatures:OnSpawned(Vehicle : fort_vehicle)vsOnDestroyed()with no parameter. Mismatched handler arity is a compile error.- Prefer
SpawnedEvent/DestroyedEventover the deprecatedVehicleSpawnedEvent/VehicleDestroyedEvent. The new events were added precisely because the old ones returnedtuple()and couldn't give you the spawned vehicle. The deprecated ones still compile but you lose thefort_vehiclereference. RespawnVehicledestroys the old cannon first. If you call it while a player is driving, they'll be ejected. Don't spam it; useDisable/Enableto gate availability andRespawnVehicleonly when you truly want a fresh vehicle.- Don't
Sleepinside an event handler. Event handlers run synchronously; if you need a delay (like the respawn cooldown),spawna separate<suspends>function andSleepthere. - Subscribe in
OnBegin. Subscribing elsewhere (or forgetting to subscribe) means your handlers never fire even though the methods compile fine.