Jump to content

[Request] Remove harvesting/hitting juicy berries with Action/Space key


Recommended Posts

Good evening.

I was wondering if anyone knows how easy it would be to make a mod that would disable harvesting of Juicy Berries with Space button, and instead make the character hit them only with a click of the mouse. As it is right now, planting the juicy berries in a tight area makes it so that when harvesting one juicy berry plant the 3 fruits will drop on the ground randomly and since it is hard to actually select them with the click from all around the other plants it is almost impossible to loot the dropped berries, therefore you end up trying to do that with Space, only to sometimes hit another juicy berry plant by mistake.

I would be extremely grateful if anyone would have any idea if it would be possible to get a client side mod as a workaround for this as it would improve the juicy berries farm immensely for me. :)

Link to comment
Share on other sites

@t1morino88eex Hmm... This could be done in a client-side mod, I believe. It seems like the "cleanest" way to do it is this:

AddPrefabPostInit("berrybush_juicy", function(inst)
	inst:AddTag("mineactive")
end)

It's a bit of a hack, because it has nothing to do with mines, but due to the fixes they made for tooth traps it excludes it from space bar actions.

Edit: The code I used in the latest version I posted here is:

AddPrefabPostInit("berrybush_juicy", function(inst)
	inst:DoPeriodicTask(1, function() inst:AddTag("mineactive") end, math.random())
end)

 

Edited by rezecib
Link to comment
Share on other sites

Oh I remember using a mod for doing exactly that to my tooth traps back in the old days!

I have no experience with how the mods creation works. I tried putting those command lines in console on my server but it didn't do anything, and I am guessing that's not how it is supposed to be done or work. :) Either way it sounds like a hack I would be ok with using if it would indeed work.

Link to comment
Share on other sites

@t1morino88eex Seems like there might be some issues with it getting overridden by data from the server, but this seemed to work when I tested it, anyway.

Edit: So it looks like anything that changes any tag for it on the server will cause it to clear the tag. So... catching on fire and being extinguished, withering, getting picked, having the berries grow back, and more will mess this up. But... as long as you walk into range of the berry bushes while they are already ready to be picked then it'll work. So here's a changed version that re-adds the tag once a second. That shouldn't be too much of a performance hit, I think.

Edited by rezecib
Link to comment
Share on other sites

I can strongly recommend the Action Queue Mod:
steamcommunity.com/sharedfiles/filedetails/?id=609051112
it is the most practical mod I have ever seen :)

Regarding the problem with juicy bushes, it is not a perfect help, but better than nothing.
You can simply hold Shift and click to draw a window, that includes all bushes you want to harvest. Char will harvest all bushes automatically, but doesn't pick up the berries. But after that you can draw another window to pick up all marked jucy berries (make sure you do not mark a not hitted bush)

Edited by Serpens
Link to comment
Share on other sites

8 hours ago, rezecib said:

That shouldn't be too much of a performance hit, I think.

It isn't at all, and it is working perfectly and the way I was thinking. I am so so happy, tried it on my own server and on some public servers as well, you made me a happy person today. Thank you very much @rezecib, juicy berry farms are wonderful for me now!

Hmmm would there be a high chance that future updates to the games might make the mod stop working? 

@Serpens thank you for reminding me about that mod. Rezecib mentioned that he found a way to make it work with movement prediction off, which is how I play the game, therefore I am waiting for his release on the workshop to give it a go. :) The reason for which Rezecib little mod is exactly what I wanted is because I only hit a juicy berry plant from my farm not that often, as in whenever I want fresh fillers for my meatballs.

Edited by t1morino88eex
Link to comment
Share on other sites

I was playing around and got this:

local debug = GLOBAL.debug
local require = GLOBAL.require

local playercontroller = require("components/playercontroller")
local func = playercontroller.GetActionButtonAction
local i = 1
while true do
	local n, v = debug.getupvalue(func, i)
	if not n then
		break
	end
	if n == "PICKUP_TARGET_EXCLUDE_TAGS" then
		table.insert(v, "jostlepick")
		break
	end
	i = i + 1
end

 

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
 Share

×
  • Create New...