Project Zomboid

Project Zomboid

Infinite Carryable Containers
I got this working with Crates, Lockers, all the things.
A simple edit to your script and I got this working with all buildable containers, edit the numbers (or use SandboxVars feature) to change capacity.
LUA Script edit below:
local tilecontainers = { ["stove"] = 10000, ["woodstove"] = 10000, ["microwave"] = 10000, ["barbecue"] = 10000, ["barvecuepropane"] = 10000, ["clothingwasher"] = 10000, ["clothingdryer"] = 10000, ["clothingdryerbasic"] = 10000, ["fridge"] = 10000, ["tent"] = 500, ["campfire"] = 500, ["logs"] = 10000, ["shelter"] = 500, ["crate"] = 10000, ["desk"] = 10000, ["counter"] = 10000, ["shelves"] = 10000, ["composter"] = 10000, ["stonefurnace"] = 10000, ["coffin"] = 10000, ["toolcabinet"] = 10000, ["militarylocker"] = 20000, ["militarycrate"] = 20000, ["locker" ]= 10000, ["metal_shelves"] = 10000, ["medicine"] = 10000, ["fireplace"] = 10000, ["plankstash"] = 10000, ["wardrobe"] = 10000, ["dresser"] = 10000, ["sidetable"] = 10000, ["cardboardbox"] = 5000, ["dishescabinet"] = 10000, ["filingcabinet"] = 10000, ["trough"] = 1000, ["doghouse"] = 1000, ["restaurantdisplay"] = 10000, ["displaycasebakery"] = 10000, ["bin"] = 10000, ["overhead"] = 10000, ["cashregister"] = 10000, ["vendingsnack"] = 10000, ["vendingpop"] = 10000, ["shelvesmag"] = 10000, ["clothingrack"] = 10000, ["displaycasebutcher"] = 10000, ["grocerstand"] = 10000, ["displaycase"] = 10000, ["smallcrate"] = 5000, ["smallbox"] = 5000, ["postbox"] = 10000, ["newspaper_knews"] = 1000, ["newspaper_dispatch"] = 1000, ["newspaper_herald"] = 1000, ["newspaper_times"] = 1000, ["dumpster"] = 10000 } -- addContainer("type", capacity, preventNesting, _equippedWeight. _transferTimeSpeed) function SetContainerSize() local JB_MaxCapacityOverride = require("JB_MaxCapacityOverride"); local allItems = getAllItems(); for i = 0, allItems:size() - 1 do local containerItem = allItems:get(i); if containerItem:getTypeString() == "Container" then local containerType = containerItem.name; JB_MaxCapacityOverride.addContainer(containerType, 10000, false, 0); containerItem:DoParam("Weight = 0") containerItem:DoParam("WeightReduction = 100"); end end -- Process Tile Containers for key,value in pairs(tilecontainers) do JB_MaxCapacityOverride.addContainer(key, value, false, 0, 0.1) end end Events.OnPreDistributionMerge.Add(SetContainerSize);
I hope this helps someone, it took me about 6 hours to track this down. I'm a C# guy, not a LUA guy.
< >
Showing 1-7 of 7 comments
poedgirl  [developer] 6 Apr @ 6:32pm 
While the approach is interesting, it does remove a fundamental part of the mod, and that is working with every other mod out there. This would require someone to add compatibility patches for everything, something I specifically want to avoid. I'll have a look around and see if I can get a list of the tiles through the code.
My code removes no part of the mod, it adds the feature of also editing the games tiles/buildables.

Container types, btw, are from the file media/newtiledefinitions.tiles.txt for the base game.
I had to sort through over 1000 entries to find the unique ones to add to the list. I could find no way of programmatically pulling the list. I'm not a LUA wizard, so maybe you will find how.
function allContainers()
local tilesetNames = getWorld():getAllTilesName()
local count = 0
for i = 1, tilesetNames:size() do
local tilesetName = tilesetNames:get(i - 1)
local tileNames = getWorld():getAllTiles(tilesetName)
for j = 1, tileNames:size() do
local sprite = getSprite(tileNames:get(j - 1))
if sprite and sprite:getProperties():Is(IsoFlagType.container) then
count = count + 1
print(sprite:getName())
end
end
end
print("# of containers found: ", count)
end

this isn't reliable because I'm getting a lot of goofy stuff like vegetation_foilage_01_8 etc
I don't know why it printed with no indents but I ain't changing it :)
Last edited by jbdiablo; 7 Apr @ 3:29pm
@Flexible Games - it will remove compatibility with mods. The list would have to be manually updated without a way to pull properties from the tiles and - heck nah, that's a full time job.

if you run the code above, it's not reliable. that method is not going to work.
I will recommend people who use this change ["microwave"] to ["freezer"]

The script change from JB's script seems to have FUBAR'd the functionality of the microwave. Oddly, the oven seems to work just fine with the change.
I don't think I changed anything that would affect the microwave.
They added a GUI to the microwave, I noticed it after the last update. Right click the microwave to open settings, there you can set the timer.
Now I'm trying to find the container types for vehicles, but that might cause vehicles to be too heavy to move. Not sure.
< >
Showing 1-7 of 7 comments
Per page: 1530 50