RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

server/commands - Camera & Input Commandsge_utils - Game Engine Utility Functionsmain.lua - GE Lua Entry Point & Game Loopmap.lua - Navigation Graph (AI Road Map)screenshot.lua - Screenshot Systemserver/server - Level Loading & Game ServerserverConnection - Client-Server Connection Manager`setSpawnpoint` - Default Spawn Point Persistence`simTimeAuthority` - Simulation Time & Bullet Time Control`spawn` - Vehicle Spawning & Safe Placement`suspensionFrequencyTester` - Suspension Natural Frequency Analysis
Career BranchesCareer System CoreCareer Save System
Career Computer MenuCareer Fuel SystemInspect VehicleVehicle InventoryLinear TutorialLoaner VehiclesCareer LogLogbookMarketplaceMission WrapperCareer Painting ModuleCareer Part Inventory ModuleCareer Part Shopping ModuleCareer Payment ModuleCareer Permissions ModuleCareer Playbook Writer ModuleCareer Player Abstract ModuleCareer Player Attributes ModuleCareer Player Driving ModuleCareer Quick Travel ModuleCareer Rentals ModuleCareer Reputation ModuleCareer Spawn Points ModuleCareer Speed Traps ModuleCareer Test Drive ModuleCareer Tether ModuleCareer Tuning ModuleCareer UI Utils ModuleCareer Unlock Flags ModuleCareer Value Calculator ModuleVehicle Class GroupingVehicle Deletion ServiceVehicle PerformanceVehicle Shopping

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 Extensionscareermodules

Marketplace

Player-to-NPC vehicle marketplace. Handles listing vehicles for sale, generating timed buyer offers, price negotiation with personality-driven AI opponents (private individuals and dealerships), and o

Player-to-NPC vehicle marketplace. Handles listing vehicles for sale, generating timed buyer offers, price negotiation with personality-driven AI opponents (private individuals and dealerships), and offer lifecycle.


Internal State

FieldTypeDescription
M.firstNameCountvariesAssigned as #M.firstNames
M.initialCountvariesAssigned as #M.initials
M.initialProbabilitiestableLetter → probability mapping for weighted last-name initials

Public API - Listings

FunctionSignatureDescription
M.listVehicles(vehicles)List vehicles for sale [{inventoryId, value}]
M.removeVehicleListing(inventoryId)Remove a vehicle listing
M.findVehicleListing(inventoryId) → listing/nilFind listing by inventory ID
M.getListings() → tableGet all listings with disable states
M.openMenu(computerId)Open marketplace via vehicle shopping
M.menuOpened(open)Notify menu open/close state

Public API - Offers

FunctionSignatureDescription
M.generateOffer(inventoryId) → offerGenerate a buyer offer for a listing
M.acceptOffer(inventoryId, offerIndex)Accept and sell at offer price
M.declineOffer(inventoryId, offerIndex)Remove an offer

Public API - Negotiation

FunctionSignatureDescription
M.startNegotiateBuyingOffer(inventoryId, offerIndex)Start negotiation when selling to buyer
M.startNegotiateSellingOffer(shopId)Start negotiation when buying from seller
M.getNegotiationState() → tableCurrent negotiation state for UI
M.makeNegotiationOffer(price) → boolSubmit a counter-offer
M.takeTheirOffer()Accept opponent's current offer
M.cancelNegotiation()Walk away from negotiation
M.generatePersonality(buyer, archetypes) → tableGenerate NPC personality

Hook Handlers

HookPurpose
M.onUpdateGenerate new offers periodically, debug UI
M.onVehicleRemovedRemove listing for deleted vehicle
M.onSaveCurrentSaveSlotPersist listings
M.onExtensionLoadedLoad listings from save

Offer Generation

  • New offers generated every ~95s per listing (±60% random)
  • Price influenced by: marketRatio, buyer personality priceMultiplier, noise function
  • Offers expire after ~500s (±50% variance)
  • If listed price < 90% market: offers capped near listed price
  • If listed price > 110% market: offers capped near market value
  • offerTimeMultiplier adjusts generation speed based on pricing

Negotiation System

Two modes: selling (player lists, buyer offers) and buying (player at dealership).

Personality Properties

PropertyDescription
counterOfferReadinessWillingness to counter-offer
priceMultiplierStarting price bias
delayRangeThinking time range
isDealershipDealer vs private individual
desperationChance of going below market (dealers)
insultThresholdBaseLowball rejection threshold
startingPatienceInitial patience (0–1)

Negotiation Statuses

initial → thinking → typing → counterOffer / accepted / refused / failed / counterOfferLastChance


Data Tables

  • M.firstNames - 500+ first names for NPC generation
  • M.initials - Weighted last-name initials
  • M.privateSellerQuotes - 50 quotes for private sellers
  • M.dealershipBuyerQuotes - 25 quotes for dealership buyers

See Also

  • inventory - Vehicle data and selling
  • vehicleShopping - Purchase flow integration

Logbook

M.dependencies = {'career_career'}

Mission Wrapper

M.dependencies = {'career_career'}

On this page

Internal StatePublic API - ListingsPublic API - OffersPublic API - NegotiationHook HandlersOffer GenerationNegotiation SystemPersonality PropertiesNegotiation StatusesData TablesSee Also