Don't Starve Together

Don't Starve Together

The Lure Plant Mod
42 Comments
cnb torture 21 Apr, 2023 @ 2:51pm 
question
do lureplants alery in a world are affected by this mod or do they just stay at default?
2basedJake  [author] 25 Apr, 2021 @ 7:45am 
No problem!
FilipeSD 24 Apr, 2021 @ 6:07pm 
Hi 2basedJake. I figured out what was happening. The mod that was in conflict with yours is a mod named "45 Inventory Slots". This mod, as the name says, incress the players inventory size to 45 slots. I don't know why, but is this mod that make yours don't work properly. Thanks for all your support, was very friendly.
FilipeSD 23 Apr, 2021 @ 5:42pm 
Hum... I will try this. Maybe tomorrow I can play, and then I give you an answer. For now, thank you so much!
2basedJake  [author] 23 Apr, 2021 @ 8:25am 
I did the same, and it works for me. Does it work for you if you disable all other mods, or if you use c_give("lureplant_bulb") in the console to get it? I am guessing either the crafting recipe is giving you the regular lureplant instead of the modded one, or something else is re-replacing the plant prefab with a different one that is not modded.
FilipeSD 22 Apr, 2021 @ 8:32pm 
I created a new world. The only other mod affecting lureplants that I use is to craft a Lure Plant bulb. But this shouldn't affect it, cause is just a recipe...
2basedJake  [author] 22 Apr, 2021 @ 7:10pm 
When I did as you said, the log came back out for me. Are you using other mods (especially mods affecting lureplants)? Was the mod applied to an existing world, or you create a new world with the mod enabled and still have this issue?
FilipeSD 22 Apr, 2021 @ 3:25pm 
Yes, that's happen even when it is one of the first few items to be eaten. I did this test: I plant a bulb, wait an eye spawn, drop a log, the eye eat the log, I kill the bulb, nothing but a new bulb is dropped...
2basedJake  [author] 22 Apr, 2021 @ 9:18am 
My best guess for why this is the case is that I set the modded lureplant to have an inventory with 100 slots max, so anything beyond the 100th item it eats would just be erased. Does that happen even when it is one of the first few items to be eaten?
FilipeSD 10 Apr, 2021 @ 12:43pm 
Hey, I need some help, please. I don't know what's happening, but I can't get back the things my lure plants ate when I kill it. I keep Perish Percentage in 100% and Keep food fresh yes. But, for example, if my lure plant killed a hound and ate his teeth, if I kill the lure plant, no teeth is droped.
FilipeSD 28 Mar, 2021 @ 12:56pm 
An incredible mod. Thank you so much!
Noro 22 Aug, 2020 @ 10:15am 
wow i like this, my farmable plant plus one
litlej86 1 Mar, 2019 @ 5:40pm 
the issue is when i click on a lureplant to harvest it immediatly crashes because of a conflict with the eyeplants. when i fixed that and got eyeplants to stay it just continuously made plantmeat.
litlej86 1 Mar, 2019 @ 5:39pm 
AddPrefabPostInit ("lureplant",function(inst)
local old_KillAllMinions = inst.components.minionspawner.KillAllMinions
inst.components.minionspawner.KillAllMinions = function(self)
if self.block_KillAllMinions ~= nil then
self.block_KillAllMinions = nil
return
end
return old_KillAllMinions(self)
end
--hook OnPicked
local old_OnPicked = inst.components.shelf.ontakeitemfn
inst.components.shelf.ontakeitemfn = function(inst, taker, itemonshelf, ...)
if taker and taker:HasTag("naturescientist") then
inst.components.minionspawner.block_KillAllMinions = true --Prevent lure plant resetting
old_OnPicked(inst, taker, itemonshelf, ...)
--wake up NOW!
if inst.task then
local TryRevealBait = inst.task.fn
inst.task:Cancel() --removing (it could happen in 1 second)
--change time: base + delta
inst.task = inst:DoTaskInTime(math.random() * delta + base, TryRevealBait)
end
else
return old_OnPicked(inst, taker, itemonshelf, ...)
end
end

end)
litlej86 1 Mar, 2019 @ 5:36pm 
this is the original code i have for the character. My goal is to harvest the lureplant without eyes retracting. i didnt know what would be easier to access it as an inventory or just make the lureplant drop all the items like killing it without actually killing it.
litlej86 1 Mar, 2019 @ 5:29pm 
i officially love you lol thanks i will try to utilize this and see what i get.
2basedJake  [author] 28 Feb, 2019 @ 8:21am 
The issue you talked about where if all this is done and the lureplant stays around, you get hundreds of meats is due to the fact that meat is spawned based on how many eyeplants exist, not any timer. If more than half of the possible eyeplants have spawned, it then spawns the meat. If the eyeplants stick around, it will infinitely instantly spawn meat. If you want a different behavior, consider changing this piece of code:

local function SelectLure(inst)
...
end

to something like:

local function SelectLure(inst)
...
if #lures >= 1 then
return lures[math.random(#lures)]
elseif inst.components.minionspawner.numminions * 2 >= inst.components.minionspawner.maxminions then
inst.task = DoTaskInTime(<insert time in seconds here>, SpawnMeat)
end
end
end
local function SpawnMeat(inst)
local meat = SpawnPrefab("plantmeat")
inst.components.inventory:GiveItem(meat)
return meat
end
2basedJake  [author] 28 Feb, 2019 @ 8:11am 
Oh wait. I just realized this is different than your end goal. All you should have to do to harvest the plant without the eyeplants going away is get rid of a couple of lines that reference these deaths.

Probably just remove
inst:RemoveEventCallback("onremove", inst._OnLurePerished, inst.lure)
as well as
inst.components.minionspawner.shouldspawn = false
inst.components.minionspawner:KillAllMinions()

in the OnPicked function, and

inst:ListenForEvent("onremove", inst._OnLurePerished, inst.lure)
in the HideBait function,
and possibly remove
inst:ListenForEvent("onremove", inst._OnLurePerished, inst.lure)
In the TryRevealBait function.
2basedJake  [author] 28 Feb, 2019 @ 8:00am 
Okay so if you want to make it act like a chest, you need to make at least the following changes to the lureplant prefab, maybe more:

May or may not need these
local function OnOpen(inst)
if not inst.components.health:IsDead() then
end
end

local function OnClose(inst)
if not inst.components.health:IsDead() and inst.sg.currentstate.name ~= "transition" then
end
end

Need this later:

inst:AddComponent("container")
inst.components.container:WidgetSetup("lureplant")
inst.components.container.onopenfn = OnOpen
inst.components.container.onclosefn = OnClose

Probably need to comment out any references to the shelf component otherwise it will conflict.
Delete inventory component and replace all references to it with "container"
Some of the similar components have different names, so you need to:
replace inventory.maxslots with container.numslots
replace inventory.itemslots with container.slots
2basedJake  [author] 28 Feb, 2019 @ 7:11am 
That is a pretty good idea. I am not super experienced with that sort of thing, but my strategy for learning would be to go look at the code for say, chester, or some other mod that has a living thing used as a chest and find a way to splice it into the lureplant code. I don't think it would be too hard to adapt chester's code depending on how they scripted him. I will look into it.
litlej86 27 Feb, 2019 @ 5:35pm 
i noticed you haven been on in forever lol. ok my question is i am currently fixing another mod that is suppose to let you harvest the lure without having the eyeplants withdraw. i could not get that to work. everytime i got the eyeplants to stay it would produce hundreds of leafy meat lol. so my new plan is to make it possible to simply walk up and harvest everything out of the lureplant without killing it. my thought was to add the death code into the code for harvesting. im just really stuck on that. i thought maybe you would have an idea that would maybe just let me click on a lureplant and open it like a chest.
2basedJake  [author] 25 Feb, 2019 @ 11:58am 
You can. I haven't really been on in months. I just started playing again. I can't promise I remember all the details but you can definitely ask.
litlej86 24 Feb, 2019 @ 6:58pm 
take that as a no lol
litlej86 26 Dec, 2018 @ 4:01pm 
Im trying to figure out some lure plant issues with a mod do you think i could get with you on a few questions?
󰀃貔貅󰀃 28 Jun, 2018 @ 9:06pm 
nice~
Fordring The Magnificent 28 May, 2018 @ 12:16pm 
Im so exciting for watching this mod
beacause i m lazy for collecting resources over and over:steamhappy:
sharktemplar 22 Apr, 2018 @ 5:19pm 
Mod seems to disconnect me from my own local host server with a "disconnected from server error" whenever I try to pick the lureplant meat, or the eye plants attack one-another or something else. Seeing as no one else in the comments reports this issue, and I have over 70+ active mods, just fair warning for anybody else, this mod is likely to be incompatible with your mod list. Only theory I have of why this occurs is perhaps because I have a mod that changes perish rate percentage for ice boxes, and this mod also modifies perish rate in different ways, or perhaps the "leafy meat crockpot ingredient" mod that changes the leafy meat to be 0.5 vegetable and 0.5 meat in food value. If it's not those, no clue what causes this, and unfortunately don't have the patience to cycle through all my mods, enabling one-by-one to troubleshoot. Glad I'm the only one with this problem though.
2basedJake  [author] 18 Apr, 2018 @ 4:27pm 
My only other ideas are to clear your modconfigdata or to re download the mod like unsubscribe then resubscribe after loading the game maybe.
I'm a Ghost   18 Apr, 2018 @ 4:21pm 
I have done that jake, 8 times, and it's never worked. xD
2basedJake  [author] 18 Apr, 2018 @ 4:07pm 
I think it only works if you start a new server with the mod on when it starts. You just set the hibernation time to zero and it should work when you plant the bulb. If that doesn't work I do not know how to fix it for you.
I'm a Ghost   18 Apr, 2018 @ 12:42pm 
Still have yet to see it instantly take root.. I've tried everything.
2basedJake  [author] 15 Mar, 2018 @ 12:25pm 
Yeah it does that now. Just set the perish percentage to 0% and the keep food fresh to yes. You will see that same result
Bugs Bunny 15 Mar, 2018 @ 12:22pm 
But man I love this mod 10/10
Bugs Bunny 15 Mar, 2018 @ 12:21pm 
As in Ds regular when they catch bird It´s alredy dead. 1 month ago I did this trick n DST and killed lureplant immediately...10 books just flew away :D
2basedJake  [author] 15 Mar, 2018 @ 12:16pm 
Do you mean kill the birds it eats as opposed to keeping them at low hunger but alive or instantly kill whatever comes near like say one hit kill Deerclops? I have just updated it with the option to make the eyeplants instant kill whatever they attack assuming this is what you want. Also, hi Willow. Thanks!
Update: I also made it so you can have it kill the birds immediately while keeping their meat fresh, in case that is what you were looking for.
Bugs Bunny 14 Mar, 2018 @ 6:19pm 
Can you add update where lure plants kill victim immediately? (wickerbottom) :steammocking:
miimyn 11 Mar, 2018 @ 11:41pm 
hiya Jake!
i hope you remember me,
i subscribed to this mod and its working great!
it really helps alot :)
2basedJake  [author] 25 Feb, 2018 @ 4:55pm 
Hm. I have never had any issues with it. I wonder what could cause this. Maybe it takes a while to activate on a pre-existing server? All that part does is change one of the settings in an in-game file, which at least when set to 0 has the roots instantly sprout for me.
I'm a Ghost   22 Feb, 2018 @ 5:29pm 
The hibernation part of the lure plant doesn't seem to work, I've tried setting it really low so it takes root immediatly, but it stil ltakes two ingame days reguardless of what i set it too.
2basedJake  [author] 13 Feb, 2018 @ 3:16pm 
Thanks a lot for the feedback. I am glad you are enjoying it. I had searched for a way to do this but I am not too familiar with it. The easiest solution was what I did, but I'll take a look. Thanks!
JustJasper 13 Feb, 2018 @ 8:14am 
Great tweaks for lureplants! Have you considered looking into adding these things (or as it were, removing these things) with AddPrefabPostInit? It can help improve mod compatibility instead of ovewriting the lureplant file. I can't walk you through it step by step (as I'm still learning how to use it) but it might be worth a search on the Klei forums!
I'm a Ghost   13 Feb, 2018 @ 12:29am 
this is great, thanks.