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

Select Garage Spots (Flowgraph Node)

- **Node Name:** `Select Garage Spots`

Overview

  • Node Name: Select Garage Spots
  • Category: once_p_duration
  • File: extensions/flowgraph/nodes/mission/selectGarageSpots.lua
  • Icon: Scene icon
  • Color: Scene color
  • Author: BeamNG

Selects randomized start and end parking spots for a Garage-to-Garage mission. Supports zone filtering, distance constraints, and duplicate prevention.

Pin Schema

Input Pins

PinTypeDescription
flowflowTrigger this node
resetflow (impulse)Reset the node state
sitesDatatableSites data with parkingSpots.byName
minDistnumberMinimum distance between start and end spots
maxDistnumberMaximum distance between start and end spots
zonestringZone name filter for starting spots (used when isLocal is true)
isLocalboolIf true, only starting spots in the specified zone are considered

Output Pins

PinTypeDescription
flowflowActive once spots are found
loadedflow (impulse)Fires once after spots are selected
startSpotstringSelected start parking spot name
endSpotstringSelected end parking spot name
startLocationstringZone name of the start location
endLocationstringZone name of the end location

Internals

  • self.usedStartingSpotNames - array of previously used start spot names; resets when all spots exhausted.
  • self.spots / self.names - cached parking spot data from sitesData.
  • self.state - 1 = selecting, 2 = done (flow continues, impulse cleared).

findEndSpotForStartingSpot(startSpot)

Shuffles all parking spots, iterates to find one within [minDist, maxDist] direct distance from the start. Falls back to the closest candidate if none fits exactly.

How It Works

  1. When flow is active and state is 1:
    • Loads parking spots from sitesData.
    • If isLocal, filters starting candidates to only those whose highest-priority zone matches zone.
    • Removes previously used starting spots; resets the used list when exhausted.
    • Shuffles available starts, picks the first.
    • Finds a suitable end spot via findEndSpotForStartingSpot.
    • Sorts zones by priority and outputs spot + location names.
  2. State 2: keeps flow active, clears the loaded impulse.

Lua Code Example

-- Garage-to-Garage with local zone filtering:
-- selectGarageSpots (isLocal=true, zone="Downtown", minDist=200, maxDist=2000)
--   .startSpot → navigation origin
--   .endSpot → navigation destination

Key Dependencies

  • sitesData.parkingSpots.byName - parking spot database
  • tableKeys, tableValuesAsLookupDict - BeamNG table utilities

Additional Methods

C:_executionStarted()

Called when graph execution starts. Used for initialization/reset.

C:init()

Initializes the node, setting up pins and default properties.

C:resetData()

Node method.

C:work()

Main work function called each frame/tick when the node is active.

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

Select Garage Sites / Zones (Flowgraph Node)

- **Node Name:** `Select Garage Sites`

Select Heist Spots (Flowgraph Node)

- **Node Name:** `Select Heist Spots`

On this page

OverviewPin SchemaInput PinsOutput PinsInternalsfindEndSpotForStartingSpot(startSpot)How It WorksLua Code ExampleKey DependenciesAdditional MethodsC:_executionStarted()C:init()C:resetData()C:work()C:workOnce()See Also