Devices (RGB Peripherals)
Manages RGB lighting on supported peripherals (e.g. keyboards, mice). Sets the BeamNG orange brand color when switching to non-drivable entities (unicycle, props, no vehicle) and resets to vehicle-dri
Manages RGB lighting on supported peripherals (e.g. keyboards, mice). Sets the BeamNG orange brand color when switching to non-drivable entities (unicycle, props, no vehicle) and resets to vehicle-driven colors otherwise.
Public API
| Function | Signature | Description |
|---|---|---|
M.onVehicleSwitched | (oldId, newId, player) | Hook: resets RGB state via Device.resetRGB(0), then applies BeamNG orange if the new vehicle is a unicycle, prop, or nothing (-1). |
Constants
| Name | Value | Description |
|---|---|---|
beamOrange | vec3(255, 102, 0) | The standard BeamNG brand color used for RGB peripherals. |
Behavior
- Requires the global
Devicebinding to exist (early-returns ifnil). - Calls
Device.setRGB(0, r, g, b)to push color to the first RGB zone. - Checks
core_vehicles.getModel(jbeam).model.Typeto identify props.
Usage Example
-- Automatically called on vehicle switch; no manual invocation needed.
-- The hook fires whenever the player enters/exits a vehicle.Coupler Camera Modifier
Adjusts orbit camera distance and target when two vehicles are coupled (e.g. truck + trailer), centering the view between them. Automatically restores original camera settings on detach or when vehicl
Dynamic Props
Replaces static forest items with interactive vehicle-based props at runtime using a pooling system. Props are spawned near the player and swapped back to forest items when out of range-enabling destr