Dirty Barrels


Barrels need to be cleaned with Steam or Water before using them again.

Content
2 years ago
0.16 - 1.1
491
Logistics

b Error on Load

5 years ago

Failed to load mods: Error in assignID, item with name 'empty-canister' does not exist.

Source: clean-canister-fast(recipe)

Thanks

5 years ago

can confirm. I tried reading into it but some recipes call on empty-barrel and some on empty-canister? Dunno but I decided to not poke around.

5 years ago

I'm a beginner with modding, just messin around I made it work,
problem with prototype/recipe.

if data.raw.item == "empty-container" then
data:extend ({
.... canister recipies...bla,bla...

})
end
A place to start looking, thanks!

5 years ago

Same issue here. Sad pandas.

5 years ago
(updated 5 years ago)

Looking around, it seems like this error only happens if you don't have which ever of bob's mods provide canisters. The clean-barrels.lua file is attempting to add a recipe to make those be dirty and be washed as well, but if they were never added to data.raw by said bob's mod this mod causes the crash since it references an item that was never added.

What I don't know is if you can conditionally call data:extend() by putting some executable lua (aside from the single call to data:extend() ) within clean-barrels.lua to check and see if the canister item exists, and if it does, call a second data:extend() with just the dirty canister stuff, or don't if it doesn't exist. I'll probably play around to see.

5 years ago

Well that worked fine, however I can't give the author a pull request on their gitlab install. However, for others that want to fix it. If you don't have bob's mods at all, remove the hashes in clean-barrels.lua that mention canisters. If you want to support it conditionally, enclose the canister hashes into a second call to data:exetend() in an if checking to see if the item exists. Like so:
if data.raw.item["empty-canister"] then
data:extend( { canster hashes... } )
end

5 years ago

I've fixed it in a branch to the repo and left the repo checked out in this zip of the mod dir if anyone is interested, until the author can update it. This worked fine for me: https://slowhosting.net/dirtybarrels_0.1.4.zip

Once the author updates on the mod portal I'll delete this zip.

5 years ago

Sorry guys I'll try and get this fixed tonight, been super busy with my work lately.

5 years ago

Not a problem, mods are just about always done in spare time by and as a user of a great many mods, I'm glad folks like you put in the time and effort.

4 years ago
(updated 4 years ago)

Edit: @alnet thank you for the contributed code, although it does seem to cause issues for people who do have Bobs Plates since it no longer detects the canisters.

I'm still working on fixing this right now.

If you'd like to contribute further, you can create an account on my gitlab server and make PRs that way.

4 years ago

New version up, tested with vanilla and with Bob's Plates, Dirty canister recipe is now only added if canisters exist.

This thread has been locked.