RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Gameplay AchievementGameplay CityDiscoverForce FieldGarage ModeMarker InteractionParking SystemGameplay Playmode MarkersGameplay PoliceGameplay RallyGameplay Rally LoopGameplay Raw POIsGameplay Skidpad TestSpeed Trap LeaderboardsSpeed Traps and CamerasGameplay StatisticsTaxi Ride SystemTraffic SystemVehicle PerformanceWalking
Crawl BoundariesCrawl Flowgraph BridgeCrawl DebugCrawl UI DisplayCrawl Flowgraph BridgeCrawl SystemCrawl Save SystemCrawl Engine

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 Extensionsgameplaycrawl

Crawl System

Reference for `gameplay_crawl_general`, the main manager for rock crawling trails. Handles trail setup, crawl lifecycle, POI registration, big map integration, activity dialogs, and score persistence.

Reference for gameplay_crawl_general, the main manager for rock crawling trails. Handles trail setup, crawl lifecycle, POI registration, big map integration, activity dialogs, and score persistence.


Overview

This is the central coordinator for the crawl system. It manages the active trail state, delegates to crawl_utils for the actual crawl logic, registers POIs on the big map, handles activity acceptance dialogs, and saves scores through the save system.


Dependencies

gameplay_crawl_saveSystem, gameplay_crawl_utils, gameplay_crawl_boundary, gameplay_crawl_display


Exports

FunctionSignatureDescription
setupCrawl(trail, veh, isFromMission)Configure a crawl trail with boundary, path, starting position
startCrawlFreeroam(trail, veh)Setup and start a freeroam crawl
startCrawlFlowgraph(trail, veh)Start a mission-driven crawl
clear(force)Clear active trail and all crawl state
onUpdate(dtReal, dtSim, dtRaw)Per-frame update: delegates to utils.updateCrawl
onGetRawPoiListForLevel(levelIdentifier, elements)Register crawl POIs on the big map
onActivityAcceptGatherData(elemData, activityData)Build activity accept dialog data
onActivityIndexVisible(data)Setup crawl preview when POI is focused
onDrawOnMinimap(td)Draw boundary on minimap
onCrawlResultsShown(eventData)Save player score on completion
onVehicleSwitched(oldId, newId)Clear non-mission crawl on vehicle switch
onVehicleDestroyed(vehId)Clear non-mission crawl on vehicle destroy
onAnyMissionChanged(status, id)Clear crawl when mission stops

Module State

  • M.activeTrail - Table with trail, boundary, path, startingPosition, prefabs, isFromMission
  • M.crawlersData - Array of crawler data objects

Trail Setup

setupCrawl() performs:

  1. Loads boundary, path, and starting position from save system
  2. Handles path reversal (reverses nodes, flips rotations by 180°)
  3. Sets up crawler data via utils.setupCrawlerData
  4. Loads trail prefabs
  5. Optionally teleports vehicle to starting position (mission mode)

How It Works

-- Freeroam crawl (from POI interaction)
local trail = gameplay_crawl_saveSystem.getTrailById(trailId)
gameplay_crawl_general.startCrawlFreeroam(trail, be:getPlayerVehicle(0))

-- Mission crawl (from flowgraph)
gameplay_crawl_general.setupCrawl(trail, veh, true)
gameplay_crawl_general.startCrawlFlowgraph(trail, veh)

-- Clear everything
gameplay_crawl_general.clear(true)

POI / Big Map Integration

onGetRawPoiListForLevel() registers crawl trails as POIs when:

  • Career is active OR enableCrawlInFreeroam setting is on
  • No crawl is currently active
  • Trail has a valid starting position

POIs include:

  • crawlMarker - In-world marker with position, rotation, radius
  • bigmapMarker - Big map entry with icon, name, description, thumbnail, quick travel

Activity Accept Dialog

When a player approaches a crawl POI, onActivityAcceptGatherData() builds a dialog with:

  • Trail name and "Freeroam Crawl" category
  • Path stats (distance, elevation gain/loss)
  • Player's best penalty points, best time, and attempt count
  • A "Play" button that starts the freeroam crawl

Key Behaviors

  • Path reversal uses arrayReverse and rotates each node by π around the Y axis
  • Reversed trails can have a separate startingPositionIdReversed or derive position from the first reversed node
  • Non-mission crawls are automatically cleared on vehicle switch or destroy
  • Scores are saved via gameplay_crawl_saveSystem.addNewPlayerScore on results shown
  • The onSerialize hook clears state to prevent stale data across saves

Public API

FunctionSignatureReturnsDescription
M.onExtensionLoaded()nilonExtensionLoaded

Module Variables

VariableTypeDescription
M.dependenciestable{ 'gameplay_crawl_saveSystem', 'gameplay_crawl_utils', 'gameplay_crawl_boundary'
M.clear(force)-
M.onActivityAcceptGatherData(elemData, activityData)-
M.onActivityIndexVisible(data)-
M.onAnyMissionChanged(status, id)-
M.onCrawlResultsShown(eventData)-
M.onDrawOnMinimap(td)-
M.onGetRawPoiListForLevel(levelIdentifier, elements)-
M.onSerialize()-
M.onUpdate(dtReal, dtSim, dtRaw)-
M.onVehicleDestroyed(vehId)-
M.onVehicleSwitched(oldId, newId)-
M.setupCrawl(trail, veh, isFromMission)-
M.startCrawlFlowgraph(trail, veh)-
M.startCrawlFreeroam(trail, veh)-

See Also

  • crawl/boundary - Crawl Boundary System - Related reference
  • crawl/crawlFlowgraphBridge - Crawl Flowgraph Bridge (Legacy) - Related reference
  • crawl/debug - Crawl Debug Window - Related reference
  • Gameplay Systems Guide - Guide

Crawl Flowgraph Bridge

Reference for `gameplay_crawl_flowgraphBridge`, the current bridge between the crawl system and flowgraph nodes. Exposes crawl lifecycle operations for mission flowgraphs.

Crawl Save System

Reference for `gameplay_crawl_saveSystem`, which handles loading, saving, serialization, and caching of crawl trail data (trails, boundaries, paths, starting positions) as well as player score persist

On this page

OverviewDependenciesExportsModule StateTrail SetupHow It WorksPOI / Big Map IntegrationActivity Accept DialogKey BehaviorsPublic APIModule VariablesSee Also