• Content Count

  • Joined

  • Last visited

 Content Type 




Klei Bug Tracker

Game Updates

Hot Lava Bug Reporter

File Comments posted by Kzisor

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



    • Like 1

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



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



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



    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/"),	Asset("ANIM", "anim/"),}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"FILL.fn = function(act)    if and and act.invobject and act.invobject.components.fillable then        return, 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.






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