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
Library CompositorStructured Pacenote SchemaText CompositorVisual Compositor

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 Extensionsgameplayrallynotebookstructured

Text Compositor

Converts structured pacenote data into human-readable text strings for co-driver audio. Handles distance rounding, unit conversions, and phrase enumeration for TTS audio generation.

Converts structured pacenote data into human-readable text strings for co-driver audio. Handles distance rounding, unit conversions, and phrase enumeration for TTS audio generation.


Constructor

local TextCompositor = require('/lua/ge/extensions/gameplay/rally/notebook/structured/textCompositor')
local tc = TextCompositor(compositorName)

Public API

FunctionSignatureReturnsDescription
C:load()booleanLoads the compositor Lua module from disk
C:compositeText(structured, distBefore, distAfter)stringComposites structured data into text
C:compositeTextEscaped(structured, distBefore, distAfter)stringSame as compositeText but with HTML escaping
C:getConfig()tableReturns compositor configuration
C:getBreathConfig()tableReturns breath timing configuration
C:getSystemPacenotes(missionPacenotesDirname)tableReturns system pacenotes (countdown, finish, etc.) with audio filenames
C:getSystemPacenote(name, i)tableGets a specific system pacenote by name and variant index
C:enumerateDistances()tableLists all possible distance call strings
C:enumeratePacenotes()tableLists all possible pacenote phrases
C:enumerateAll()tableEnumerates all phrases (distances + pacenotes + system) with SHA1 hashes
C:writeEnumerated(fname, enumerated)nilWrites enumerated phrases to JSON file
C:roundDistance(dist)number, stringRounds distance and returns value + unit
C:distanceToString(dist, forceSkipSeparateDigits)stringConverts distance in meters to spoken string
C:postProcessPhrase(phrase, punctuation)stringApplies punctuation post-processing
C:getDistanceCallShorthand(dist)stringGets shorthand text for close distances (e.g., "and")
M.init(compositorName)nilinit
M.compositorPath()nilcompositorPath
M.getDistanceCallLevel1Text()nilgetDistanceCallLevel1Text
M.getDistanceCallLevel2Text()nilgetDistanceCallLevel2Text
M.getDistanceCallLevel3Text()nilgetDistanceCallLevel3Text
M.getPointTranslation()nilgetPointTranslation
M.getRoundingMediumThreshold()nilgetRoundingMediumThreshold
M.getRoundingLargeThreshold()nilgetRoundingLargeThreshold

Config Accessors

FunctionReturnsDescription
C:getSeparateDigitsbooleanWhether to space out digits (e.g., "1 50")
C:getPunctuationLastNotestringPunctuation for the last note
C:getPunctuationDefaultstringDefault phrase-end punctuation
C:getPunctuationDistanceCallsstringPunctuation for distance calls
C:getDistanceCallLevel1ThresholdnumberDistance threshold for level 1 ("and")
C:getDistanceCallLevel2ThresholdnumberDistance threshold for level 2
C:getDistanceCallLevel3ThresholdnumberDistance threshold for level 3
C:getBaseUnitstringBase unit translation (e.g., "meters")
C:getLargeUnitstringLarge unit translation (e.g., "kilometers")
C:getRoundingSmallnumberSmall rounding step
C:getRoundingMediumnumberMedium rounding step
C:getRoundingLargenumberLarge rounding step

How It Works

  1. Compositor loading: Loads a Lua module from /lua/ge/extensions/gameplay/rally/compositors/<name>/compositor.lua that defines text rules, severity configs, and punctuation
  2. Distance rounding: Uses three tiers (small/medium/large) with configurable thresholds to produce natural spoken distances
  3. Text composition: Delegates to LibCompositor.composite() which processes structured pacenote attributes through the loaded config
  4. Enumeration: Can enumerate all possible phrases for pre-generating TTS audio, each tagged with a SHA1 hash for audio file lookup
  5. System pacenotes: Manages static phrases (countdown, finish, damage) with cached audio file paths
-- Load and use a text compositor
local tc = TextCompositor("english_default")
tc:load()

-- Convert structured pacenote to text
local text = tc:compositeText(structuredData, 150, 200)

-- Convert distance to spoken string
local str = tc:distanceToString(350)  -- e.g., "3 50" or "350"

-- Enumerate all phrases for TTS generation
local enumerated = tc:enumerateAll()
tc:writeEnumerated("/temp/rally/phrases.json", enumerated)

See Also

  • Library Compositor - Related reference
  • Structured Pacenote Schema - Related reference
  • VisualCompositor - Pacenote Visual Icon Generation - Related reference
  • Gameplay Systems Guide - Guide

Structured Pacenote Schema

Defines the schema for structured pacenote fields - the machine-readable description format for rally corners, caution levels, modifiers, and special events. Provides field definitions with types, def

Visual Compositor

Generates visual pacenote icon data for the HUD display. Converts structured pacenote attributes (corner severity, modifiers, cautions) into icon descriptions consumed by the CEF UI layer.

On this page

ConstructorPublic APIConfig AccessorsHow It WorksSee Also