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 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

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 file doesn't exist.


Constructor

local MissionSettings = require('gameplay/rally/notebook/missionSettings')
local settings = MissionSettings(missionDir)

Public API

MethodSignatureReturnsDescription
init(missionDir)nilStores mission directory
fname()stringReturns settings file path
load(notebook?)booleanLoads settings from JSON; creates defaults if missing; validates codriver
loadNotebook()object|nilLoads the selected notebook file
loadRacePath()object|nilLoads race.race.json for the mission
write()nilPersists current settings to JSON
setNotebookFilename(filename)nilSets notebook filename and saves
getNotebookFilename()stringReturns current notebook filename
getNotebookFullPath()stringReturns full path to notebook file
setCodriverId(codriverId)nilSets active codriver by pk and saves
getCodriverId()stringReturns active codriver pk
getCodriverPk()stringAlias for getCodriverId
onSerialize()tableReturns serializable settings
onDeserialized(data)nilRestores settings from data

Internals

Default Settings

{
  notebook = {
    filename = rallyUtil.defaultNotebookFname,
    codriverId = nil
  }
}

File Path

Settings are stored at {missionDir}/rally/settings.json (via rallyUtil.getMissionSettingsFile).

Load Flow

  1. If settings file doesn't exist → create with defaults and write
  2. Read JSON file
  3. Validate notebook filename:
    • If missing or file not found → use first existing notebook, or default
  4. Validate codriver ID (if notebook passed):
    • If codriver pk not found in notebook → use first codriver
  5. Re-read file after any corrections
  6. Clear legacy codriver field
  7. Deserialize into object state

Notebook Discovery

listNotebooks(folder) scans {missionDir}/rally/notebooks/ for *.notebook.json files and returns sorted paths.


How It Works

  1. Created by notebook.path or rallyManager with a mission directory
  2. load(notebook) reads or creates the settings file, validates selections
  3. The notebook and codriver selections determine which pacenotes and audio are used
  4. Changes via setNotebookFilename or setCodriverId immediately persist to disk
  5. Multiple re-reads during load ensure consistency after auto-corrections

Usage Example

local MissionSettings = require('gameplay/rally/notebook/missionSettings')
local settings = MissionSettings('/path/to/mission')

-- Load and validate
settings:load(notebook)

-- Get current notebook
local nbFilename = settings:getNotebookFilename()
local nb = settings:loadNotebook()

-- Switch codriver
settings:setCodriverId(codriver.pk)

See Also

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

Rally Codriver

Class representing a rally co-driver within a notebook. Each codriver has a name, language, voice setting, and unique persistent key (pk). Codrivers determine which language and voice are used for pac

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

On this page

ConstructorPublic APIInternalsDefault SettingsFile PathLoad FlowNotebook DiscoveryHow It WorksUsage ExampleSee Also