Jump to content

[MOD] Smart Containers


Carlzilla

Recommended Posts

Adds a container class that will automatically remove certain items from the player's inventory. This makes storing items in a neat and organized way nice and simple. I've set up 6 smart containers which are included in the mod, but you can easily add your own. The 6 containers are:

 

* A Gun Safe for your guns

* A Fridge for your cooked foods and meats

* A cupboard for your canned/non-perishable foods

* A medicine cabinet for your health/medicine items

* An ammo storage crate for your bullets, arrows, and explosives

* A raw materials crate for a lot of general raw materials

 

If you want to add new containers, it's super easy to do. Simply clone the container you're looking to turn into a smart container in your blocks.xml (be sure to change the name and ID, obviously), then change the change the following line:

<property name="Class" value="Loot" />
OR
<property name="Class" value="SecureLoot" />

TO

<property name="Class" value="SmartLoot, Mods" />

 

Once you have the class changed you need to add an ItemList to do this add the following property to the block:

<property name="ItemList" value="item1,item2,item3...itemX,itemY,itemZ" />

 

item1, etc. should be replaced by the item or block name as defined in the items.xml or blocks.xml. That's all there is to setting one up.

 

Download:

https://www.mediafire.com/?rdpnl5dp3y02dol

Link to comment
Share on other sites

:jaw:

 

 

 

 

Very nice work Carlzilla!

 

Thank you for spending your time working on a random mod request, it is greatly appreciated.

 

I can't wait to try it out.

 

-----Update-----

 

Okay, it is even better than I had hoped for.

 

Easy to customize, it doesn't pull items from your tool belt and it has a custom hotkey so you determine when it pulls from your inventory and when it doesn't.

 

Amazing!

Link to comment
Share on other sites

Glad you're enjoying it.

 

If you ever get around to creating any custom storage container lists feel free to post them up. I only made a couple because I really didn't feel like pouring through the xmls trying to figure out what should go where...

Link to comment
Share on other sites

The framework you've provided is more than enough, I don't blame you for not wanting to comb through all the items and blocks figuring out what goes where. It is largely a matter of preference anyway.

 

I would post my container lists when I am done, but my server is such a frankenstein of so many different things it wouldn't really help anyone out.

Link to comment
Share on other sites

While working on this, I also created a "Chest of Holding" and it's contents will persist (and be unique for each player) between games. I could post that up if anyone is interested.

 

Basically this makes server wipes a tiny bit less annoying, because you can stash at least a chest full of useful stuff away and then upon starting, you craft the chest again and place it down...BOOM all the stuff you placed in there last game.

Link to comment
Share on other sites

While working on this, I also created a "Chest of Holding" and it's contents will persist (and be unique for each player) between games. I could post that up if anyone is interested.

 

Basically this makes server wipes a tiny bit less annoying, because you can stash at least a chest full of useful stuff away and then upon starting, you craft the chest again and place it down...BOOM all the stuff you placed in there last game.

 

That be awesome to have i think

Link to comment
Share on other sites

The mod is working great so far, all items and blocks are auto-storing into their corresponding containers without issue. It is hoarder heaven.

 

The one small exception I've run into is that I can't seem to get any tools to auto-store at all. I've tried various containers and quadruple checked the item lists for spelling and case sensitivity. If I stick something else in the item list for my tools container, say cloth, the cloth will auto-store, but none of the tools will.

Link to comment
Share on other sites

Updated the file, so the tool/gun issue should be fixed.

 

Unfortunately, if you don't back up your custom smart containers they will be overwritten when you rebuild. So be sure to pull them from your blocks.xml file before you rebuild.

 

I suggest (if you haven't been doing it already) either making any changes to the containers in the mods config\SmartContainers.xml file (which you then don't overwrite when extracting the new version) or better yet creating a separate SDX XML only mod that loads after this one that contains all your containers. That way if I ever update this, you're not back at square one with your custom sorting lists.

Link to comment
Share on other sites

Wait a minute, first you take only two days to go from some random guys mod request to a working mod. Then you have a fix almost instantly, if you keep this up I'll feel obliged to name my first child Carlzilla. I'm not sure how I'll break it to my wife.

 

Wise words of caution, I've backed it up a few times already and also use the second method you suggested. I'm sure we've all burned ourselves that way a few times in the past.

 

Thanks again.

Link to comment
Share on other sites

It seems my base XML doesnt contain a recipie you are trying to replace with this mod, any tips on how I can resolve this conflict?:

 

Apply mod config patch: SmartContainers

Applying patch: C:\Program Files (x86)\Steam\SteamApps\common\7 Days To Die\SDXMods\SmartContainers\Configs\SmartContainers.xml...

AddXmlByXPath: /blocks

Found 6

ERROR: Could not find node at XPath: /recipes/recipe[@name=cntFridge]

AddXmlByXPath: /recipes

Found 6

ERROR: Found errors while parsing import file: C:\Program Files (x86)\Steam\SteamApps\common\7 Days To Die\SDXMods\SmartContainers\Configs\SmartContainers.xml

ERROR: Aborting...

ERROR: Task Apply mod config patches failed

EVENT: Complete.

Link to comment
Share on other sites

Wait a minute, first you take only two days to go from some random guys mod request to a working mod. Then you have a fix almost instantly, if you keep this up I'll feel obliged to name my first child Carlzilla. I'm not sure how I'll break it to my wife.

 

Wise words of caution, I've backed it up a few times already and also use the second method you suggested. I'm sure we've all burned ourselves that way a few times in the past.

 

Thanks again.

 

To be fair, it was a super easy fix that I actually dealt with once already in my duffel bags mod...but forgot about when I set this one up. I'll spare the technical details, but it was just a simple issue of two things not matching up because I was telling the game to check the wrong thing, when the right thing was right there as well and just not being accessed.

Link to comment
Share on other sites

Go into the SmartContainers.xml and remove the line that reads:

 

<remove xpath="/recipes/recipe[@name='cntFridge']" />

 

Don't know why you don't have it, as it's a vanilla recipe.

 

If he doesn't have that vanilla recipe he might be using a completely xml based mod as his SDX base that doesn't include any of the recipes marked for removal in your mod.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...