Luminum Posted June 22, 2017 Share Posted June 22, 2017 (edited) Hi, all! I'm wondering how to increase the durability of the Ice Staff, remove the Sanity debuff, etc. I thought it would be fun to just run around freezing as much as I wanted to, but it seems that nobody has done a mod specifically for this (at least that I could find). I also thought this would be a sort of stepping stone into modding, because I'd really like to learn about it. Any help would be appreciated! Edited June 22, 2017 by Luminum Link to comment Share on other sites More sharing options...
MorickClive Posted June 23, 2017 Share Posted June 23, 2017 (edited) Here, should work in theory: --- Mod Main AddPrefabPostInit("icestaff", function(inst) inst.components.finiteuses:SetMaxUses(X) -- you could also look into removing the component, though I haven't investigated that far. inst.components.weapon:SetOnAttack(nil) -- the function before basically handles sanity. inst.components.weapon:SetDamage(0) -- have some fun (default values set here) inst.components.weapon:SetRange(8, 10) end) Mod function as declared in "modutil.lua" from DST lua files; allows you to add additional conditions to existing prefabs post-initialisation. Can potentially cause conflicts with mods that may edit prefabs(editing shared spaces etc), I'd assume that whichever post init runs last will have dominance or "lasting impact / final say". ---- Might also be of interest to you (from an implementation of new objects point of view): Edited June 23, 2017 by MorickClive Link to comment Share on other sites More sharing options...
Luminum Posted June 23, 2017 Author Share Posted June 23, 2017 13 hours ago, MorickClive said: Here, should work in theory: --- Mod Main AddPrefabPostInit("icestaff", function(inst) inst.components.finiteuses:SetMaxUses(X) -- you could also look into removing the component, though I haven't investigated that far. inst.components.weapon:SetOnAttack(nil) -- the function before basically handles sanity. inst.components.weapon:SetDamage(0) -- have some fun (default values set here) inst.components.weapon:SetRange(8, 10) end) Mod function as declared in "modutil.lua" from DST lua files; allows you to add additional conditions to existing prefabs post-initialisation. Can potentially cause conflicts with mods that may edit prefabs(editing shared spaces etc), I'd assume that whichever post init runs last will have dominance or "lasting impact / final say". ---- Might also be of interest to you (from an implementation of new objects point of view): Thanks for the detail! I'm not entirely sure about how to implement this. I've heard that editing the base files is a VERY bad idea, so how would I actually add the changes I want into the game? Link to comment Share on other sites More sharing options...
MorickClive Posted June 23, 2017 Share Posted June 23, 2017 (edited) First you might want to start off with a staple build/mod an expand from there - keep at it and you should get some progress: As for editing the base files, you never do it directly - that will cause issues, but this function slots in functionality directly to existing assets; you'd only have to worry about it should another mod overwrite the values you are setting. Edited June 23, 2017 by MorickClive Link to comment Share on other sites More sharing options...
Lumina Posted June 23, 2017 Share Posted June 23, 2017 1 hour ago, Luminum said: 15 hours ago, MorickClive said: Thanks for the detail! I'm not entirely sure about how to implement this. I've heard that editing the base files is a VERY bad idea, so how would I actually add the changes I want into the game? When you add something with "prefabpostinit" function or similar function, you don't edit the base file. So you keep the possibility of compatibility with others mods. Editing base file is something to avoid, but adding a prefabpostinit function is the way to do thing properly. Link to comment Share on other sites More sharing options...
Luminum Posted June 23, 2017 Author Share Posted June 23, 2017 35 minutes ago, Lumina said: When you add something with "prefabpostinit" function or similar function, you don't edit the base file. So you keep the possibility of compatibility with others mods. Editing base file is something to avoid, but adding a prefabpostinit function is the way to do thing properly. So then where exactly would I put the code for the mod? If you can't tell already, I basically have no idea what I'm doing. Link to comment Share on other sites More sharing options...
Lumina Posted June 23, 2017 Share Posted June 23, 2017 you create a modmain.lua and you put the code here. You'll also need a modinfo.lua Link to comment Share on other sites More sharing options...
Luminum Posted June 24, 2017 Author Share Posted June 24, 2017 17 hours ago, Lumina said: you create a modmain.lua and you put the code here. You'll also need a modinfo.lua I've created both. The modmain.lua is the code you gave me, and under that is some code that I found about removing the finiteuses component. Keep/move/remove it? The modinfo.lua is also something that I found and copied, then edited. Link to comment Share on other sites More sharing options...
. . . Posted June 24, 2017 Share Posted June 24, 2017 Here I made what you requested ! Amazing Icestaffs.zip So, what this mod does is removes durability from icestaffs & removes the sanity penalty, exactly what you wanted right ? Link to comment Share on other sites More sharing options...
Luminum Posted June 24, 2017 Author Share Posted June 24, 2017 2 hours ago, SuperDavid said: Here I made what you requested ! Amazing Icestaffs.zip So, what this mod does is removes durability from icestaffs & removes the sanity penalty, exactly what you wanted right ? Yeah, this is exactly what I was trying to do. Thanks! Link to comment 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