Deadlock's Stacking Beltboxes & Compact Loaders


Adds minimalist 1x1 loaders and stacking beltboxes for 5x belt compression for ores, plates and some intermediate products

Content
16 days ago
0.17 - 2.0
102K
Logistics

b Public API crash

4 years ago
(updated 4 years ago)

Trying to add stacks to ur mod, and some of them unlockable in new technologies of new beltboxes (because Krastorio 2 have two new belt tiers so I have create two new beltboxes with ur API):

Failed to load mods: __Krastorio2__/data.lua:70: __deadlock-beltboxes-loaders__/prototypes/create_stack.lua:173: attempt to index field '?' (a nil value)
stack traceback:
    __deadlock-beltboxes-loaders__/prototypes/create_stack.lua:173: in function 'add_stacks_to_tech'
    __deadlock-beltboxes-loaders__/prototypes/public.lua:196: in function 'add_stack'
    ...ompatibility-scripts/data/deadlock-beltboxes-loaders.lua:6: in function 'krCreateStacks'
    ...ompatibility-scripts/data/deadlock-beltboxes-loaders.lua:114: in main chunk
    [C]: in function 'require'
    __Krastorio2__/data.lua:70: in main chunk
stack traceback:
[C]: in function 'require'
__Krastorio2__/data.lua:70: in main chunk

Investigating inside ur mod seems that in deadlock-beltboxes-loaders/prototypes/shared.lua doesn't exist the function DBL.add_stacks_to_tech(...), that is trigger only if some one specify target_tech in deadlock.add_stack(..., target_tech, ...)

4 years ago
(updated 4 years ago)

Trying to understand better the problem I see that this call:

deadlock.add_tier(
{
    transport_belt      = "advanced-transport-belt",
    colour              = {r=76, g=232, b=48, a=250},
    underground_belt    = "advanced-underground-belt",
    splitter            = "advanced-splitter",
    technology          = "kr-logistic-4",
    order               = "d",
    loader_ingredients  = 
    {
        {"express-transport-belt-loader", 1},
        {"steel-gear-wheel", 50},
        {"steel-plate", 20}
    },
    beltbox_ingredients = 
    {
        {"express-transport-belt-beltbox", 1},
        {"steel-gear-wheel", 50},
        {"steel-plate", 20}
    },
    beltbox_technology = "deadlock-stacking-4"
})
krastorio.technologies.addPrerequisite("deadlock-stacking-4", "deadlock-stacking-3")

That I do for create the beltbox, doesn't create the technology: "deadlock-stacking-4"

4 years ago

Solved, my fault, u can archive this post.
Anyway my problem come from the fact that I have to grind inside ur code to understand what name the items have, I suggest u to explicitly write somewhere what name they have.

4 years ago

Naming it stacking 4 might cause compatability issues if other mods add it as well, since it's a fairly generic name

New response