Adding items & traders
A new item
Section titled “A new item”Items live in bs_inventory/config/config_items.lua, in Items.Definitions. On start they are synced into bs_item_definitions, so you only edit the file.
my_tin = { label = 'Tinned Peaches', category = 'food', weight = 0.4, w = 1, h = 1, stack = 5, usable = true, value = 14, data = { hunger = 25, thirst = 5 } },w/his the grid size,stackthe max per slot,valuethe catalogue value traders are balanced around.datadepends on the category:heal,hunger,thirstfor consumables,weapon = 'WEAPON_X'for weapons,handled = truewhen another resource consumes it.- Icons come from
bs_ui/html/js/icons.js. No icon means a generic one, it still works. - Want it translated? The label can get a key in
bs_inventory/locales/<lang>.lua, see Languages.
Restart bs_inventory when it’s quiet (people’s inventories reload). More detail on the Inventory page and for code in Items & inventory.
To test it, give it to yourself from F10 > ITEMS, or from code:
exports.bs_inventory:GiveItem(src, 'my_tin', 3)A recipe
Section titled “A recipe”Recipes sit in the same file. A recipe with factionBase = true only crafts inside your faction’s flag radius.
Putting it on a trader
Section titled “Putting it on a trader”Traders are in bs_traders/config/config_traders.lua, Traders.Traders. Each one is placed relative to a safe zone:
trader_sandy = { label = 'Camp Trader', role = 'trader', clothing = true, zone = 'sandy_camp', offset = vector3(-6.0, 4.0, 0.0), heading = 30.0, model = 'a_m_m_farmer_01', scenario = 'WORLD_HUMAN_STAND_IMPATIENT', buys = { { item = 'scrap_metal', price = 3 } }, sells = { { item = 'my_tin', price = 20, stock = 30 } },},buysis what the trader pays players,sellswhat players can buy,stocklimits it.- The shipped file keeps sells at about 1.4 to 1.5x the item
valueand buys under it. Stick to that or the economy breaks fast. role = 'quest'withmissions = { ... }makes a job giver, missions are inTraders.Missions.Global.traderPriceMultiplierin F1 scales all buy prices.
Restart bs_traders to apply. If you changed a safe zone the map page on the website is drawn by hand from these files, so it won’t follow on its own.
bs19.org · Privacy · Terms · Cookie settings
Cookies and outside content
The site only needs two essential cookies to keep you logged in and protect forms. Videos and streams from YouTube and Twitch load from their servers, which can set their own cookies, so they stay off until you say yes. Nothing is pre-ticked and you can change your mind any time with "Cookie settings" at the bottom of every page. Details.
Questions about the server, the framework or the site? A real person reads this, usually within a day.