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
ARunForLife (Flowgraph Node)Clear Lights Drag Race (Flowgraph Node)Countdown Lights Controller (Flowgraph Node)Get Custom Vehicle Data (Flowgraph Node)Get Mission Setup Data (Flowgraph Node)Check Players Position / Go To Start Line (Flowgraph Node)KnockAway Check (Flowgraph Node)Lights Controller (Flowgraph Node)Mission Post Clean (Flowgraph Node)Mission Cleanup / Pre Clean (Flowgraph Node)Prepare Vehicle (Flowgraph Node)Remove Stashed Player Vehicle (Flowgraph Node)Select Garage Vehicle (Flowgraph Node)Select Garage Sites / Zones (Flowgraph Node)Select Garage Spots (Flowgraph Node)Select Heist Spots (Flowgraph Node)Set Stage Lights (Flowgraph Node)Update Display Drag Race (Flowgraph Node)

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 Extensionsflowgraphnodesmission

Mission Cleanup / Pre Clean (Flowgraph Node)

- **Node Name:** `Mission Cleanup`

Overview

  • Node Name: Mission Cleanup
  • Category: once_p_duration
  • File: extensions/flowgraph/nodes/mission/preClean.lua
  • Color: Mission blue (0.13, 0.3, 0.64, 0.75)

Cleans up the world state before a mission starts. Stashes vehicles and traffic, with optional overrides to keep the player vehicle or active traffic.

Pin Schema

Input Pins

PinTypeDescription
keepPlayerboolIf true, the player vehicle stays active and is not stashed
keepTrafficboolIf true, current traffic stays active and is not stashed

Output Pins

PinTypeDescription
vehIdnumberThe original player vehicle ID (before any mission vehicle swap)

Internals

  • Calls self.mgr.modules.mission:processVehicles(opts) with keepPlayer and keepTraffic options.
  • Retrieves the original player ID via self.mgr.modules.mission:getOriginalPlayerId(), falling back to be:getPlayerVehicleID(0).

How It Works

  1. The node runs once at the start of the mission duration.
  2. Calls processVehicles on the mission module, which handles stashing the player vehicle, removing traffic vehicles, etc., based on the provided options.
  3. Outputs the original player vehicle ID so downstream nodes can reference it (e.g., to restore it later via postClean).

Lua Code Example

-- Typical mission flowgraph setup:
-- preClean (keepPlayer = false, keepTraffic = false)
--   → vehId output feeds into spawn/setup nodes
--   → eventually postClean uses the same vehId to restore state

Key Dependencies

  • self.mgr.modules.mission - processVehicles(), getOriginalPlayerId()
  • be:getPlayerVehicleID(0) - fallback player vehicle lookup

Additional Methods

C:workOnce()

Called once when the node is triggered (flow-once execution).


See Also

  • ARunForLife (Flowgraph Node) - Related reference
  • Update Display Drag Race (Flowgraph Node) - Related reference
  • Clear Lights Drag Race (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

Mission Post Clean (Flowgraph Node)

- **Node Name:** `Mission Post Clean`

Prepare Vehicle (Flowgraph Node)

- **Node Name:** `Prepare Vehicle`

On this page

OverviewPin SchemaInput PinsOutput PinsInternalsHow It WorksLua Code ExampleKey DependenciesAdditional MethodsC:workOnce()See Also