Jump to content

Where are the Loot .lua files?


Recommended Posts

The loot a monster drops is usually defined on its prefab file.

Example: warg.lua

SetSharedLootTable('warg',
{
    {'monstermeat',             1.00},
    {'monstermeat',             1.00},
    {'monstermeat',             1.00},
    {'monstermeat',             1.00},
    {'monstermeat',             0.50},
    {'monstermeat',             0.50},
    
    {'houndstooth',             1.00},
    {'houndstooth',             0.66},
    {'houndstooth',             0.33},
})

inst.components.lootdropper:SetChanceLootTable('warg')

Each item has a probability to drop between 0 to 1.

You can see you have a guaranteed 4 monster meat and 1 houndstooth.

Example: deerclops.lua

local loot = {"meat", "meat", "meat", "meat", "meat", "meat", "meat", "meat", "deerclops_eyeball"}

inst.components.lootdropper:SetLoot(loot)

Each item here has a probability of 1 to drop.

You get 8 meat and 1 deerclops_eyeball.

1 hour ago, DarkXero said:

The loot a monster drops is usually defined on its prefab file.

Example: warg.lua


SetSharedLootTable('warg',
{
    {'monstermeat',             1.00},
    {'monstermeat',             1.00},
    {'monstermeat',             1.00},
    {'monstermeat',             1.00},
    {'monstermeat',             0.50},
    {'monstermeat',             0.50},
    
    {'houndstooth',             1.00},
    {'houndstooth',             0.66},
    {'houndstooth',             0.33},
})

inst.components.lootdropper:SetChanceLootTable('warg')

Each item has a probability to drop between 0 to 1.

You can see you have a guaranteed 4 monster meat and 1 houndstooth.

Example: deerclops.lua


local loot = {"meat", "meat", "meat", "meat", "meat", "meat", "meat", "meat", "deerclops_eyeball"}

inst.components.lootdropper:SetLoot(loot)

Each item here has a probability of 1 to drop.

You get 8 meat and 1 deerclops_eyeball.

Thank you, I looked in every single folder but the prefabs, I though they were like the brain folder but for items

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...