Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
do lureplants alery in a world are affected by this mod or do they just stay at default?
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)
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
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.
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
beacause i m lazy for collecting resources over and over
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.
i hope you remember me,
i subscribed to this mod and its working great!
it really helps alot :)