MoreBiters


Adds more variety to biters.

Content
6 years ago
0.16
29
Enemies

b Critical error

6 years ago

Error when I try kill biters after update:

Error while running event
MoreBiters::on_entity_damaged (ID 97)
MoreBiters/control.lua:117: attempt to perform arithmetic on field '?' (a nil value)

Screen: https://prnt.sc/jp30on

6 years ago

same

6 years ago

Hi, I took a quick look at this and have spotted the problem and let the mod author know.

It's a quick fix you can make on your own if you want to though. Open the MoreBiters mod folder and open the control.lua file in a text editor. Then at the bottom of the file add this:

script.on_configuration_changed(
function()
game.print("Checking More Biters global vars...")
if (global[PREFIX .. "shiftTick"]==nil) then
global[PREFIX .. "shiftTick"] = 0
end
if (global[PREFIX .. "shiftTick2"]==nil) then
global[PREFIX .. "shiftTick2"] = 0
end
if (global[PREFIX .. "-mimic-counter"]==nil) then
global[PREFIX .. "-mimic-counter"] = 1
end
end
)

Then reload your last working save (from the previous version)

*If you don't have a save from the last working version (ie, you made a save since installing the 1.2.2 update) you can force the on_configuration_change script to run by turning another mod off or on temporarily. (eg evogui works well)

Alternatively you can wait for the author to update and you won't need to do anything but install the new version :)

6 years ago
(updated 6 years ago)

Thanks for the fix warped_jack. It was indeed the new global vars causing these issues.

Fixed in 1.2.3

6 years ago

Cool no problem.

I noticed a small bug in the changes I implemented in the clearLeechDrains() function. It doesn't actually pass the leech spitter that died as an argument, so every time anyone kills a single leech spitter, all the drain entities get destroyed :) My bad!

Your original code had the correct logic - pass in the entity as an argument (ie clearLeechDrains(entity)) and then throw an if statement around lines 108 and 109 where we check for the entity in the drains table.

so it reads:

function clearLeechDrains(entity)
for _, struct in pairs(global[PREFIX .. "leech-drains"]) do
if (struct[1] == entity) then
struct[2].destroy()
struct = nil
end
end
end

Then of course update the clearLeechDrain function call in the onDie function.

There's no performance hit compared to how it is now, but the drains certainly last a lot longer now! :D doh!

6 years ago

Thanks! 1.3.0.

New response