Jump to content

Recommended Posts

I'm new to modding, I only made one mod to make seeds disapear whe they spoil. I'm now trying to figure out how to make a mod that removes the twigs dropping when a twiggy tree grows, and maybe remove their cones. Based on what I could find, we can't remove tree drops, only add, is that true? i couldn't find anything that wasn't really old, so i'm not even sure if it's possible

Link to comment
https://forums.kleientertainment.com/forums/topic/126395-twiggy-tree-drops/
Share on other sites

You should be able to override their loot table to get rid of the twiggy cone in a "postinit" function, but you would have to make one for each stage of the twiggy tree. Here's an example:

GLOBAL.SetSharedLootTable( 'your_table_name',
{
    {'prefab_name',              1.00},
    {'prefab_name',              1.00},
    {'prefab_name',              0.5},  
})

AddPrefabPostInit("prefab_you_want_to_override", function(inst)
    if inst.components.lootdropper ~= nil then
        inst.components.lootdropper:SetChanceLootTable('your_table_name')
    end
end)

 

If you dont know how a loot table works, its a table with the entities drops & the number next to it is the percentage rate that it drops, 1.00 would be 100% and 0.5 would be 50%. You would put this in your modmain.lua.

If you need any more help I would be glad to assist you :)

Edited by SuperMeatGoy
  • Thanks 1

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...