Don't Starve Together
Mining Machine [DST] [Discontinued]
ZupaleX  [ผู้พัฒนา] 25 มี.ค. 2016 @ 8: 04pm
Adding turfs / Editing the loot table
It is fairly easy to modify the loot table of the machine to override the current one for all or just specific biomes, or even add loot to customs turfs.

All you need to do is create a file named "modmmloottable.lua" in [your_mod_folder]/scripts

This lua file should contains the following :



MODMMLOOTTABLE = {} -- declare the modified loottable

MODMMLOOTTABLE["BIOME_".."the number associated to the turf"] = {
TIERONE = -- the tier 1 items loot
{
tierthreshold = 0.7, -- example: here it means 70% of digging a tier 1 item
rocks = 0.33, -- example: 33% to dig rocks if tier 1 is picked
flint = 0.67, -- example: 67-33 = 34% to dig flint if tier 1 is picked
nitre = 1, -- example: 100-67 = 33% to dig nitre if tier 1 is picked
},

TIERTWO = -- the tier 2 items loot
{
tierthreshold = 0.91, -- example: 91-70 = 21% chance to dig item of tier 2
mnzironore = 0.38, -- see tier 1 for explanation
goldnugget = 0.67, -- see tier 1 for explanation
redgem = 0.84, -- see tier 1 for explanation
bluegem = 1, -- see tier 1 for explanation
},

TIERTHREE = -- the tier 3 items loot
{
tierthreshold = 1, -- example: 100-91 = 9% to dig an item of tier 3
marble = 0.67, -- see tier 1 for explanation
moonrocknugget = 1, -- see tier 1 for explanation
},

CHESTMOBS = -- mobs that can pop from your chest after a digging was performed
{
bat = 0.33, --example: 33% to get a bat if a mob was dug out
slurtle = 0.67, --example: 67-33 = 34% to get a slurtke if a mob was dug out
snurtle = 1, --example: 100-67 = 33% to get a snurtle if a mob was dug out
},

ESCAPEMOBS = -- mobs that can escape from the hole
{
rocky = 1, -- same principle than above
}
}






Now in your modmain.lua, just put

require("modmmloottable")
GLOBAL.USERLOOTTABLE = GLOBAL.MODMMLOOTTABLE




Please leave any questions here
แก้ไขล่าสุดโดย ZupaleX; 25 มี.ค. 2016 @ 8: 05pm
< >
กำลังแสดง 1-2 จาก 2 ความเห็น
Hi

I Love this MOD.

I'm really interested in make some changes in my Server Mining Machine

Basically
I want a unique LOOTTABLE for all the biomes, the same loot no cares where you put the machine.

How to declare that?

Think that I understand and can program the loot list, but not understand exactly this:

MODMMLOOTTABLE = {} -- declare the modified loottable

MODMMLOOTTABLE["BIOME_".."the number associated to the turf"]


Thanks in advanced.
ZupaleX  [ผู้พัฒนา] 13 พ.ค. 2016 @ 4: 35pm 
Hi,
well basically I made this for other modders, if you want to modify it without the support of another mod, you can just modify directly the mmloottable.lua for the mining machine mod folder.

Be aware that it would be overwrittent each time the mod is updated. So keep a copy of your modified loot table somewhere safe and you'll just have to paste it back after an update.

Hope this answer your question. If not feel free to tell me, I'll try to be more specific.
< >
กำลังแสดง 1-2 จาก 2 ความเห็น
ต่อหน้า: 1530 50