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
Crash Test BoundariesCrash Test CountdownCrash Test ScoringCrash Test Task ListCrash Test Scenario Manager

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 ExtensionsgameplaycrashTest

Crash Test Countdown

Reference for `gameplay_crashTest_crashTestCountdown`, a simple countdown timer that displays a visual countdown and plays audio cues before a crash test step begins.

Reference for gameplay_crashTest_crashTestCountdown, a simple countdown timer that displays a visual countdown and plays audio cues before a crash test step begins.


Overview

Provides a count-down-from-N timer with flash messages ("3", "2", "1", "Go!") and corresponding audio events. When the countdown reaches zero, a callback function is invoked to start the step.


Exports

FunctionSignatureDescription
onUpdate(dtReal, dtSim)Tick the countdown timer each frame
startNewCountdown(duration, callback)Begin a new countdown of duration seconds
M.onUpdate(dtReal, dtSim)-
M.startNewCountdown(duration, callback_)-

Internals

  • timer - Current remaining time in seconds
  • old - Tracks the previous floored second to detect transitions
  • callback - Function called when the countdown hits zero

Display & Sound

Each time the countdown crosses a whole-second boundary:

  • A ScenarioFlashMessage GUI hook displays the current number (or "Go!" at zero)
  • Audio events play: UI_Countdown1 for each tick, UI_CountdownGo at zero

How It Works

  1. startNewCountdown(3, myCallback) initializes the timer to 3 seconds
  2. Each frame, onUpdate decrements the timer by dtSim
  3. When the floored timer changes (e.g., 3→2), a flash message and sound play
  4. At zero, "Go!" is displayed, the go-sound plays, and the callback fires
-- Start a 3-second countdown, then unfreeze the player
gameplay_crashTest_crashTestCountdown.startNewCountdown(3, function()
  -- Player is unfrozen and step begins
  core_vehicleBridge.executeAction(veh, 'setFreeze', false)
end)

Key Behaviors

  • The countdown only ticks when timer > 0
  • Uses dtSim (simulation time), so it pauses when the game is paused
  • The callback is fired exactly once when the timer expires
  • Flash messages use ScenarioFlashMessage with full-screen styling (0.95 size)

See Also

  • crashTestBoundaries - Crash Test Boundary Checking - Related reference
  • crashTestScoring - Crash Test Score Calculation - Related reference
  • crashTestTaskList - Crash Test UI Task List - Related reference
  • Gameplay Systems Guide - Guide

Crash Test Boundaries

Reference for `gameplay_crashTest_crashTestBoundaries`, which manages spatial boundaries for crash test missions. Checks whether the player vehicle is inside designated zones and triggers out-of-bound

Crash Test Scoring

Reference for `gameplay_crashTest_crashTestScoring`, which calculates and aggregates scores for crash test mission steps based on time, speed, damage, and impact location accuracy.

On this page

OverviewExportsInternalsDisplay & SoundHow It WorksKey BehaviorsSee Also