Lakefruit Posted June 6, 2019 Share Posted June 6, 2019 (edited) Just to preface, I'm very new to modding. I'm trying to make a mod that will add Maxwell's Dapperness to Wickerbottom. This is my modmain.lua so far. local function ModifyWickerbottomFn(player) local function master_postinit(inst) inst.components.sanity.dapperness = TUNING.DAPPERNESS_LARGE end end AddPlayerPostInit(ModifyWickerbottomFn) I'm basing all of this off of a wiki post I read earlier (don't have the link, sorry) and a Maxwell mod I was able to create from said wiki post that tweaked his health. Here's the Maxwell mod I was able to make that tweaks his health. local function ModifyWaxwellFn(player) player.components.health:SetMaxHealth(150) player.components.hunger:SetMax(150) player.components.sanity:SetMax(200) end AddPlayerPostInit(ModifyWaxwellFn) I need help with Wickerbottom's tweak though, as nothing I've been trying has worked. Thanks in advance!! Edited June 6, 2019 by Lakefruit Link to comment https://forums.kleientertainment.com/forums/topic/107159-how-to-add-maxwells-dapperness-to-wickerbottom-with-a-mod/ Share on other sites More sharing options...
Ultroman Posted June 25, 2019 Share Posted June 25, 2019 masterpostinit has nothing to do there. It should only ever appear inside a prefab LUA file. You also need to do a prefab name check, in order to only apply this to Wickerbottom. local function ModifyWickerbottomFn(player) if player.prefab == "wickerbottom" then player.components.sanity.dapperness = TUNING.DAPPERNESS_LARGE end end AddPlayerPostInit(ModifyWickerbottomFn) This next version is better and simpler, but I'm not sure if it works: local function ModifyWickerbottomFn(player) player.components.sanity.dapperness = TUNING.DAPPERNESS_LARGE end AddPrefabPostInit("wickerbottom", ModifyWickerbottomFn) Link to comment https://forums.kleientertainment.com/forums/topic/107159-how-to-add-maxwells-dapperness-to-wickerbottom-with-a-mod/#findComment-1213732 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now