RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Flowgraph Base ModuleFlowgraph Base NodeFlowgraph Base State NodeFlowgraph Node BuilderFlowgraph GraphFlowgraph Group HelperFlowgraph LinkFlowgraph ManagerNew Node TemplateFlowgraph PinFlowgraph States ManagerFlowgraph UtilsFlowgraph Variable Storage
Align For CouplingApply Velocity to VehicleBoost VehicleSet Vehicle ColorsCustom Parts Config ProviderEnter VehicleFlip UprightFreeze VehicleGenerate License PlateGet Vehicle ActiveGet Electrics ValueGet GearboxmodeGet Powertrain DataGravity ForceDistance From GroundHas Coupler TagIs CoupledIs Player UsableKeep VehicleMove Vehicle ToOn Cannon FiredOn Vehicle DestroyedOn Vehicle ResetOn Vehicle SpawnedOn Vehicle SwitchedPlayer UsableRandom Config ProviderRecover In PlaceRemove VehicleTimeline ReplaySet Vehicle ActiveSet Gearbox ModeSet IgnitionSet License PlateSet LightbarSet LightsShift to Gear IndexSpawn VehicleVehicle StatesTeleport To Last RoadToggle Vehicle ControlsMove To ShowroomVehicle TouchProps TouchStatic Object TouchTrack VehicleTrailer Respawn ControlVehicle Config ProviderGet Vehicle DataGet Vehicle DataGet Vehicle BoundsVehicle PingGet Vehicle Wheel Center

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionsflowgraphnodesvehicle

On Cannon Fired

- **Node Name:** `on Cannon Fired`

Overview

  • Node Name: on Cannon Fired
  • Category: repeat_instant
  • File: extensions/flowgraph/nodes/vehicle/onCannonFired.lua

Detects when a cannon is fired. Outputs an impulse flow signal for one frame when the onCannonFired game event occurs.

Pin Schema

Output Pins

PinTypeDescription
cannonFiredflow (impulse)Fires for one frame when a cannon is fired

Internals

Key Methods

MethodDescription
workOnce()Initializes the flag to false
work()Checks if the flag is set; if so, outputs true for one frame and resets the flag
onCannonFired(id)Hook callback - sets the internal flag to true when a cannon fires

How It Works

  1. The node listens for the onCannonFired game hook, which is called when any cannon is fired in the game world.
  2. When the hook fires, onCannonFired(id) sets an internal flag to true.
  3. On the next work() call, the node outputs cannonFired = true for exactly one frame (impulse behavior), then resets the flag.
  4. If no cannon was fired, the output stays false.

Usage Example

-- In a flowgraph:
-- [on Cannon Fired] → (cannonFired) → [Play Sound Effect]
--                                    → [Increment Score]

-- The node reacts to the engine hook:
-- extensions.hook('onCannonFired', cannonId)

Key Dependencies

  • onCannonFired hook - engine-level event fired when a cannon weapon is discharged

See Also

  • Align for Coupling (Flowgraph Node) - Related reference
  • Apply Velocity to Vehicle (Flowgraph Node) - Related reference
  • Boost Vehicle (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

Move Vehicle To

- **Node Name:** `Move Vehicle To`

On Vehicle Destroyed

- **Node Name:** `On Vehicle Destroyed`

On this page

OverviewPin SchemaOutput PinsInternalsKey MethodsHow It WorksUsage ExampleKey DependenciesSee Also