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
Route Distance (Flowgraph Node)Closest Road (Flowgraph Node)Custom Lua (Flowgraph Node)Distance Between (Flowgraph Node)Waypoints Distance (Flowgraph Node)File Exists (Flowgraph Node)Get First Element of Table (Flowgraph Node)Get Level Data (Flowgraph Node)Get Map Objects IDs by DynField (Flowgraph Node)Get Table Value By Key (Flowgraph Node)GHOST (Flowgraph Node)Hide Loading Screen (Flowgraph Node)Color HSV (Flowgraph Node)Line Point From Xnorm (Flowgraph Node)Load Level (Flowgraph Node)Load Project (Flowgraph Node)On Menu (Flowgraph Node)Perlin Noise (Flowgraph Node)Pop Action Map (Flowgraph Node)Get Project InfoPush Action MapRandom ColorRandom NumberRandom QuaternionRandom VectorRoad PropertiesGet Navgraph RouteRoute PositionTemplate NodeTimeTimed SequenceTo NumberTo StringWorld Editor Open

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 Extensionsflowgraphnodesutil

Road Properties

- **Node Name:** `Road Properties`

Overview

  • Node Name: Road Properties
  • Category: repeat_instant
  • File: extensions/flowgraph/nodes/util/roadSegment.lua

Outputs detailed properties of a road segment defined by two navgraph node names, including direction, width, speed limit, drivability, and lane information.

Pin Schema

Input Pins

PinTypeDefaultDescription
n1string-First node of the road segment
n2string-Second node of the road segment
xnormnumber0.5Normalized distance along the segment (0–1) (hidden)

Output Pins

PinTypeDescription
roadDirvec3Road direction vector (respects one-way direction)
lengthnumberRoad segment length
widthnumberRoad width at xnorm position
drivabilitynumberRoad drivability value (0–1)
speedLimitnumberRoad speed limit in m/s
lanesIncomingnumberIncoming lanes count
lanesOutgoingnumberOutgoing lanes count
lanesTotalnumberTotal lanes count
isOneWayboolTrue if the road is one-way only (hidden)
isPrivateboolTrue if the road is private / gated (hidden)

Internals

Key Methods

MethodDescription
init()Clears cached node IDs
_executionStarted()Resets cached node IDs
work()Reads navgraph data for the given segment and outputs properties

Caching Strategy

The node caches n1 and n2 and only recalculates static properties (direction, length, drivability, speed limit, lanes) when the node pair changes. The width output updates every frame since it depends on the dynamic xnorm input.

Lane Parsing

Lanes are parsed from the link's lanes string (default '-+'). The - characters count as incoming lanes, + as outgoing lanes.

Direction Handling

The direction vector points from n1 to n2, but is flipped if the link's inNode matches n2 (respecting one-way road direction).

How It Works

  1. Retrieves navgraph map data via map.getMap().nodes.
  2. Looks up the link between n1 and n2 for segment properties.
  3. Computes direction vector, normalized, between the two node positions.
  4. Width is calculated as lerp(a.radius, b.radius, xnorm) * 2.
  5. Lane counts are derived by counting - and + characters in the lane string.

Usage Example

-- Get properties of a road segment:
-- n1 = "wp_road_001", n2 = "wp_road_002"
-- xnorm = 0.5 (midpoint)
-- Outputs: length, width, speedLimit, drivability, lane counts, direction

-- Check if road is one-way:
-- isOneWay output will be true/false

-- Get width at a specific point:
-- xnorm = 0.0 → width at node n1
-- xnorm = 1.0 → width at node n2

Key Dependencies

  • map.getMap() - navgraph map data access

See Also

  • Route Distance (Flowgraph Node) - Related reference
  • Closest Road (Flowgraph Node) - Related reference
  • Custom Lua (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

Random Vector

- **Node Name:** `Random Vector`

Get Navgraph Route

- **Node Name:** `Get Navgraph Route`

On this page

OverviewPin SchemaInput PinsOutput PinsInternalsKey MethodsCaching StrategyLane ParsingDirection HandlingHow It WorksUsage ExampleKey DependenciesSee Also