Jump to content

Help adding item from Mod to Loot Table


Nanoko

Recommended Posts

Hey all, I tried to search through the forums+ google a bit but wasn't finding any answers, or anything that was making any sense to me really. I'm trying to add an item from the They Knew Mod to the loot tables, specifically trying to add Zomboxcycline onto the loot table. From what I've seen from how other mods add items to the loot tables, and from what I read it should look something like this

 

DropsDistribution.lua

 

local function preDistributionMerge()
    ProceduralDistributions.list.TheyKnewItem = {
        rolls = 6,
        items = {
            "Zomboxycycline", 50,
            "Zomboxivir", 50,
        },
    }
end

Events.OnPreDistributionMerge.Add(preDistributionMerge);

 

DropsProcedualDistribution.lua

local DropDistTable = {
    pharmacystorage = {
        metal_shelves = {
        procedural = true,
        procList = {
            {name="TheyKnewList", min=1, max=6},
        
        }
        },    
    }
}

table.insert(Distributions, 2, customDistTable);

 

I am a totally code amateur, so any help would be appreciated.

Link to comment
Share on other sites

here:

 

local DropDistTable = {
    pharmacystorage = {
        metal_shelves = {
        procedural = true,
        procList = {
            {name="TheyKnewList", min=1, max=6},

 

You are referencing a definition called "TheyKnewList" but here:

 

    ProceduralDistributions.list.TheyKnewItem = {
        rolls = 6,
        items = {
            "Zomboxycycline", 50,
            "Zomboxivir", 50,
        },
    }
end

 

the definition is called "TheyKnewItem".

Also here:

 

table.insert(Distributions, 2, customDistTable);

 

you are trying to add "customDistTable" to the Distributions table, but here:

 

local DropDistTable = {
    pharmacystorage = {
        metal_shelves = {

 

you named the table "DropDistTable".

 

 

Also, a full guide on customizing loot can be found here: 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...