Jump to content
  • The forum downloads section will be removed on Jan 1st 2023. Players may still download mods that are currently hosted, but new submissions are no longer being accepted. Mod makers are advised to relocate their mods to alternative hosting solutions.

The mod about buckets v1.4.0


1 Screenshot

About This File

This mod adds a very useful bucket to the game ! It can be filled with water and used for a couple of stuff.

Bucket is craftable with 2 boards and 1 rope. You can find it in the Survival tab.

You can obtain water bucket by filling empty bucket from a pond. You can do this 2 times before drying up the pond. Pond refills itself after about half a day of rain. You can fish only from a full pond.

Water bucket has durability (10 uses). With water bucket you can:

- extinguish normal and wildfires (-1 use)

- cool yourself down by spilling it's content on you (adds 10 wetness per use, returns empty bucket)

- put in in the icebox and make ice ! (in about two days)

You can obtain ice bucket by putting water bucket in the ice box and letting it to freeze.

To get ice from the ice bucket, you have to break it with the hammer. Amount of yielded ice depends on percentage usage of water bucket used to make ice bucket.

Mod is compatible with "Breakable Ice" mod:

Steam Workshop:

Credits:

Thanks @Cacahuatoforo for the art, testing and ideas

Thanks @_Q_ for helping me understand how actions works

Have fun playing with my mod :grin:


What's New in Version v1.4.0   See changelog

Released

  • v1.4.0:
  • - made compatible with Shipwrecked DLC

 

  • v1.3.2:
  • - fixed a bug that caused a water bucket to be stored inside a burning chest instead of extinguishing it
  • - extinguishing burning objects now makes them wet, temporally protecting them from catching fire again, the protection lasts 5 to 20 seconds
  • - cleaned up code and unused files
  • Like 1
  • Thanks 1

User Feedback

Recommended Comments



Is it intentional that ponds don't freeze over in winter?

 

Not a big deal, just something I've noticed for a while now. Wasn't sure if you'd noticed it.

Link to comment
Share on other sites

Is it intentional that ponds don't freeze over in winter?

 

Not a big deal, just something I've noticed for a while now. Wasn't sure if you'd noticed it.

Yes, I've noticed that... It's a minor issue.. I'll see if I can fix this and maybe upload a fix...

And it's fixed now :-) Enjoy ;-)

  • Like 1
Link to comment
Share on other sites

DevilXD I've created Ice Fishing a mod inspired by Break Ice. However, there is an issue with your mod interacting correctly with my mod. I've taken the time to fix the issue and have removed any indication or need to overwrite pond.lua with your mod. I'll leave the updated code here.

 

modmain.lua

local TUNING      = GLOBAL.TUNINGlocal STRINGS     = GLOBAL.STRINGSlocal Recipe      = GLOBAL.Recipelocal Ingredient  = GLOBAL.Ingredientlocal RECIPETABS  = GLOBAL.RECIPETABSlocal TECH        = GLOBAL.TECHlocal SpawnPrefab = GLOBAL.SpawnPrefablocal GetPlayer   = GLOBAL.GetPlayerlocal require     = GLOBAL.requireAssets = {	Asset("ATLAS", "images/bucket.xml"),	Asset("ATLAS", "images/waterbucket.xml"),	Asset("ATLAS", "images/icebucket.xml"),	Asset("ANIM", "anim/pond_empty.zip"),	Asset("ANIM", "anim/pond_partial.zip"),}PrefabFiles = {	'bucket',	'waterbucket',	'icebucket',}TUNING.BUCKET = {}TUNING.BUCKET.WATER_BUCKET_USES = 10modimport("strings.lua")-- Changed Recipe for Bucket-o-Poop:Recipe("fertilizer", { Ingredient("bucket", 1, "images/bucket.xml"), Ingredient("poop", 3), Ingredient("boneshard", 2) }, RECIPETABS.FARM, TECH.SCIENCE_TWO)-- Change for Bucket-o-Poop return Empty Bucket:function PoopBucketPostInit(inst)	function GiveEmpty(inst)		local bucket = SpawnPrefab("bucket")		GetPlayer().components.inventory:GiveItem(bucket)		inst.DoTaskInTime(0, function() inst:Remove() end)	end	function OnFinished(inst)		GiveEmpty(inst)		inst:Remove()	end	if inst.components.finiteuses then		inst.component.finiteuses:SetOnFinished(OnFinished)	endendAddPrefabPostInit("fertilizer", PoopBucketPostInit)-- Bucket Recipe:Recipe("bucket", { Ingredient("boards", 2), Ingredient("rope", 1) }, RECIPETABS.SURVIVAL, TECH.SCIENCE_ONE)-- Perishable 'DoDelta' function add:local function PerishableComponentPostInit(self, inst)    function self:DoDelta(amount)        local perishable = inst.components.perishable        local old_val = perishable.perishremainingtime                perishable.perishremainingtime = perishable.perishremainingtime + amount                if perishable.perishremainingtime > perishable.perishtime then perishable.perishremainingtime = perishable.perishtime end        if perishable.perishremainingtime < 0 then perishable.perishremainingtime = 0 end                if math.floor(old_val*100) ~= math.floor(perishable.perishremainingtime*100) then	        inst:PushEvent("perishchange", {percent = perishable:GetPercent()})	    end                if perishable.perishremainingtime <= 0 then			perishable:Perish()        end    endendAddComponentPostInit("perishable", PerishableComponentPostInit)local ACTIONS = GLOBAL.ACTIONSlocal Action = GLOBAL.Actionlocal FILL = Action()FILL.str = "Fill"FILL.id = "FILL"FILL.fn = function(act)    if act.target and act.target.components.filler and act.invobject and act.invobject.components.fillable then        return act.target.components.filler:Fill(act.invobject, act.doer)    endendAddAction(FILL)--ACTIONS.FILL = FILLAddStategraphActionHandler("wilson", GLOBAL.ActionHandler(FILL, "dolongaction"))-- [[ BEGIN POND.LUA CHANGES ]]local FROG_SPAWN_THRESHOLD = 1 --lower - no frogs, 1 and higher - frogs will spawn.local CAN_FISH_THRESHOLD = 2 --lower - no fishes, 2 and higher - can fish.function UpdateFillState(inst)	local pond_type = ""	-- Determine the pond type.	if inst.prefab == "pond_mos" then pond_type = "_mos"	elseif inst.prefab == "pond_cave" then pond_type = "_cave" end	-- Set the proper Animation State for the pond.	if inst.components.filler.filled == 0 then		inst.AnimState:SetBuild("pond_empty")		inst.AnimState:PlayAnimation("idle"..pond_type)	elseif inst.components.filler.filled == 1 then		inst.AnimState:SetBuild("pond_partial")		inst.AnimState:PlayAnimation("idle"..pond_type, true)	end	-- Check to see if we are at the threshold to fish.	if inst.components.filler.filled == CAN_FISH_THRESHOLD then		-- Determine if we have a fishable component.		if not inst.components.fishable then			inst:AddComponent("fishable")			inst.components.fishable:SetRespawnTime(TUNING.FISH_RESPAWN_TIME)			-- Check the prefab and add correct type of fishable.			if inst.prefab == "pond" or inst.prefab == "pond_mos" then				inst.components.fishable:AddFish("fish")			elseif inst.prefab == "pond_cave" then				inst.components.fishable:AddFish("eel")			end		end	-- If not at the threshold remove fishable component.	else		inst:RemoveComponent("fishable")	end	-- Determine if we have a childspawner attached to our instance.	if inst.components.childspawner then		-- Check to see if we are at the threshold to spawn children.		if inst.components.filler.filled == FROG_SPAWN_THRESHOLD and GLOBAL.GetSeasonManager() then						-- Check to see if we are not in winter.			if not GLOBAL.GetSeasonManager():IsWinter() then				-- Spawn our children because we are not in winter.				inst.components.childspawner:StartSpawning()			else				-- Stop spawning our children because we are in winter.				inst.components.childspawner:StopSpawning()			end		-- Check to see if we are at the threshold to spawn children.		else if not inst.components.filler.filled  == FROG_SPAWN_THRESHOLD then			-- Stop spawning our children because we are not at the threshold.			inst.components.childspawner:StopSpawning()		end	endendendfunction Drain(inst)	--if inst.prefab == "pond_cave" then return end	--Check our fill state.	if inst.components.filler.filled > 0 then 		inst.components.filler.filled = inst.components.filler.filled - 1 	end	-- Call our UpdateFillState function.	UpdateFillState(inst)endfunction ReFill(inst)	-- Check our fill state.	if inst.components.filler.filled < inst.components.filler.maxfilled then		inst.components.filler.filled = inst.components.filler.filled + 1	end	-- Call our UpdatefilleState function.	UpdateFillState(inst)endfunction TryFill(inst)	local delay = GLOBAL.GetRandomMinMax(10,20)	inst:DoTaskInTime( delay, Refill )endfunction CanFill(inst)	-- If pond is not frozen then we can fill.	if not inst.frozen then		return  true	end	return falseendfunction StartFilling(inst)	local day = GLOBAL.TUNING.TOTAL_DAY_TIME	local delay = GLOBAL.GetRandomWithVariance( day / 2, 60 )	inst.filling = inst:DoPeriodicTask( delay, TryFill )endfunction StopFilling(inst)	if inst.filling then		-- Cancel our filling task.		inst.filling:Cancel()		inst.filling = nil	endendfunction GetInspectString(inst)	if inst.components.filler.filled == 0 then		return "POND_EMPTY"	elseif inst.components.filled == 1 then		return "POND_PARTIAL"	endendfunction StartSpawn(inst)	-- Check to see if we are at the threshold to spawn children.	if inst.components.filler.filled == FROG_SPAWN_THRESHOLD and GLOBAL.GetSeasonManager() then		-- Check to see if we are not in winter.		if not GLOBAL.GetSeasonManager():IsWinter() then			-- Spawn our children because we are not in winter.			inst.components.childspawner:StartSpawning()		end	endendfunction StopSpawn(inst)	inst.components.childspawner:StopSpawning()	for k,child in pairs(inst.components.childspawner.childrenoutside) do		if child.components.homeseeker then			child.components.homeseeker:GoHome()		end		child:PushEvent("gohome")	endendlocal function BasePondPostInit(inst)	if not inst.components.filler then		-- Add our filler component.		inst:AddComponent("filler")		inst.components.filler:SetLiquid("water")		inst.components.filler:SetFillTestFn( CanFill )		inst.components.filler:SetDrainFn( Drain )		inst.components.filler:SetMaxFills(2)	end	-- Add our GetInspectString to inspectable status.	inst.components.inspectable.getstatus = GetInspectString	-- Add our filling events.	inst:ListenForEvent("rainstart", function() StartFilling(inst) end, GLOBAL.GetWorld() )	inst:ListenForEvent("rainstop", function() StopFilling(inst) end, GLOBAL.GetWorld())	-- Watch for the snow level.	inst:ListenForEvent("snowcoverchange", function() 		UpdateFillState(inst) 	end, GLOBAL.GetWorld())	return instendfunction PondMosPostInit(inst)	inst = BasePondPostInit(inst)	-- Override the current "dusktime" event.	inst:ListenForEvent("dusktime", function()		StartSpawn(inst) end, GLOBAL.GetWorld() )	-- Override then current "daytime" event.	inst:ListenForEvent("daytime", function()		StopSpawn(inst) end, GLOBAL.GetWorld() )	return instendfunction PondPostInit(inst)	inst = BasePondPostInit(inst)	-- Override the current "dusktime" event.	inst:ListenForEvent("dusktime", function()		StopSpawn(inst) end, GLOBAL.GetWorld() )	-- Override the current "daytime" event.	inst:ListenForEvent("daytime", function()		StartSpawn(inst) end, GLOBAL.GetWorld() )	return instendAddPrefabPostInit( "pond", PondPostInit )AddPrefabPostInit( "pond_mos", PondMosPostInit )

Simply replace your modmain.lua file with that code and delete the pond.lua and pondold.lua files and it will work flawlessly with Ice Fishing mod.

 

 

Regards,

Kzisor/Ysovuka

 

P.S. This will not prevent your mod from working without my mod in any way. Ponds will freeze during winter as well.

Link to comment
Share on other sites

DevilXD I've created Ice Fishing a mod inspired by Break Ice. However, there is an issue with your mod interacting correctly with my mod. I've taken the time to fix the issue and have removed any indication or need to overwrite pond.lua with your mod. I'll leave the updated code here.

 

modmain.lua

 

Simply replace your modmain.lua file with that code and delete the pond.lua and pondold.lua files and it will work flawlessly with Ice Fishing mod.

 

Regards,

Kzisor/Ysovuka

 

P.S. This will not prevent your mod from working without my mod in any way. Ponds will freeze during winter as well.

 

Hi @Kzisor,

 

You just basically re-writed my pond.lua to modmian API hooks... I must admit, I was just to lazy to do this, when I was writing this mod ;-) Thank you so much :-) I will check the code (just to be sure) and update my mod :-)

Link to comment
Share on other sites

Hi @Kzisor,

 

You just basically re-writed my pond.lua to modmian API hooks... I must admit, I was just to lazy to do this, when I was writing this mod ;) Thank you so much :-) I will check the code (just to be sure) and update my mod :-)

 

No problem. Let me know if there was an issues in the coding, trying to better my craft and creating mods is helping a lot.

 

Also with your permission I'd like to use bits and pieces of your mod in order my make my mod better. If I have permission would you please let me know whom created the animations for the pond_partial and pond_empty so they may get proper credit.

 

~Kzisor/Ysovuka

Link to comment
Share on other sites

No problem. Let me know if there was an issues in the coding, trying to better my craft and creating mods is helping a lot.

Yeah, there where a crucial function hook missing, so I've added that... Besides that, there where no issues...

 

Also with your permission I'd like to use bits and pieces of your mod in order my make my mod better. If I have permission would you please let me know whom created the animations for the pond_partial and pond_empty so they may get proper credit.

Yeah, you can use my code, just add somewhere, that I've created it (like directly in code as a comment, or in modinfo.lua)

 

Graphics was made by @Cacahuatoforo, author of all my graphics in my mods - pond and bucket sprites for The mod about Buckets mod, and sword sprites for my Equivalent Exchange v2 mod - so you can add him into credits list too...

  • Like 1
Link to comment
Share on other sites

Yeah, there where a crucial function hook missing, so I've added that... Besides that, there where no issues...

 

Yeah, you can use my code, just add somewhere, that I've created it (like directly in code as a comment, or in modinfo.lua)

 

Graphics was made by @Cacahuatoforo, author of all my graphics in my mods - pond and bucket sprites for The mod about Buckets mod, and sword sprites for my Equivalent Exchange v2 mod - so you can add him into credits list too...

 

Wonderful, I'll add both you to the credits list which will be presented in the description of the mod.

 

~Kzisor/Ysovuka

Link to comment
Share on other sites

Any way of adding support for Thirst mod? Cuz it's like Thirst are blocking pond interaction with bucket.

 

My mod overwrites a vanilla 'pond.lua' file, because inside it was a local function, and unfortunately local function can not be replaced by the use of API hooks (in which case it could be compatible with other mods)...

 

So, I'm sorry, but there is no way that my mod can work, without replacing that file completely, which breaks compatibility with other mods, that are doing the same thing, or even with mods that are using API hooks (I don't know if API hooks can work on a file that is from other mod)...

 

BTW, sorry @Kzisor, but this includes compatibility with your mod...

Link to comment
Share on other sites

I don't think that's because of that, since in that case your mod WILL work and others won't. The only help i need to get about this situation is: Point to stings which are printing "I can't do that" after unsuccessfull try of bucket filling. (LMB to empty bucket -> LMB to pond ("Fill" action) -> Character are saying "I can't do that")

 

And by the way,  i used to use thirst and buckets mod together, and they were working, but somehow i managed to break this combo, so now i'm trying to fix it.

Link to comment
Share on other sites

It seems that i've figured out, how can you fix that issue, which as reported by me yesterday. I'll run a few tests and then post a result.

Link to comment
Share on other sites

So, my issue have something to do with filenames, somehow your mod uses the exaclty same filenames and filestructure as thirst mod, in which that part you are using have already became rudimentary. So your "updated" version of one function are getting replaced by older function, designed for use in thirst mod. I'll ask mod creator of thirst to remove that part, but still: Why this part ended up in your mod without any credits given? Good/Bad luck?

Link to comment
Share on other sites

So, my issue have something to do with filenames, somehow your mod uses the exactly same filenames and file structure as thirst mod, in which that part you are using have already became rudimentary. So your "updated" version of one function are getting replaced by older function, designed for use in thirst mod. I'll ask mod creator of thirst to remove that part, but still: Why this part ended up in your mod without any credits given? Good/Bad luck?

 

Couple of questions:

1. Can you please give me a link to this mod, so I can check it for myself?

2. What "updated" function are you talking about ?

 

And: "Why this part ended up in your mod without any credits given?" :

Everything except of art has been done by me, so I have no idea...

Link to comment
Share on other sites

1. http://steamcommunity.com/sharedfiles/filedetails/?id=266906110

2. "Fill" function in modmain.lua, which is also dependant from components fillable.lua and filler.lua. In "Thirst mod" bottles used to be filled by LMB to pond, as your buckets are now. But he changed that long ago, leaving action ID same and not longer used components in his mod. So due to alphabetic loadorder his "rudimentary leftovers" was rewriting your actual function ID and classes.

 

P.S. Your mod have been published here at 07.06.14, and 29.07.14 — at workshop. His — at workshop at 03.06.14. And BTW, i asked him to remove classes, so you won't find them in a fresh version of his mod, but he still have that function ID. And also, in workshop comments there's a metioning of removing that classes. 

Link to comment
Share on other sites

1. http://steamcommunity.com/sharedfiles/filedetails/?id=266906110

2. "Fill" function in modmain.lua, which is also dependant from components fillable.lua and filler.lua. In "Thirst mod" bottles used to be filled by LMB to pond, as your buckets are now. But he changed that long ago, leaving action ID same and not longer used components in his mod. So due to alphabetic loadorder his "rudimentary leftovers" was rewriting your actual function ID and classes.

 

P.S. Your mod have been published here at 07.06.14, and 29.07.14 — at workshop. His — at workshop at 03.06.14. And BTW, i asked him to remove classes, so you won't find them in a fresh version of his mod, but he still have that function ID. And also, in workshop comments there's a metioning of removing that classes. 

 

Ok, thanks... I downloaded it and, it doesn't have that components anymore, because it has been updated half an hour ago... So, that problem should be solved now :-)

 

Also, I wanted to mention, that there is always a very small chance, that 2 people in the world wanted to do the same thing (fill something from a pond), and came up with the same idea of handling it ;-) I've personally made both "filler.lua" and "fillable.lua" components, so it leaves two options - he copied my code (which is probably unlikely, considering the date), or we just made the same thing :-)

Link to comment
Share on other sites

I was wondering if I could use part of your mod in one of my mods, that adds new foods and well, a lot of new food mechanics, specifically just the fillable bucket with water for recipes like dough etc. Would that be alright with you? I wanted to check with you first. I would give proper credit and link to this page.

 

The idea is that you can fill buckets or a pot and boil that over a fire to make salt for recipes like dough.

Link to comment
Share on other sites

I was wondering if I could use part of your mod in one of my mods, that adds new foods and well, a lot of new food mechanics, specifically just the fillable bucket with water for recipes like dough etc. Would that be alright with you? I wanted to check with you first. I would give proper credit and link to this page.

 

The idea is that you can fill buckets or a pot and boil that over a fire to make salt for recipes like dough.

 

Yes, it's alright... Feel free to grab a filler and fillable components (written by me), as well as the "empty bucket" sprite, as it can be found in the assets of the game itself... However, "water bucket" and "ice bucket" sprites have been made by @Cacahuatoforo, and I can't give you permission to use those, unless @Cacahuatoforo itself will give it to you, to use them...

  • Like 1
Link to comment
Share on other sites

So, is there any chance to make this compatible with "breakable ice" (*not* outdated "break the ice", sic!)? If not, maybe merging the two mods (so-called "compatibility version ;) co-existing with the separate versions) would help? Doable?

Link to comment
Share on other sites

So, is there any chance to make this compatible with "breakable ice" (*not* outdated "break the ice", sic!)? If not, maybe merging the two mods (so-called "compatibility version ;) co-existing with the separate versions) would help? Doable?

 

As I said earlier in a comment:

 

My mod overwrites a vanilla 'pond.lua' file, because inside it is a local function, and unfortunately, local function can not be replaced by the use of API hooks (in which case it could be compatible with other mods)... So, I'm sorry, but there is no way that my mod can work, without replacing that file completely, which breaks compatibility with other mods, that are doing the same thing, or even with mods that are using API hooks (I don't know if API hooks can work on a file that is from other mod)...

 

Doable?

 

Yes, however may be tricky... And I would need a permission from @Kzisor to use part of his file... And there may be a lot of possible complications during merging... Considering that there is probably a lot more mods that can't work with this (because: as said above) - IMO there is no point to make co-op compatible version, there is just to much work to do... I could add a possibility to break ice in ponds to my mod (configurable in mod config of course), but that requires even more work to do, so...

Link to comment
Share on other sites

@DevilXD, when I designed my mod I originally designed it to be compatible with your mod. However, because you overwrite the pond.lua file it causes issues. If you're wanting to make it compatible in the future you can easily use the following line of code to allow it to be freezable or not.

inst.components.crstyallizable.canestablish = false -- or true

As far as I remember Breakable Ice will completely disable the event listeners from the original game because they aren't needed. You can hook into the following events to determine whether the ice has been established or not:

  • "Crystallizable:Established"
  • "Crystallizable:Destroyed"

If you need assistance shoot me a private message and we can talk about how to make them work together.

 

~Kzisor/Ysovuka

  • Like 1
Link to comment
Share on other sites

That would be awesome, guys :) Holding my thumbs for that inter-compatibility thing to work out well.

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