Lasermite Posted June 22, 2015 Share Posted June 22, 2015 Now I know you don't wanna spend more time helping another "noob" but hear me out. I've done all the things the forums have suggested (sort of learnt lua, researched existing mods etc.) but there is one mayor thing I haven't found a tutorial for and that is how the mod interacts with existing files. When making a new character you get all the files, put them in the mod folder and your pretty much good to go and I've made that work. What I CAN'T get to work is easy stuff like changing properties of the regular items ingame. For example: If I want to make my axes have double durability. Do i have to refer the original prefabs as assets. How much code does a thing like that take? I just want an idea of where to start and how to think. All help is much appreciated. Link to comment Share on other sites More sharing options...
Seiai Posted June 22, 2015 Share Posted June 22, 2015 (edited) @Lasermite,just use postinit functions in your modmain(they get called for the prefab after it's been initiated):AddPrefabPostInit("axe",function(inst)inst.components.finiteuses:SetMaxUses(2*GOBAL.TUNING.AXE_USES)inst.components.finiteuses:SetUses(2*GLOBAL.TUNING.AXE_USES)end) Edited June 22, 2015 by Seiai Link to comment Share on other sites More sharing options...
Lasermite Posted June 23, 2015 Author Share Posted June 23, 2015 @Seiai Ok I see, thanks. So there doesn't need to be anything else except that in the modmain and some stuff in the modinfo? Link to comment Share on other sites More sharing options...
Lasermite Posted June 23, 2015 Author Share Posted June 23, 2015 @Lasermite,just use postinit functions in your modmain(they get called for the prefab after it's been initiated): AddPrefabPostInit("axe",function(inst)inst.components.finiteuses:SetMaxUses(2*GOBAL.TUNING.AXE_USES)inst.components.finiteuses:SetUses(2*GLOBAL.TUNING.AXE_USES)end)Sorry, since I'm new to this forum aswell I don't know how to tag someone. Link to comment Share on other sites More sharing options...
Seiai Posted June 23, 2015 Share Posted June 23, 2015 Sorry, since I'm new to this forum aswell I don't know how to tag someone.just mark a bit text in someone's post and click "mention" in the popup. and yes to your question. 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