Ammo Loader+


More than just a turret loader. Auto load everything from turrets to artillery wagons to furnaces and even the player themselves. Auto upgrade ammo and fuel without tedious manual replacement. Infinite range and compatible with Factorissimo2.

Content
16 days ago
0.14 - 1.1
21.2K
Logistics

b error /control.lua:248: attempt to contatenate field

6 years ago

With no other mods loaded while running 0.15, if I create your chest and a standard turret, then add normal rounds to the turret and box, then open the ammo box and press the red X to eliminate all but one available slot in the box, then I remove the normal ammo from the box and replace it with piercing ammo ... the piercing ammo makes it into the turret but the normal ammo doesn't make it back into the ammo box and I get the following error. I believe this is because I blocked out the extra slots in the box and there is nowhere for the normal ammo (that is being replaced) to return to the ammo box.

quote
Error while running event ammo-loader::on_tick (ID 0) ammo-loader/control.lua:248 attempt to concatenate field 'name' (a nil value)
/quote

If I comment out the line 248 in control.lua (found below) then this error goes away.

inform("??? magically gained "..(amt_old_lost*-1).." "..base_item.name.." while upgrading to "..chest_item.name)

6 years ago

Thanks for the heads up, yeah i can see why that error is happening. I put that debugging line there because i couldnt think of any situation where those conditions would be met, but you found a way haha. I'll see about uploading a hotfix, maybe put those items into player inventory in that case.

Good job on the debugging btw, most players would never take the time. Makes my job a lot easier ^_^

5 years ago

Let me start by saying I love your mod. First time I have had an issue. Just got back to the game after a month and updated all the mods.....when I try to load a save that heavily depends on this mod I get

Error while running on_load:ammo-loader/control.lua.55:attempt to index a nul value

Any ideas? Not a huge modder here but know my way around Notepad++ if I need to change something.

5 years ago

Hm yeah I know what the problem is, the new version sets up a bunch of metatables during on_load that weren't present in the old version. Hopefully it will be an easy fix, I'm looking into it now.

This thread has been locked.