🌐 Planetaris: Arig

by Syen_ce

Arig, a hot planet with vast deserts where only valuable resources can be found underground or in the sand.

Content
a month ago
2.0 - 2.1
34.1K
Factorio: Space Age Icon Space Age Mod
Planets Transportation Logistics Environment Mining Fluids Logistic network Manufacturing Power Storage

g Loaders Modernized loading error

3 days ago

================================================================================
BUG REPORT 1: Planetaris: Arig (planetaris-arig 1.1.47)
Target Mod Portal Page: https://mods.factorio.com/mod/planetaris-arig/discussion
================================================================================

Subject: [1.1.47] Crash & upgrade loop with Loaders Modernized + Krastorio 2 Spaced Out (compat/loaders-modernized.lua)

Hi! I found a few bugs in compat/loaders-modernized.lua when using Planetaris: Arig together with loaders-modernized, loaders-modernized-integrations, and Krastorio2-spaced-out:

  1. Startup Crash (hyper-underground-belt does not exist):
    In compat/loaders-modernized.lua (line 34), kr_loader_recipe.ingredients uses "hyper-underground-belt" instead of "planetaris-hyper-underground-belt", which causes a startup error:
    Error in assignID: item with name 'hyper-underground-belt' does not exist. At ROOT.recipe.mdrn-superior-loader.ingredients[0].name
    Also, if the mdrn-use-k2-recipes setting is enabled, mdrn-superior-loader uses kr-superior-transport-belt + 2x mdrn-hyper-loader instead of underground belts.

  2. Inverted next_upgrade on mdrn-superior-loader & MdrnLoaders.add_loaders Execution Order:

  3. Line 28 sets kr_loader.next_upgrade = "mdrn-hyper-loader" on mdrn-superior-loader, which points Superior (tier 6, speed 0.1875) backwards to Hyper (tier 5, speed 0.15625) instead of upgrading mdrn-hyper-loader -> mdrn-superior-loader.
  4. MdrnLoaders.add_loaders(loaders) is called at the bottom of the file after the if mods["Krastorio2-spaced-out"] block, and "superior-" still has upgrade_from_tier = "turbo-" in loaders-modernized-integrations. Updating "superior-" via MdrnLoaders.add_loaders with upgrade_from_tier = "hyper-" and order = "07" properly links all loader variants (-split, -fill, etc.) and updates the item order.

  5. Self-Dependency in Technology (unlocked_by in loaders["hyper-"]):
    Setting both prerequisite_techs = { "planetaris-hyper-transport-belt", "mdrn-turbo-loader" } and unlocked_by = "planetaris-hyper-transport-belt" causes loaders-modernized (prototypes/loader/technology.lua) in default "separate" tech mode to modify planetaris-hyper-transport-belt in-place and set its prerequisites to include "planetaris-hyper-transport-belt" itself (instead of creating the "mdrn-hyper-loader" tech expected by mdrn-superior-loader). Removing unlocked_by = "planetaris-hyper-transport-belt" fixes both "separate" and "belt" tech unlock modes.

  6. Missing check for disable-hyper-belts startup setting:
    compat/disable-hyper-belts.lua runs before compat/loaders-modernized.lua in data-final-fixes.lua, so if disable-hyper-belts is true, compat/loaders-modernized.lua still tries to modify mdrn-superior-loader to require mdrn-hyper-loader.

Suggested Fix (compat/loaders-modernized.lua):

if not mods["loaders-modernized"] or (settings.startup["disable-hyper-belts"] and settings.startup["disable-hyper-belts"].value == true) then return end

local loaders = {
    ["hyper-"] = {
        below_turbo = false,
        order = "06",
        tint = util.color("e8e8e8d1"),
        prerequisite_techs = { "planetaris-hyper-transport-belt", "mdrn-turbo-loader" },
        upgrade_from_tier = "turbo-",
        underground_name = "planetaris-hyper-underground-belt",
        recipe_data = {
            surface_conditions = {
                {
                    property = "planetaris-dust-concentration",
                    min = 50,
                    max = 100,
                }
            },
            ingredients = {
                { type = "item", name = "planetaris-hyper-underground-belt", amount = 1 },
                { type = "item", name = "mdrn-turbo-loader",                 amount = 1 },
                { type = "item", name = "planetaris-silica",                 amount = 15 },
            }
        }
    }
}

MdrnLoaders.add_loaders(loaders)

if mods["Krastorio2-spaced-out"] and data.raw["loader-1x1"]["mdrn-superior-loader"] then
    local use_k2_recipes = settings.startup["mdrn-use-k2-recipes"] and settings.startup["mdrn-use-k2-recipes"].value
    local superior_ingredients = use_k2_recipes and {
        { type = "item", name = "kr-superior-transport-belt", amount = 1 },
        { type = "item", name = "mdrn-hyper-loader",          amount = 2 },
        { type = "item", name = "kr-imersium-gear-wheel",     amount = 10 },
    } or {
        { type = "item", name = "planetaris-hyper-underground-belt", amount = 1 },
        { type = "item", name = "mdrn-hyper-loader",                 amount = 1 },
        { type = "item", name = "kr-imersium-gear-wheel",            amount = 10 },
    }

    MdrnLoaders.add_loaders({
        ["superior-"] = {
            order = "07",
            underground_name = "kr-superior-underground-belt",
            upgrade_from_tier = "hyper-",
            prerequisite_techs = { "kr-logistic-5", "mdrn-hyper-loader", "planetaris-hyper-transport-belt" },
            recipe_data = {
                ingredients = superior_ingredients,
            }
        }
    })
end
3 days ago

im not a modder/coder myself, i used ai to help get things running, i just wanted to share the results

a day ago

I will check it out, Thanks!

a day ago

Theres a PR for it, looks like

New response