饥荒联机版

饥荒联机版

The Lure Plant Mod
42 条留言
cnb torture 2023 年 4 月 21 日 下午 2:51 
question
do lureplants alery in a world are affected by this mod or do they just stay at default?
2basedJake  [作者] 2021 年 4 月 25 日 上午 7:45 
No problem!
FilipeSD 2021 年 4 月 24 日 下午 6:07 
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 2021 年 4 月 23 日 下午 5:42 
Hum... I will try this. Maybe tomorrow I can play, and then I give you an answer. For now, thank you so much!
2basedJake  [作者] 2021 年 4 月 23 日 上午 8:25 
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 2021 年 4 月 22 日 下午 8:32 
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  [作者] 2021 年 4 月 22 日 下午 7:10 
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 2021 年 4 月 22 日 下午 3:25 
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  [作者] 2021 年 4 月 22 日 上午 9:18 
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 2021 年 4 月 10 日 下午 12:43 
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 2021 年 3 月 28 日 下午 12:56 
An incredible mod. Thank you so much!
Noro 2020 年 8 月 22 日 上午 10:15 
wow i like this, my farmable plant plus one
litlej86 2019 年 3 月 1 日 下午 5:40 
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 2019 年 3 月 1 日 下午 5:39 
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 2019 年 3 月 1 日 下午 5:36 
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 2019 年 3 月 1 日 下午 5:29 
i officially love you lol thanks i will try to utilize this and see what i get.
2basedJake  [作者] 2019 年 2 月 28 日 上午 8:21 
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  [作者] 2019 年 2 月 28 日 上午 8:11 
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  [作者] 2019 年 2 月 28 日 上午 8:00 
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  [作者] 2019 年 2 月 28 日 上午 7:11 
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 2019 年 2 月 27 日 下午 5:35 
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  [作者] 2019 年 2 月 25 日 上午 11:58 
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 2019 年 2 月 24 日 下午 6:58 
take that as a no lol
litlej86 2018 年 12 月 26 日 下午 4:01 
Im trying to figure out some lure plant issues with a mod do you think i could get with you on a few questions?
󰀃貔貅󰀃 2018 年 6 月 28 日 下午 9:06 
nice~
Fordring The Magnificent 2018 年 5 月 28 日 下午 12:16 
Im so exciting for watching this mod
beacause i m lazy for collecting resources over and over:steamhappy:
sharktemplar 2018 年 4 月 22 日 下午 5:19 
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  [作者] 2018 年 4 月 18 日 下午 4:27 
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   2018 年 4 月 18 日 下午 4:21 
I have done that jake, 8 times, and it's never worked. xD
2basedJake  [作者] 2018 年 4 月 18 日 下午 4:07 
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   2018 年 4 月 18 日 下午 12:42 
Still have yet to see it instantly take root.. I've tried everything.
2basedJake  [作者] 2018 年 3 月 15 日 下午 12:25 
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 2018 年 3 月 15 日 下午 12:22 
But man I love this mod 10/10
Bugs Bunny 2018 年 3 月 15 日 下午 12:21 
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  [作者] 2018 年 3 月 15 日 下午 12:16 
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 2018 年 3 月 14 日 下午 6:19 
Can you add update where lure plants kill victim immediately? (wickerbottom) :steammocking:
miimyn 2018 年 3 月 11 日 下午 11:41 
hiya Jake!
i hope you remember me,
i subscribed to this mod and its working great!
it really helps alot :)
2basedJake  [作者] 2018 年 2 月 25 日 下午 4:55 
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   2018 年 2 月 22 日 下午 5:29 
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  [作者] 2018 年 2 月 13 日 下午 3:16 
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 2018 年 2 月 13 日 上午 8:14 
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   2018 年 2 月 13 日 上午 12:29 
this is great, thanks.