Jump to content

How do I get inventory and world container contents & change item category.


Pacolaco

Recommended Posts

Hi all,

I am looking to create (or hopefully install if already existing) two kinds of mods: An auto-organizer and an item category update. My idea of their functionality follows:

Auto-organizer: The auto-organizer (AO) mod would enable you to easily transfer items from your inventory to a container with the click of a button. When standing next to a world container, you would activate the AO. Upon activation, the AO compares the contents of the world container and your various inventories. Any items in your inventories that are also present in the world container will be automatically transferred to the container, with the regular delays of course. One important stretch goal would be setting minimum quantities of items to keep in your inventory.

Item category update: I would like to change the categorization for a lot of items. Medical items are categorized as "item", I would change them to "Medical". Cigarettes are classified as "food". Water containers are listed as "item". Canned foods are listed as "item". Obviously some of these categorizations are quite silly or would benefit greatly from a different categorization.

So, my questions to you are: Do you know if either of these mods exist? Do you know of any comparable mods? If the answer to both of the previous questions is no, could you help point me in the right direction to create these mods? I am not a noob when it comes to coding- but I have never used Lua, although it seems incredibly straight forward.

I was looking at the JavaDoc and found some relevant stuff but I am not sure how to work with it in Lua. For the item category I imagine I have to work with the zombie.inventory.InventoryItem.getCategory() function. But that is a java function. I don't have the source code. I don't want to have to edit the source code, I would like to make a plug-n-play mod. How can I see what the getCategory function is doing? Would I be able to override it so I could return a custom string when dealing with a certain ItemType? Do items have an 'category' string that I could simply change via Lua?

 

Sincerely,
Crandog

Link to comment
Share on other sites

Check out my Convenient Bags mod: http://theindiestone.com/forums/index.php/topic/1047-convenient-bags-182/

 

I added a tag system to circumvent the limitations of the default ItemTypes. 

 

You could keep a list below the hood, which your mod checks against when moving items. That's how you could have different ItemTypes at least "below the hood" so to speak.

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...