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

Career Unlock Flags Module

M.dependencies = {"career_saveSystem"}

Dependencies

M.dependencies = {"career_saveSystem"}

Boolean flag system for tracking unlockable career features. Flags are defined by other modules via the onGetUnlockFlagDefinitions hook and cached on first access. Supports lazy evaluation through unlockedFunction.


Public API

FunctionSignatureDescription
M.getFlag(flagName) → boolReturns flag value; lazily evaluates unlockedFunction on first access
M.getFlagDefinition(flagName) → table/nilReturns the full flag definition
M.setFlag(flagName, value)Manually sets a flag value in cache
M.resetFlags()Clears the entire flag cache

Lifecycle Hooks

HookPurpose
M.onCareerActivatedResets cache and reloads flag definitions
M.onSaveCurrentSaveSlot(Stub - persistence code commented out)

Dependencies

  • career_saveSystem (required) - save slot access

Flag Definition Format

Other modules register flags via onGetUnlockFlagDefinitions(flagDefinitions):

-- Example hook handler (not part of this extension):
local function onGetUnlockFlagDefinitions(flagDefinitions)
  flagDefinitions["myFeatureUnlocked"] = {
    unlockedFunction = function()
      return career_branches.getBranchLevel("motorsport") >= 2
    end,
    icon  = "trophy",
    level = 2,
    label = "Reach Motorsport Level 2",
  }
end

Locked Reason Format

getFlagLockedReason(flagName) returns:

{
  type  = "locked",
  icon  = "trophy",
  level = 2,
  label = "Reach Motorsport Level 2",
}

Caching Behavior

  • Flags are lazily cached: unlockedFunction() runs only on first getFlag() call
  • Cache persists until resetFlags() or onCareerActivated
  • setFlag() overrides the cached value without calling unlockedFunction

Hooks Emitted

HookData
onGetUnlockFlagDefinitions(flagDefinitions) - modules insert their flag defs
onUnlockFlagChanged(flagName, value) - when setFlag is called

Usage Example

-- Check if a feature is unlocked
if career_modules_unlockFlags.getFlag("cargoLogisticsMaterials") then
  -- enable materials transport
end

See Also

  • permissions - Runtime permission checks (different from persistent flags)
  • playerAttributes - Attribute-based progression

Career UI Utils Module

M.dependencies = {"career_career"}

Career Value Calculator Module

M.dependencies = {'career_career'}

On this page

DependenciesPublic APILifecycle HooksDependenciesFlag Definition FormatLocked Reason FormatCaching BehaviorHooks EmittedUsage ExampleSee Also