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
2 days ago
0.14 - 1.1
21.0K
Logistics

b crash in the game

3 months ago

I have upgraded to this last version from old one (not previous). After game loaded it starts lagging (avg once per second).
I have enabled logs, and see, it checks entities, some of them detected as invalid ("obj XXX in DB TrackedSlot invalid. Destroying..."), but looks like it works.
So, I started to move and tried to place Factorissimo2-fork factory on the surface and get a crash.


The mod Ammo Loader+ (1.1.31) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event ammo-loader::on_selected_entity_changed (ID 54)
ammo-loader/lib/TrackedSlot.lua:1101: bad argument #4 of 6 to 'format' (number expected, got nil)
stack traceback:
[C]: in function 'format'
ammo-loader/lib/TrackedSlot.lua:1101: in function 'highlightEnt'
ammo-loader/lib/Handlers.lua:482: in function 'onPlayerSelectionChangedRenderSlot'
ammo-loader/lib/Handlers.lua:439: in function 'func'
ammo-loader/lib/Handlers.lua:40: in function <ammo-loader/lib/Handlers.lua:31>


The last message in the output is:
slot 1: id-> XXX | sourceID -> XXX | filterItem-> processed-fuel

3 months ago
(updated 3 months ago)

Consumes a lot of UPS with: "obj XXX in DB TrackedSlot invalid. Destroying..." — even without game migration.
I have created a new game and got these lags with this message in the output. The old mod version was without this issue. =(

3 months ago
(updated 3 months ago)

Got another crash on the new game after loading.
Started with the mod v1.1.31, saved, and loaded with v1.1.32... :( unplayable


The mod Ammo Loader+ (1.1.32) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event ammo-loader::on_selected_entity_changed (ID 54)
ammo-loader/lib/TrackedSlot.lua:1101: bad argument #4 of 6 to 'format' (number expected, got nil)
stack traceback:
[C]: in function 'format'
ammo-loader/lib/TrackedSlot.lua:1101: in function 'highlightEnt'
ammo-loader/lib/Handlers.lua:483: in function 'onPlayerSelectionChangedRenderSlot'
ammo-loader/lib/Handlers.lua:440: in function 'func'
ammo-loader/lib/Handlers.lua:40: in function <ammo-loader/lib/Handlers.lua:31>

3 months ago

replaced TrackedSlot.lua:1101 with following line to check what going on:
cInform(string.format('slot %s: id->%s | sourceID->%s | filterItem->%s', tostring(ind), tostring(slot.id), tostring(slot:sourceID()), tostring(slot:filterItem())))

(safe for NILs)

3 months ago
(updated 3 months ago)

Честно говоря я офигел просматривая код - русские комменты, и постоянное пересоздание сущностей: я повесил логинг на вставку в DB — и получаю, что постоянно что-то вставляется, и удаляется прежняя сущность (прежний ID)...

Т.е. вставляется 10, удаляется 9, вставляется 11, удаляется 10... и так без конца.
На всю эту деятельность сжирается 11-15 UPS.

Я сначала думал что виноваты постоянно двигающиеся Companion (из соответствующего мода), но отключив мод - я не получил прироста UPS, а логи так же загажены пересозданием.

Потом я отрубил SE & AAI (из-за подвижных авто) — и тут спам с пересозданием прекратился. Продолжаю локализацию проблемы...

3 months ago

Короче тут чтото с AAI машинами, не с SE.

3 months ago

хз, вроде то проходит, то появляется (лаги).

Пока просто в будущем билде добавь безопасный вывод в лог:

replaced TrackedSlot.lua:1101 with following line to check what going on:
cInform(string.format('slot %s: id->%s | sourceID->%s | filterItem->%s', tostring(ind), tostring(slot.id), tostring(slot:sourceID()), tostring(slot:filterItem())))

(safe for NILs)

2 months ago

Hi again! Thanks for reporting this!

I don't suppose I could get you to upload a save file? It helps a lot when troubleshooting issues.

Thanks in advance!

2 months ago

I don't have that problem now, and I don't have a save file with it.
I will provide the save in the next time if I can reproduce this.

Anyway fix that logging line above:

replaced TrackedSlot.lua:1101 with following line to check what going on:
cInform(string.format('slot %s: id->%s | sourceID->%s | filterItem->%s', tostring(ind), tostring(slot.id), tostring(slot:sourceID()), tostring(slot:filterItem())))

some of your values for %d pattern can be nils - it is not safe if you pass nils there

2 months ago

I just released version 1.1.33 that implements the fix you're talking about. It also includes some changes to hopefully mitigate the UPS issue, although I was not able to reproduce this myself.

The next time you notice it causing UPS issues, if you could upload a save file it would help narrow down the problem quite a bit.

Let me know if you have any other issues!

New response