francogp Posted February 13, 2016 Share Posted February 13, 2016 (edited) Hi, there's an actual problem in the current way to implement containers: What we need:A way to register or add custom containers (new API function?) that don't need to be equipped on the back or hands (as a quick implementation), or several different body slots so we can fit specific equipment there (like the actual back slot, but for every part of the body). For example: Leg slot -> knife holster, Head -> helmet, waist-> waist pack. Current container detection in source code:In the function: "function ISInventoryPage:refreshBackpacks()" you can see the condition:if item:getCategory() == "Container" and getSpecificPlayer(self.player):isEquipped(item) or item:getType() == "KeyRing" then....Problem: Lots of mods MUST modify this function to add custom containers categories. This cause conflicts between mods because of OVERRIDING the same function/condition to achieve this goal.For example, the mods http://theindiestone.com/forums/index.php/topic/18016-united-states-military-gear-v12-3320/ and http://theindiestone.com/forums/index.php/topic/15092-zomboidxbow-update-fix-for-3230/ are incompatible because they override the same ISInventoryPage:refreshBackpacks() function, breaking their containers each other. Edited February 13, 2016 by francogp Link to comment Share on other sites More sharing options...
francogp Posted February 13, 2016 Author Share Posted February 13, 2016 - ignore this - Link to comment Share on other sites More sharing options...
EnigmaGrey Posted February 13, 2016 Share Posted February 13, 2016 You can simply overwrite the function in your mod. There's no need to alter the game's base files directly. Link to comment Share on other sites More sharing options...
francogp Posted February 13, 2016 Author Share Posted February 13, 2016 You can simply overwrite the function in your mod. There's no need to alter the game's base files directly.Sorry, maybe I was not clear. I was talking about overriding that function in a mod, not modifying the game source code. Overriding the function is conflictive if another mod override that function as well for the same purposes.That's why I ask for a solution in this thread. Link to comment Share on other sites More sharing options...
francogp Posted February 13, 2016 Author Share Posted February 13, 2016 You can simply overwrite the function in your mod. There's no need to alter the game's base files directly. I rewrote the OP so there's more details about this issue. 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