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
Rally Audio ManagerRally Camera Path PlayerRally ClientRally Cut CaptureRally EnumsRally Extension HelperRally GeometryRally ManagerRecce ManagerRecce AppRecce SettingsRally Settings ManagerSnap-to-RoadTraffic Exclusion ZonesRally UtilityRally Vehicle CaptureRally Vehicle Tracker
Rally CodriverRally Mission SettingsRally PacenotePacenote GeneratorPacenote WaypointNotebook PathStructured Pacenote DataSystem PacenotesWaypoint Types

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 Extensionsgameplayrallynotebook

Rally Pacenote

Core class representing a single pacenote in a rally notebook. Manages note text (freeform + structured), waypoints (corner start/end), audio compilation, validation, debug drawing, trigger types, and

Core class representing a single pacenote in a rally notebook. Manages note text (freeform + structured), waypoints (corner start/end), audio compilation, validation, debug drawing, trigger types, and serialization. This is one of the largest classes in the rally system.


Constructor

local Pacenote = require('gameplay/rally/notebook/pacenote')
local pn = Pacenote(notebook, name, forceId)

Public API (Key Methods)

Note Content

MethodSignatureReturnsDescription
noteOutputFreeform(lang?)stringRenders freeform note with variable interpolation
noteOutputStructured(lang?)tableReturns array of structured note strings
getNoteFieldBefore(lang?)stringDistance call before the note
getNoteFieldAfter(lang?)stringDistance call after the note
getNoteFieldFreeform(lang?)stringRaw freeform note text
getNoteFieldStructured(lang?)tableRaw structured note array
setNoteFieldFreeform(val, lang?)nilSets freeform note text
setNoteFieldStructured(val, lang?)nilSets structured note array
setNoteFieldBefore(val, meters)nilSets before distance call + meters
setNoteFieldAfter(val, meters)nilSets after distance call + meters

Audio

MethodSignatureReturnsDescription
getAudioMode()enumActive audio mode (freeform/structuredOnline/structuredOffline/custom)
audioObjs()table|nilReturns compiled audio objects for active mode
audioLenTotal()numberTotal audio duration in seconds
asCompiled()table|nilReturns cached compiled pacenote data

Waypoints

MethodSignatureReturnsDescription
getCornerStartWaypoint()wp|nilReturns the CS waypoint
getCornerEndWaypoint()wp|nilReturns the CE waypoint
getNextWaypointType()string|nilReturns next needed waypoint type
setAllRadii(radius, wpType?)nilSets radius on all (or filtered) waypoints

Validation & State

MethodSignatureReturnsDescription
validate()nilPopulates validation_issues array
is_valid()booleanTrue if no validation issues
setTriggerType(val)nilSets trigger type enum
toggleSlowCorner()nilToggles slow corner flag
toggleIsolate()nilToggles isolation (suppresses distance calls)

Drawing

MethodSignatureReturnsDescription
drawDebugPacenoteSelected(toolsState, opacity)nilDraws selected pacenote with full detail
drawDebugPacenoteBackground(toolsState, opacity)nilDraws as background context
drawDebugPacenoteNoSelection(toolsState, opacity)nilDraws in no-selection mode

Internals

Note Fields Structure

Per-language storage:

notes[lang] = {
  before = "",           -- distance call before
  beforeMeters = -1,     -- raw distance in meters
  note = {
    freeform = "",       -- text string with $db/$da vars
    structured = {},     -- array of phrase strings
    custom = { audioFile = "", description = "" }
  },
  after = "",            -- distance call after
  afterMeters = -1
}

Audio Modes

ModeSourceDescription
freeformMission-specific TTSSingle audio file from freeform text
structuredOnlineMission-specific TTSPer-phrase audio files from structured notes
structuredOfflinePre-generated libraryPhrase audio from compositor voice library
customUser-providedCustom audio file with description
autoNotebook defaultInherits from notebook's audio mode

Trigger Types

TypeIndicatorDescription
dynamic(none)Default dynamic trigger
csImmediateIImmediate at corner start
csStaticcsSStatic at corner start
csHalfcs+50%Halfway through corner start
ceMinus5ce-5m5m before corner end
ceStaticceSStatic at corner end

Compilation

asCompiled() caches compiled data including:

  • Audio objects and lengths for ALL four modes
  • Visual pacenote events for HUD display
  • Distance before/after strings
  • Breath timing configuration

Validation Checks

  • Missing CS or CE waypoint
  • Empty pacenote name
  • Missing freeform or structured note text
  • TODO marker set

How It Works

  1. Created by notebook's sortedList system with waypoints as sub-list
  2. Notes are stored per-language with freeform and structured variants
  3. asCompiled() builds cached audio/visual data on first access
  4. Drawing methods use configurable draw configs for different selection states
  5. Serialization includes all note data, waypoints, metadata, and structured fields

Usage Example

-- Access pacenote data
local text = pacenote:noteOutputFreeform("english")
local cs = pacenote:getCornerStartWaypoint()
local ce = pacenote:getCornerEndWaypoint()

-- Compile for playback
local compiled = pacenote:asCompiled()
local audioObjs = pacenote:audioObjs()

-- Validate
pacenote:validate()
if not pacenote:is_valid() then
  log('W', '', 'Issues: ' .. dumps(pacenote.validation_issues))
end

See Also

  • Rally Codriver - Related reference
  • Rally Mission Settings - Related reference
  • Pacenote Generator - Related reference
  • Gameplay Systems Guide - Guide

Rally Mission Settings

Class managing per-mission rally settings stored as a JSON file alongside mission data. Handles notebook filename selection, codriver selection, and persistence. Auto-creates defaults if the settings

Pacenote Generator

Simplified corner detection system that generates pacenotes from driveline points. Analyzes road geometry using circle-fitting to identify direction changes, then groups consecutive nodes into corners

On this page

ConstructorPublic API (Key Methods)Note ContentAudioWaypointsValidation & StateDrawingInternalsNote Fields StructureAudio ModesTrigger TypesCompilationValidation ChecksHow It WorksUsage ExampleSee Also