Rokin Posted July 2, 2015 Share Posted July 2, 2015 Hello, I have a doubt, if I want overwrite a default PrefabFiles (ex : scripts/prefabs/beefalo.lua) with my custom prefab beefalo.lua, i must do write in my modmain.lua : PrefabFiles = { "beefalo",} (etc...) for it to be loaded or it is not necessary ? (sorry for my bad english ) Link to comment Share on other sites More sharing options...
Kzisor Posted July 2, 2015 Share Posted July 2, 2015 @Rokin, it's bad practice to overwrite prefab files. Use AddPrefabPostInit to change the prefab to your desire instead. Link to comment Share on other sites More sharing options...
Amalleus Posted July 2, 2015 Share Posted July 2, 2015 as Kzisor said, you better to not overwrite. Just modify some strings, functions etc. which you want. That's how f.e. AddRecipe works - it just modify recipes (adds one more), but not overwrite the whole file.+ you can replace the whole function with your custom one, or just replace some strings. f.e. Spear uses is 150 (can't remember). You may add strings to just increase uses:inst.components.finiteuses:SetMaxUses(TUNING.SPEAR_USES * 2) inst.components.finiteuses:SetUses(TUNING.SPEAR_USES * 2)it will replace the old strings Link to comment Share on other sites More sharing options...
Rokin Posted July 3, 2015 Author Share Posted July 3, 2015 ok, thank you ! 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