Jump to content

How could I change the values of Monster Lasagna?


Recommended Posts

AddPrefabPostInit("prefab_name", fn)
--add code to a existing prefab 

AddPrefabPostInit("prefab_name", function(inst)

end)
--can do it this way

local function Code (inst)

end

AddPrefabPostInit("prefab_name", Code)
AddPrefabPostInit("prefab_name_2", Code)
--or this way, it works better for multiple 

you can also replace the prefab as a whole but this kinda ruins any comparability to other mods 

 

AddPrefabPostInit("prefab_name",function (inst)
if not GLOBAL.TheWorld.ismastersim then
   return inst
end
--add this to change specific component stuff, i'm not sure but it has something to do with client and server stuff

end)



AddPrefabPostInit("prefab_name",function (inst)
if not GLOBAL.TheWorld.ismastersim then
   return inst
end
--you can use these to change whichever stat you want using components, for this one specificly the hunger value

        --inst:AddComponent("edible")
        --inst.components.edible.healthvalue = data.health
        inst.components.edible.hungervalue = 85 --has to be a number
        --inst.components.edible.sanityvalue = data.sanity or 0
end)

image.png.dacdf3891d0625fcc5abb533ee52733f.png
prefab name is basically the name if the item as sometimes the name in code is different from the name of the item
you can easily find the code name on the don't starve wiki, bless their souls and whatnot.
 



IMPORTANT: this will be in your modmain

i'm not that good at explaining things but hopefully this works

  • Like 1
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
 Share

×
  • Create New...