Search the Community
Showing results for tags 'marble'.
-
Here is the code I edited and wrote for changing marble shrub loot tables, but it doesn't work. I can't spot anything wrong with it, and neither could a programmer I talked to, so I thought I'd ask here (the code is place within modmain.lua): local statedataW = { { -- short idleanim = "idle_short", hitanim = "hit_short", breakanim = "mined_short", growanim = "grow_tall_to_short", growsound = "dontstarve/common/together/marble_shrub/wilt_to_grow", workleft = TUNING.MARBLESHRUB_MINE_SMALL, loot = function() return {"marble", "marblebean"} end, }, { -- normal idleanim = "idle_normal", hitanim = "hit_normal", breakanim = "mined_normal", growanim = "grow_short_to_normal", growsound = "dontstarve/common/together/marble_shrub/grow", workleft = TUNING.MARBLESHRUB_MINE_NORMAL, loot = function() return {"marble", "marble", "marble", "marblebean"} end, }, { -- tall idleanim = "idle_tall", hitanim = "hit_tall", breakanim = "mined_tall", growanim = "grow_normal_to_tall", growsound = "dontstarve/common/together/marble_shrub/grow", workleft = TUNING.MARBLESHRUB_MINE_TALL, loot = function() return {"marble", "marble", "marble", "marble", "marblebean"} and math.random() < 0.95 and {"marble"} or {"marblebean"} end, }, } local function MarbleLootW(prefab) prefab.components.lootdropper.statedata = statedataW end AddPrefabPostInit("marbleshrub", MarbleLootW)