Configuration

Current configuration reference for Oxide Vending.

General

config/config.lua

Config.Debug = false
  • Enables verbose server and client debug logging.

Business

Config.Business = {
    MaxMachinesPerBusiness = 10,
    MaxEmployees = 5,
    RegistrationFee = 5000,
    AllowMultipleBusinesses = false,
    OnePerAccount = false,
    DefaultMachineCapacity = 400,
    MaxBusinesses = 0,
}
  • MaxMachinesPerBusiness: fallback cap used only when progression is disabled.
  • MaxEmployees: fallback employee cap used only when progression is disabled.
  • RegistrationFee: one-time business registration cost.
  • AllowMultipleBusinesses: allows multiple businesses per character identifier.
  • OnePerAccount: restricts ownership across characters that share the same license or account.
  • DefaultMachineCapacity: fallback capacity if a machine type cannot be resolved.
  • MaxBusinesses: server-wide cap. 0 means unlimited.

Permissions

Config.Permissions = {
    owner = { "manage", "stock", "collect", "place", "remove", "hire", "fire", "pricing", "withdraw", "deposit", "view_balance" },
    manage = { "stock", "collect", "place", "remove", "pricing", "deposit", "view_balance" },
    collect = { "collect", "view_balance" },
    stock = { "stock" },
}

These are the default employee role maps used by the resource.

Placement

Config.Placement = {
    MaxDistanceFromPlayer = 10.0,
    MinDistanceBetweenMachines = 2.0,
    FollowOffset = 1.2,
    RotationSensitivity = 5.0,
}
  • MaxDistanceFromPlayer: final placement must be within this range of the player.
  • MinDistanceBetweenMachines: spacing check between placed machines.
  • FollowOffset: how far in front of the player the preview object follows during positioning.
  • RotationSensitivity: mouse-driven rotation speed during the rotation stage.

Blocked Zones

Config.BlockedZones = {
    -- { name = "police_station", coords = vector3(x, y, z), radius = 50.0 }
}

Add simple radius-based no-place zones here.

Pricing

Config.Pricing = {
    MinMarkup = 0.8,
    MaxMarkup = 3.0,
    DefaultMarkup = 1.5,
}

These are fallback values. When progression is enabled, active level rewards override the effective min and max pricing range.

Wholesale

Config.Wholesale = {
    Enabled = true,
    MarkupPercent = 0.20,
    DeliveryTime = 300,
    MinOrder = 10,
    DeliveryCheckInterval = 30,
}
  • MarkupPercent: wholesale price markup before progression discounts.
  • DeliveryTime: delivery delay in seconds.
  • MinOrder: default minimum quantity for catalog items that do not override it.
  • DeliveryCheckInterval: how often pending deliveries are processed.

config/wholesale.lua

Config.WholesaleCatalog defines the actual wholesale item list grouped by machine type. Each entry uses:

{ item = "water_bottle", label = "Water Bottle", basePrice = 5, minQty = 10 }

Each item must exist in your active inventory setup and item registry.

Warehouse

Config.Warehouse = {
    Enabled = true,
    Price = 50000,
    MaxCapacity = 5000,
    MaxItemTypes = 50,
    RequiredLevel = 3,
    CodeLength = 4,
    DoorLocation = vector4(-128.68, -1393.47, 28.59, 208.25),
    Interior = {
        Exit = vector4(1087.57, -3099.38, -39.0, 264.61),
        Storage = vector4(1100.98, -3101.89, -39.0, 183.82),
    },
    BucketIdStart = 1000,
}
  • Enabled: master toggle for the warehouse feature.
  • Price: amount removed from the business balance when purchasing.
  • MaxCapacity: total item count limit across all stored items.
  • MaxItemTypes: distinct item-name cap.
  • RequiredLevel: minimum business level when progression is enabled.
  • CodeLength: keypad code length.
  • DoorLocation: exterior access point.
  • Interior.Exit: teleport target when entering the warehouse.
  • Interior.Storage: storage interaction point inside the warehouse.
  • BucketIdStart: starting routing bucket range for warehouse instances.

Pickup Pallet

Config.PickupLocation = {
    Enabled = true,
    Coords = vector4(-128.35, -1416.47, 30.3, 114.55),
    PalletModel = "bkr_prop_coke_pallet_01a",
    BoxModel = "prop_cs_cardbox_01",
    MaxBoxes = 12,
    PickupTime = 3000,
    PickupAnimation = {
        dict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@",
        anim = "machinic_loop_mechandplayer",
        flags = 1,
    },
}
  • MaxBoxes: visual and logical cap before positions are recycled.
  • PickupTime: progress bar time in milliseconds.
  • PickupAnimation: animation used while collecting a box.

Transaction Pruning

Config.Transactions = {
    RetentionDays = 90,
    PruneInterval = 3600,
    PruneOnStartup = true,
}
  • RetentionDays = 0 keeps transaction rows forever.

Showroom

Config.Showroom = {
    Enabled = true,
    Location = vector3(-132.5, -1418.28, 31.3),
    Heading = 208.38,
    Blip = {
        enabled = true,
        sprite = 478,
        color = 2,
        scale = 0.7,
        label = "Vending Machines",
    },
    NPC = {
        model = "s_m_m_lifeinvad_01",
        scenario = "WORLD_HUMAN_CLIPBOARD",
    },
}

Controls the showroom NPC and optional blip.

Notifications and Interaction

Config.Notifications = {
    Position = "top-right",
    Duration = 5000,
}

Config.Interaction = {
    TargetDistance = 2.5,
    UseProgressbar = true,
    StockingTime = 3000,
    CollectTime = 2000,
}
  • TargetDistance: target interaction range for showroom, machines, and pickup entities.
  • UseProgressbar: whether interaction flows should use the configured progress UI path.
  • StockingTime and CollectTime: action durations in milliseconds.

Durability

Config.Durability = {
    Enabled = true,
    DegradationPerSale = 0.5,
    DegradationPerNPCSale = 0.3,
    BrokenThreshold = 0,
    WarningThreshold = 20,
    RepairCosts = {
        drinks = 500,
        snacks = 400,
        general = 750,
        electronics = 1500,
    },
    DefaultRepairCost = 500,
    AllowCollectWhenBroken = true,
    DegradationVariance = 0.2,
}
  • WarningThreshold: owner warning point in percent.
  • AllowCollectWhenBroken: broken machines can still be collected from when true.
  • DegradationVariance: random variation applied to wear.

Machine Definitions

config/machines.lua

Config.MachineTypes controls machine labels, prices, slots, capacities, icons, and prop-model choices.

Current defaults:

TypePriceSlotsCapacityModels
drinks150008505
snacks120006402
general2000012301
electronics350006201

To add a new machine type:

  1. Add a new entry to Config.MachineTypes.
  2. Add a matching item whitelist in Config.ItemWhitelists.
  3. Add base prices for its sellable items in Config.ItemBasePrices.
  4. If progression is enabled, add the type to one or more level reward unlockedTypes.

Items

config/items.lua

Config.ItemWhitelists controls which item names each machine type can stock.

Config.ItemBasePrices controls the baseline price used for:

  • Default machine pricing
  • Price validation
  • Competition suggestions
  • NPC sale weighting

Every configured item must exist in the inventory system exposed through o-link.inventory.

Helper Behavior

GetItemBasePrice(itemName) falls back to 10 if the item is missing from Config.ItemBasePrices.

IsItemAllowedInMachine(machineType, itemName) is the whitelist gate used by the stock system.

NPC Sales

config/npc_sales.lua

Config.NPCSales = {
    Enabled = true,
    TickInterval = 60,
    BaseChancePerTick = 0.05,
    MinQuantity = 1,
    MaxQuantity = 2,
    AvoidLastItem = true,
    PreferCheaperItems = true,
    RevenueMultiplier = 1.0,
    MachineTypeModifiers = { ... },
    TimeMultipliers = { ... },
    Hotzones = { ... },
    DefaultLocationMultiplier = 1.0,
    VisualFeedback = {
        Enabled = true,
        PlayerRange = 50.0,
        PedSearchRadius = 30.0,
        MachineCooldown = 30000,
    },
}

Important values:

  • TickInterval: simulation interval in seconds.
  • AvoidLastItem: NPCs avoid buying the final remaining item.
  • RevenueMultiplier: global balancing multiplier after item price calculation.
  • VisualFeedback: cosmetic ambient-ped animation settings only.

Competition

Config.Competition = {
    Enabled = true,
    Radius = 500.0,
    SameOwnerCompetes = false,
    MinMultiplier = 0.3,
    MaxMultiplier = 1.8,
    CheapestBonus = 1.5,
    SuggestedPriceMargin = 0.95,
    SuggestedPriceMinMarkup = 0.85,
    AnalysisCacheTime = 300,
    ShowCompetitorNames = true,
    ShowExactPrices = true,
}
  • Radius: search range for nearby same-type machine competition.
  • AnalysisCacheTime: cache lifetime for dashboard competition analysis in seconds.
  • ShowCompetitorNames and ShowExactPrices: analytics display options.

Progression

config/progression.lua

Config.Progression = {
    Enabled = true,
    Levels = { ... },
    XPSources = { ... },
    Milestones = { ... },
    Notifications = {
        showXPGain = true,
        xpGainThreshold = 25,
        levelUpSound = true,
        levelUpAnimation = true,
        milestoneNotify = true,
    },
}

Progression controls:

  • Machine caps
  • Employee caps
  • Machine type unlocks
  • Pricing range overrides
  • Wholesale discounts
  • NPC revenue boosts

See Progression for the full level table.