Rosten Posted December 8, 2016 Share Posted December 8, 2016 I've been considering recently working on a mod that serves to make Don't Starve's combat system a little more robust, and my first step with doing that was to add a sort of Pokemon-esque damage types system (I.e. Certain enemies would take more or less damage from different weapons, and different kinds of armor would protect you better from different types.) My first thought on doing that was to change the function for calculating damage, but I vaguely recall being told that editing existing components and whatnot was kind of a terrible idea, so, before I try to continue with this, thoughts? Link to comment Share on other sites More sharing options...
Kzisor Posted December 8, 2016 Share Posted December 8, 2016 If you are editing them by overwriting them, that is greatly frown upon as your mod will not be compatible with other mods. However, if you use the proper api (AddComponentPostInit) and change the functions that way it isn't frowned upon because your code will be compatible with other mods. Just depends on if you want your mod to be compatible with other mods. Link to comment Share on other sites More sharing options...
Rosten Posted December 8, 2016 Author Share Posted December 8, 2016 Is there any documentation for using these APIs anywhere? Link to comment Share on other sites More sharing options...
Kzisor Posted December 9, 2016 Share Posted December 9, 2016 34 minutes ago, Rosten said: Is there any documentation for using these APIs anywhere? You can find a full list of the 'API' inside the modutil.lua file in the scripts folder. However, there is no other documentation to tell you how it works, you will need to experiment and test things for yourself. Link to comment Share on other sites More sharing options...
zazabar Posted December 9, 2016 Share Posted December 9, 2016 2 hours ago, Kzisor said: You can find a full list of the 'API' inside the modutil.lua file in the scripts folder. However, there is no other documentation to tell you how it works, you will need to experiment and test things for yourself. Do you happen to know if using the AddComponentPostInit on a vanilla prefab will overwrite the component (if it already exists) with a modded one? Link to comment Share on other sites More sharing options...
Kzisor Posted December 9, 2016 Share Posted December 9, 2016 Just now, zazabar said: Do you happen to know if using the AddComponentPostInit on a vanilla prefab will overwrite the component (if it already exists) with a modded one? AddComponentPostInit, allows you to hook into the component it doesn't overwrite it. You will still need to overwrite the functionality of the component you want to change. Link to comment Share on other sites More sharing options...
Serpens Posted December 9, 2016 Share Posted December 9, 2016 (edited) download some simple mods and see how those things are used there Edited December 9, 2016 by Serpens Link to comment Share on other sites More sharing options...
Kzisor Posted December 9, 2016 Share Posted December 9, 2016 18 minutes ago, Serpens said: download some simple mods and see how those things are used there Not all mods are created equally, meaning not all mods use the API. While this is decent advice, I would avoid giving it because of that sole reason. Take a gander at the workshop, only about half use proper API, and the other half probably don't work properly after all the updates. 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