Deadlock beltbox crate-Space Exploration bridge

by Mernom

Provides stacking and or crating recipes for some Space Exploration items. Now compatible with SE v0.6!

Content
1 year, 3 months ago
0.17 - 1.1
28.6K
Logistics

b Bug in v0.4.21

3 years ago
(updated 3 years ago)

Updated from 0.4.12, now can't load:

113.236 Loading mod Deadlock-SE-bridge 0.4.21 (data-final-fixes.lua)
113.246 Error ModManager.cpp:1560: Failed to load mod "Deadlock-SE-bridge": Deadlock-SE-bridge/prototypes/external.lua:82: bad argument #1 of 5 to 'find' (string expected, got table)
stack traceback:
[C]: in function 'find'
Deadlock-SE-bridge/prototypes/external.lua:82: in main chunk
[C]: in function 'require'
Deadlock-SE-bridge/prototypes/stacking.lua:5: in main chunk
[C]: in function 'require'
Deadlock-SE-bridge/data-final-fixes.lua:3: in main chunk
113.254 Loading mod core 0.0.0 (data.lua)
115.937 Checksum for core: 1132143427
116.001 Error ModManager.cpp:1560: Error in assignID: recipe-category with name 'crafting' does not exist.

3 years ago

Same here, same error and stacktrace

3 years ago

Debugging in to it, this code is where it is crashing (on the find call):

    for name, fragment in pairs (data.raw.item) do
        if string.find (fragment, "core-fragment", 1, true) then
            table.insert (external, {data_util.mod_prefix .. "core-fragment-" .. name, false, 3, false, remove_extra_layers = "core-fragment"}) 
        --else
            --log ("didn't find "..data_util.mod_prefix .. "core-fragment-" .. name)
        end
    end

At the time of the crash name is: item-unknown
And the fragment is:

{
  flags = {
    "hidden"
  },
  icon = "__core__/graphics/icons/unknown.png",
  icon_size = 64,
  name = "item-unknown",
  stack_size = 1,
  type = "item"
}

I'm not actually sure how that was supposed to work, fragment is a table, which is invalid as a first argument in string.find, perhaps the first argument should have been name?

3 years ago

It looks like in the older mod version that this loop did not exist at all.

3 years ago

bah, I knew I shouldn't have released an untested version... Earler version of that function looked at the global core fragment table, but I don't think it's really useful for finding all core fragments.

Proper fix will be tomorrow, for now I'm unlisting the update.

3 years ago

Lol, happens to us all, thanks for the work, much appreciated! :-)

For note, the game 'loads' when it's changed to string.find(name, ...) but I'm unsure if that's the logic you were going for, game works at least.

3 years ago
(updated 3 years ago)

string find has 4 parameters, the 4th allows you to read the input as plain string (so it ignores special characters).
but to get to it, I need to specify the third (where to start searching). The part where I look up the items was written up in a hurry, since I just uploaded .20, and found out that my assumption that SE's core fragment table would contain references to all of the core fragments in the game was wrong. And I didn't have access to the game to test if it actually works correctly.

3 years ago

Should be fixed, hopefully for good.

3 years ago

You're awesome, thanks much!!

This thread has been locked.