RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Activity ManagerAudio Bank ManagerAudio Ribbon SystemBus Route ManagerCamera SystemCore Chat (IRC)Core CheckpointsCore Command HandlerCoupler Camera ModifierDevices (RGB Peripherals)Dynamic PropsEnvironmentFlowgraph ManagerForestFun StuffGame ContextGame StateGround Marker ArrowsGround MarkersHardware InfoHighscoresHotlappingInventoryJob SystemLap TimesLevelsLoad Map CommandMetricsMod ManagerMultiseatMultiseat CameraMulti SpawnOnlinePaths (Camera Paths)Quick Access (Radial Menu)Recovery PromptRemote ControllerReplayRepositoryRope Visual TestScheme Command ServerCore SnapshotCore SoundsCore TerrainTraffic SignalsTrailer RespawnVehicle Active PoolingVehicle Bridge (GE ↔ VLua Communication)Vehicle MirrorsVehicle PaintsCore VehiclesVehicle TriggersVersion UpdateWeather SystemWindows Console
Input Action FilterInput ActionsInput BindingsInput CategoriesDeprecated ActionsVehicle SwitchingVibration DebugVirtual Input

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 Extensionscoreinput

Vehicle Switching

Provides custom vehicle cycling order for the switch-next/previous-vehicle input actions. Falls back to default engine behavior when no custom order is set.

Provides custom vehicle cycling order for the switch-next/previous-vehicle input actions. Falls back to default engine behavior when no custom order is set.


Public API

FunctionSignatureDescription
M.switchCycleVehicle(player?, dir)Switches to the next (dir=1) or previous (dir=-1) vehicle for the given player (default 0). Uses custom order if set, otherwise uses be:enterNextVehicle.
M.setVehicleOrder(order)Sets a custom vehicle cycling order. order is an array of vehicle IDs. Pass nil to revert to default behavior.

Behavior

  1. If vehicleOrder is set and non-empty:
    • Finds the current vehicle's index in the order array.
    • Wraps the index forward/backward by dir.
    • Enters the vehicle at the new index via be:enterVehicle.
    • Fires extensions.hook('trackNewVeh').
  2. If custom order fails (vehicle not found, player not in list):
    • Logs an error and clears the custom order.
    • Falls back to be:enterNextVehicle(player, dir).

Usage Example

-- Set a custom vehicle rotation for a scenario
local vehIds = {veh1:getId(), veh2:getId(), veh3:getId()}
core_input_vehicleSwitching.setVehicleOrder(vehIds)

-- Switch to next vehicle
core_input_vehicleSwitching.switchCycleVehicle(0, 1)

-- Switch to previous
core_input_vehicleSwitching.switchCycleVehicle(0, -1)

-- Clear custom order
core_input_vehicleSwitching.setVehicleOrder(nil)

Key Details

  • Used by scenarios and missions to restrict which vehicles the player can cycle through.
  • lastIndex tracks the most recent index for edge-case fallback.
  • Vehicle existence is verified via scenetree.findObjectById before switching.

See Also

  • Input Action Filter - Related reference
  • Input Actions - Related reference
  • Input Bindings - Related reference
  • Core Systems Guide - Guide

Deprecated Actions

Static lookup table mapping deprecated input action names to their replacements or marking them as obsolete. Used by `core_input_actions.upgradeAction()` during binding loading.

Vibration Debug

ImGui debug window for tuning force-feedback vibration parameters on the player vehicle. Adjusts wheel-slip and jerk force multipliers/minimums sent to the vehicle's `hydros` system.

On this page

Public APIBehaviorUsage ExampleKey DetailsSee Also