RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Ambient SoundUI Apps ManagerUI AudioBindings LegendCamera Distance AppDeveloper ConsoleCredits MusicExternal WebSocket ServerFade ScreenGame BlurGameplay App ContainersGrid SelectorLivery EditorMessages DebuggerMessages/Tasks App ContainersMission InfoPolice InfoTop BarUI ModsNavigation Map DataVehicle Paint EditorVehicle Vicinity AppUI Visibility
Details InteractionVehicle SelectorTile ClusteringTile GroupingTilesTile SortingVehicle OperationsVehicle Specifications

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 ExtensionsuivehicleSelector

Tile Clustering

Groups vehicle configurations into clustered tiles by brand/model or model key.

Groups vehicle configurations into clustered tiles by brand/model or model key.


Overview

ui_vehicleSelector_tileClustering handles clustering individual vehicle configs into visual tiles for the vehicle selector grid. Supports two modes: brandSubModelOrModel (groups by brand + submodel) and model (groups by model key). Also computes favourite/recent stats and source icons for each cluster.

Extension path: lua/ge/extensions/ui/vehicleSelector/tileClustering.lua


Exports (M)

FunctionSignatureDescription
clusterItems(configs, clusterMode) → tableGroups configs into clusters keyed by cluster label.
createTileFromClusteredItems(clusteredItems, group, clusterMode) → tileCreates a UI tile from a cluster.
getClusterModeFunction(clusterMode) → fnReturns the clustering key function.
getClusteredItemsFavouriteIconPercent(clusteredItems) → ...Returns favourite/recent stats for a cluster.
getClusteredItemsStats(clusteredItems, sortMode) → preview, model, config, lastReturns preview image and representative config.
getSources(config, model, onlyIcons) → string[]Returns source labels/icons for a config.

Internals

Cluster Modes

ModeKey Function
brandSubModelOrModelBrand + " " + SubModel (falls back to model key)
modelconfig.model_key

clusterItems

Returns { [clusterLabel] = { configsByKey, count, list, years, value } }.

Tile Creation

Both createTileFromBrandSubModelOrModel and createTileFromModel produce tiles with:

  • key, name, preview, subElementCount
  • favouriteIdx, recentIdx, showFavouriteIconPercent
  • gotoPath - navigation path for drilling into configs
  • doubleClickDetails - model/config for double-click action
  • Performance stats: Value, Weight, Top Speed, Power, 0-60 mph, etc.
  • sourceIcons - array of {icon} or {svg} objects
  • isAuxiliary - true only if all configs in cluster are auxiliary

Source Icons

getSources returns icons based on:

  • BeamNG - Official → "beamNG"
  • Custom → "wrench"
  • Automation type → SVG path
  • Has modID → "puzzleModule"
  • Missing JBeam → "danger"

How It Works

  1. clusterItems groups configs by the chosen mode function.
  2. For each cluster, createTileFromClusteredItems builds a tile with preview, stats, and source icons.
  3. The tile's gotoPath allows the UI to navigate into the cluster's configs.
  4. Favourite/recent stats determine star icons and sorting priority.

Lua Examples

local tileClustering = require('/lua/ge/extensions/ui/vehicleSelector/tileClustering')

-- Cluster configs by brand+submodel
local clusters = tileClustering.clusterItems(configList, "brandSubModelOrModel")

-- Create a tile from a cluster
for label, cluster in pairs(clusters) do
  local tile = tileClustering.createTileFromClusteredItems(cluster, group, "brandSubModelOrModel")
end

Additional Exports

The following exports are available but not yet documented in detail:

  • M.clusterItems
  • M.createTileFromClusteredItems
  • M.getClusterModeFunction
  • M.getClusteredItemsFavouriteIconPercent
  • M.getClusteredItemsStats
  • M.getSources

See Also

  • Vehicle Selector – Details Interaction - Related reference
  • Vehicle Selector – General - Related reference
  • Vehicle Selector – Tile Grouping - Related reference
  • UI System Guide - Guide

Vehicle Selector

Central hub for the vehicle selector: data initialization, filtering, display settings, favourites, and opening modes.

Tile Grouping

Assigns vehicle configs to display groups (Type, Brand, Country, Value, Years, etc.).

On this page

OverviewExports (M)InternalsCluster ModesclusterItemsTile CreationSource IconsHow It WorksLua ExamplesAdditional ExportsSee Also