AAI Loaders - Stacking and Filtering


Adds stacking- and lane-filtering- capable variants of AAI Loaders

Content
11 months ago
2.0
3.73K
Logistics

b Crash on load with AdvancedBeltsSA

2 months ago
   6.092 Error ModManager.cpp:1765: Failed to load mod "aai-loaders-stacking-filtering": __aai-loaders-stacking-filtering__/prototypes/stacking.lua:45: attempt to index local 'orig_tech' (a nil value)
stack traceback:
        __aai-loaders-stacking-filtering__/prototypes/stacking.lua:45: in function 'generate_tech'
        __aai-loaders-stacking-filtering__/prototypes/stacking.lua:71: in function 'make_stacking'
        __aai-loaders-stacking-filtering__/data.lua:24: in main chunk

In make_stacking when it crashes I notice that item.name is aai-extreme-loader-stacking and orig_item.name is aai-extreme-loader. aai-extreme-loader is added by the AdvancedBeltsSA mod, which adds 3 more tiers of belts/loaders/etc above AAI Loaders and Vanilla belts. It does have a technology and that technology is named extreme-logistics, which includes the extreme belt, extreme underground belt, extreme balancer, extreme loader, and extreme lane balancer. It does not have a technology for 'just' the loader as it is part of the Logistics 5 group, just as all loaders are grouped with their relevant tier group (Logistics 1 include the normal loader, Logistics 2 includes the fast loader, etc..., though these vanilla ones are fixed up in the post data stage by another mod). It doesn't seem reasonable to expect a technology to be the same name as an item that the technology unlocks as a technology can unlock many items, so which one should it be named for if that were the case? So this seems like a bug on this side.

A more correct operation would probably be to iterate the data.raw["loader-1x1"] table once to generate your matching items, then iterate the data.raw.technology table and any entry with an unlock-recipe effect that matches that items name (it is expected to assume the 'main' recipe of an item to be the same name as that item, though not all mods hold to that, all of these specific ones do though) and add your recipes to that same technology I would think?

6 days ago
(updated 6 days ago)

The problem is likely that this mod expects a specific technology name (specified in the mod parameters), and if that technology doesn't exist, it creates one, for example, "aai-extreme-logistics." However, since the "AdvancedBeltsSA" mod hardcodes the technology when creating loader levels, for example:

technology = { name = "extreme-logistics" }

then the current mod throws this error because the specified technology doesn't meet the requirements.


But if in the "AdvancedBeltsSA" mod you specify the parameters as in the template instead of the hard-coded technology, for example:

technology = {
    prerequisites = { "turbo-transport-belt", "aai-turbo-loader", "electromagnetic-science-pack" },
    unit = {
        count = data.raw.technology["extreme-logistics"].unit.count / 2,
        ingredients = data.raw.technology["extreme-logistics"].unit.ingredients,
        time = data.raw.technology["extreme-logistics"].unit.time / 2
    }
}

then the current mod will pick up these parameters, create the "aai-extreme-logistics" technology, and, in fact, create the loader levels. So, it might be worth asking the mod author "AdvancedBeltsSA" to fix the loader templates, test them, and release an update.

New response