Jump to content

Containers problem for mod compatibilities


francogp

Recommended Posts

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 by francogp
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...