Reverse Factory

by Kryzeth

Reverse Factory machine will recycle (uncraft) nearly any item placed inside. Supports the recycling of most, if not all, modded items. Fully featured integration with Bobs Mods, Industrial Revolution, and Fantario (independently, not simultaneously)

Content
10 hours ago
0.13 - 2.0
62.6K
Manufacturing

b [Fixed] crash when cut reverse factory entity

7 months ago

Error while running event reverse-factory::on_tick (ID 0)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
[C]: in function 'index'
__reverse-factory
/control.lua:14: in function 'checkinvs'
reverse-factory/control.lua:84: in function <reverse-factory/control.lua:79>

7 months ago

Do you have any mods that are affecting surfaces? Like Space Exploration or Warptorio?

7 months ago

I realized that I missed a few events in my last upload, and misunderstood what Warptorio was doing, so I fixed a couple of minor issues, that should hopefully prevent the crashes. Should be fixed as of v8.2.6

7 months ago

I'm getting the exact same error:
The mod Reverse Factory (8.2.6) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event reverse-factory::on_tick (ID 0)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
[C]: in function 'index'
__reverse-factory
/control.lua:14: in function 'checkinvs'
reverse-factory/control.lua:84: in function <reverse-factory/control.lua:79>

I have SEK2 + Blueprint Sandboxes, which is where it crashes when deconstructing a Reverse Factory 3. There haven't been any issues previously removing factories from other surfaces. I tested now and Reverse Factory 4 doesn't crash on Nauvis.

I just now notieced 'Reverse Factory-Space Exploration Postprocess Fix' and haven't installed it yet.

I can send my full mod list, just let me know how to best generate that for you.

7 months ago

I'm not sure if that mod will change anything in this particular situation (it's mostly for on-load issues with reverse recipes), but it sounds like I might have missed an event regarding Blueprint Sandboxes, or it could be something to do with surfaces that I missed in Space Exploration. I'll try to look into this later tonight.

If you can provide the save file, that would be massively helpful, since I haven't found a way to easily do Space Exploration things in sandbox mode, so I can't really test the different surfaces myself

7 months ago

Sure! Here is the link: https://drive.google.com/file/d/1c4PxnIlzNAmf3uomQ58cwSAkDbUD0J41/view

It's the faction Starfire. Blueprint Sandbox (Default keybind is Shift+B), on the 'My Force's Planetary Lab'.

7 months ago

Alright, as soon as I have access to it, I'll check it out, thanks!

7 months ago

Oops, done!

7 months ago

Alright, that was incredibly helpful, very quick and easy to debug; it seems the issue was specifically related to Blueprint Sandbox, and the way they were handling the deconstruction planner when in the sandbox.

I have the list of recyclers listed per surface and checked on a certain timer for the auto-ingredient push, and whenever one is removed in some way, they also need to be removed from the list, so I have checks for when they are mined by player, deconstructed by bot, and destroyed from damage (the standard vanilla methods), but there's also a custom script-based "destroy" command that I didn't account for, so the mod was checking for an entity that no longer existed.

Glad to know that all my custom surface code was actually working perfectly; all I had to do was add another check for that possibility, and should be fixed as of 8.2.7!

7 months ago
(updated 7 months ago)

Further! Was able to selectively remove 2 with no crash, further than before! However, when selecting My Force's PLanetary Lab, Reset (Button to the left of the drop down), it gave the following error.

The mod Reverse Factory (8.2.7) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event reverse-factory::on_tick (ID 0)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
[C]: in function 'index'
__reverse-factory
/control.lua:14: in function 'checkinvs'
reverse-factory/control.lua:84: in function <reverse-factory/control.lua:79>

Likely unrelated, updated the following to:
compaktcircuit - 1.1.3
flib - 0.14.0

ps sorry for the delay, thanks for working on this! <3

7 months ago

Alright, ran into another surface-related event I hadn't seen yet, "clearing" a surface, which obviously wipes all entities from the surface, which means the script would be attempting to check the inventories of entities that no longer exist. It took a bit of testing (since the surface had to be removed in one event, and then re-added in a different event), but I think it should be working perfectly as of v8.2.8

And no worries, I'll be glad if it finally works lol

7 months ago

Uh oh, not sure what happened here. >.< Below is what came up in the logs. I've created a new folder and shared it with you. Inside is the save file and current server logs dated 2024-04-03. Let me know if there's anything else I can provide!

45.816 Error ServerMultiplayerManager.cpp:92: MultiplayerManager failed: "The mod Reverse Factory (8.2.8) caused a
non-recoverable error.
Please report this error to the mod author.

Error while running event reverse-factory::on_load()
reverse-factory/control.lua:52: attempt to index global 'game' (a nil value)
stack traceback:
reverse-factory/control.lua:52: in function 'scanworld'
reverse-factory/control.lua:71: in function <reverse-factory/control.lua:70>"
45.816 Info ServerMultiplayerManager.cpp:814: updateTick(4294967295) changing state from(CreatingGame) to(Initializ
ationFailed)

7 months ago
(updated 7 months ago)

Yup, fixed one thing and broke another; but thanks to you and the many others who reported the issue, I know exactly what broke. Should be fixed v8.2.9!

7 months ago

haha oops. :P

HURRAY!!! NO CRASHIE! <3 We're no longer getting an error! Thank you very much! :) I'm not the original poster, but as far as I'm concerned, this is resolved. Thanks again! :) Iz a good mod. <3

New response