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
Drift Zone BoundsDrift Race PathDrift UI DisplayDrift Detection EngineDrift SystemDrift Quick MessagesDrift Save/LoadDrift ScoreboardDrift Scoring SystemDrift AudioDrift StallingDrift StatisticsDrift Stunt Zones

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 Extensionsgameplaydrift

Drift Quick Messages

Reference for `gameplay_drift_quickMessages`, which detects special drift achievements (close calls, big angles, long drifts, etc.) and awards bonus points with on-screen messages.

Reference for gameplay_drift_quickMessages, which detects special drift achievements (close calls, big angles, long drifts, etc.) and awards bonus points with on-screen messages.


Dependencies

gameplay_drift_general, gameplay_drift_drift, gameplay_drift_scoring


Exports

| Function | Signature | Description | |------ | M.dependencies | table | { |----|-----------|-------------| | onUpdate | (dt) | Check primary, confirm, and reset conditions | | reset | () | Clear all processed states | | onDriftPlVehReset | () | Reset on vehicle reset | | onDriftCompleted | () | Chain ended - check reset conditions | | onDriftActiveDataFinished | () | Single drift ended - check reset | | onDriftCrash / onDriftSpinout | () | Reset on failure | | getQuickMessages | () → table | All message definitions with translated names | | getDriftDebugInfo | () → table | Debug toggle | | getGC | () → number | Profiler garbage |


Quick Message Definitions

IDPrimary ConditionsResetReward
bigAngleangle > 80°on drift end15
reverseDriftangle > 105°on drift end30
longDriftdrift time > 4s, speed > 30 kphon drift end20
closeCallangle > 25°, speed > 30 kph, wall < 1.5mafter 4s (no crash confirm)80
longDriftChainchain ≥ 10 driftson chain end160
precisionDrifting3+ close calls in one chainon chain end150

Condition System

Primary Conditions

All must be true simultaneously:

primaryConditions = {
  minAngle = function(threshold, data) return data.driftActiveData.currDegAngle > threshold end,
  minSpeed = function(threshold, data) return data.currentSpeed > threshold end,
  minDist = function(threshold, data) return wallDistFront < threshold or wallDistRear < threshold end,
  minDriftChain = function(threshold, data) return chainedDrifts >= threshold end,
  minCachedScore = function(threshold, data) return cachedScore >= threshold end,
  minDriftTime = function(threshold, data) return currentDriftDuration > threshold end,
  notDrifting = function(_, data) return not data.driftActiveData end,
  closeCallsInOneChain = function(threshold, data) return closeCallsCount >= threshold end,
  minOneDriftScore = function(threshold, data) return driftActiveData.score > threshold end,
}

Confirm Conditions

Must pass after primary conditions are met:

confirmConditions = {
  noCrash = function(data, dt)
    -- Must not crash for 1 second after conditions met
    -- Returns "failed" if crash detected, true when timer expires
  end,
}

Reset Conditions

When to allow re-triggering:

resetConditions = {
  onDriftEnd = function() return {reset = individualDriftStoppedThisFrame} end,
  onChainEnd = function() return {reset = driftChainStoppedThisFrame} end,
  afterTime = function(data, args) -- timer-based reset end,
}

How It Works

-- Each frame:
-- 1. Check primary conditions for all unprocessed messages
-- 2. If met → either directly display or queue for confirmation
-- 3. Check confirm queues (e.g., noCrash timer)
-- 4. Check reset conditions to re-enable processed messages
-- 5. When triggered: display message, add score, fire hooks

-- Close call example:
-- Primary: angle > 25°, speed > 30 kph, wall < 1.5m → queue
-- Confirm: no crash for 1 second → award 80 points
-- Reset: 4 seconds after trigger
-- Also increments closeCallsInCurrentDriftChain for precision check

Key Behaviors

  • Messages are translated via translateLanguage("missions.drift.quickMessage.<id>")
  • Rewards are added directly to cached score via gameplay_drift_scoring.addCachedScore()
  • onDriftQuickMessageReached hook fires with {quickMessageId, reward} for scoreboard tracking
  • Messages won't trigger while gameplay_drift_general.getFrozen() is true
  • Close call counter resets on chain end via reset.funcWhenReset

Module Variables

VariableTypeDescription
M.dependenciestable{
M.getDriftDebugInfo()-
M.getGC()-
M.getQuickMessages()-
M.onDriftActiveDataFinished()-
M.onDriftCompleted()-
M.onDriftCrash()-
M.onDriftPlVehReset()-
M.onDriftSpinout()-
M.onUpdate(dt)-
M.reset()-

See Also

  • drift/bounds - Drift Zone Boundary Detection - Related reference
  • drift/destination - Race Path & Wrong-Way Detection - Related reference
  • drift/display - Drift UI & HUD Management - Related reference
  • Gameplay Systems Guide - Guide

Drift System

Reference for `gameplay_drift_general`, which is the central manager for the drift subsystem. Controls extension loading/unloading, context switching, debug state, freeze/pause logic, and coordinates

Drift Save/Load

Reference for `gameplay_drift_saveLoad`, which loads drift spot definitions from level directories, manages per-spot score persistence, and handles career save integration.

On this page

DependenciesExportsQuick Message DefinitionsCondition SystemPrimary ConditionsConfirm ConditionsReset ConditionsHow It WorksKey BehaviorsModule VariablesSee Also