Market

The fishing market system allows players to sell their caught fish at dynamic prices that respond to supply and demand.

General Configuration

enabled = true
enabledrequiredboolean
true
Allows you to enable or disable the entire fishing market system. When set to false, the merchant NPC won't spawn, and players won't be able to sell fish through the market system.

Merchant Configuration

The merchant section defines the NPC who handles fish sales:

merchant = {
    model = 'a_m_m_farmer_01',

    coords = vec4(-1816.89, -1193.83, 13.3, 325.13),
    scenario = 'WORLD_HUMAN_CLIPBOARD',
    
    blip = {
        enabled = true,
        sprite = 68,
        display = 4,
        scale = 0.7,
        colour = 3,
        label = 'Fish Market'
    }
}
merchant.modelrequiredstring
'a_m_m_farmer_01'
The model name of the NPC merchant who buys fish.
merchant.coordsrequiredvec4
The coordinates where the merchant will spawn (x, y, z, heading).
merchant.scenariorequiredstring
'WORLD_HUMAN_CLIPBOARD'
The animation scenario the merchant will use.

Merchant Blip Configuration

The merchant.blip section controls how the merchant appears on the map:

blip = {
    enabled = true,
    sprite = 68,
    display = 4,
    scale = 0.7,
    colour = 3,
    label = 'Fish Market'
}
merchant.blip.enabledrequiredboolean
true
Whether to show the merchant's location on the map.
merchant.blip.spriterequirednumber
68
The blip sprite ID to use on the map.
merchant.blip.displayrequirednumber
4
The blip display mode on the map.
merchant.blip.scalerequirednumber
0.7
The size of the blip on the map.
merchant.blip.colourrequirednumber
3
The blip color ID to use on the map.
merchant.blip.labelrequiredstring
'Fish Market'
The text label shown on the map for the merchant.

Currency Configuration

currency = 'money'
currencyrequiredstring
'money'
The inventory item name that will be given when fish are sold.

Stock Configuration

The stocks section defines how the market's fish stock levels work:

stocks = {
    initial = 100,

    minimum = 0,
    maximum = 500,

    targetLevel = 250,
    
    recoveryRate = {
        min = 1,
        max = 3
    }
}
stocks.initialrequirednumber
100
Initial stock level for all fish types when the server starts.
stocks.minimumrequirednumber
0
Minimum possible stock level for any fish type.
stocks.maximumrequirednumber
500
Maximum possible stock level for any fish type.
stocks.targetLevelrequirednumber
250
Target stock level that the system will gradually restore to.

Stock Recovery Rate

recoveryRate = {
    min = 1,
    max = 3
}
stocks.recoveryRate.minrequirednumber
1
Minimum percentage of stock difference recovered per update cycle.
stocks.recoveryRate.maxrequirednumber
3
Maximum percentage of stock difference recovered per update cycle.

Price Configuration

The prices section controls how fish prices are affected by sales:

prices = {
    salesImpact = {
        divisor = 20,
        maxEffect = 0.7
    },
    
    salesRecovery = 3
}
prices.salesImpact.divisorrequirednumber
20
Divisor that determines how much sales volume affects prices. Higher values mean less impact.
prices.salesImpact.maxEffectrequirednumber
0.7
Maximum effect that sales volume can have on price calculations (0.0-1.0).
prices.salesRecoveryrequirednumber
3
How much the sales history is reduced per update cycle.

Update Configuration

updateInterval = 1
updateIntervalrequirednumber
1
Time interval in minutes between market updates. Controls how often prices and stocks are recalculated.

How the Market Works

Price Calculation

The market uses a formula that takes into account stock levels and recent sales:

stockRatio = (stock.current - stock.min) / (stock.max - stock.min)
salesImpact = math.min(salesVolume / salesImpact.divisor, salesImpact.maxEffect)
finalRatio = math.min(stockRatio + salesImpact, 1.0)
calculatedPrice = price.max - (priceRange * finalRatio)

Supply and Demand

  • Higher stock levels result in lower prices
  • Lower stock levels result in higher prices
  • Stock gradually returns to targetLevel over time
  • Demand is calculated based on current stock levels

Sales Impact

  • Recent sales temporarily lower prices
  • Selling large quantities (>50) triggers additional price reductions
  • Fish with narrow price ranges get special temporary reductions
  • Sales impact gradually diminishes according to salesRecovery setting
  • The system tracks price movement (up, down, or stable)
  • Trend information is displayed in the market menu