Beyond Belts

by knniDE

Adds 3 belt tiers past Turbo: Hyper (90/s), Extreme (120/s), and Ultimate (150/s). Includes splitters and underground belts, with loader support for multiple mods. Lane splitters are provided automatically when the Lane Balancers mod is installed.

Content
a month ago
2.0 - 2.1
1.09K
Logistics

g Not working with Black Rubber Belts

a month ago

Mod gets an error message that a .png file is missing when trying to launch with Black Rubber Belts - Remastered enabled.

a month ago
(updated 3 days ago)

Hello, I'm the maintainer of Black Rubber Belts - Remastered.
I changed how the code works in v2.4.0 so belts can display both stripes and arrows at once, and split off tier dependency too. This is why Beyond Belts doesn't work anymore, because they handle the compatibility by themselves and didn't notice the change in the 2.1 compatible versions.

Practically speaking, the "arrow-style" setting has been split into 3 settings: "arrow-style", "tier-style" and "stripe-style".

  • "arrow-style" values: "no-arrows", "arrow"
  • "tier-style" values: "tier-based", "single", "doubled", "quadrupled"
  • "stripe-style" values: "no-stripe", "stripe-thick", "stripe-thin", "stripe-side", "full-paint", "prismatic"

BRBR now overlays sprites like so: base > colored rails (if enabled) > stripe (if enabled) > arrow (if enabled, modified by belt tier and "tier-style" setting).
For some stripe styles ("stripe-thick", "full-paint"), the arrows are tinted black instead so they stand out properly.

While I appreciate the effort taken by Beyond Belts to integrate itself with BRBR all on its own, I wouldn't mind handling the compatibility on my end to save you time and effort.

In the meantime LordAnkou, if you are playing on Factorio 2.1, you may use version 2.3.7 of Black Rubber Belts to keep playing with Beyond Belts while waiting for a fix.

4 days ago
(updated 4 days ago)

Currently the issue seems to be a type mismatch rather than a missing texture....

Failed to load mods: black-rubber-belts-remastered/code/functions.lua:60: attempt to concatenate local 'suffix' (a boolean value)
stack traceback:
black-rubber-belts-remastered/code/functions.lua:60: in function 'get_belt_animation'
black-rubber-belts-remastered/code/functions.lua:93: in function 'get_belt_animation_set'
...rototypes/integrations/black-rubber-belts-remastered.lua:33: in main chunk
[C]: in function 'require'
beyond-belts/data.lua:26: in main chunk

All I can see at line 33 in integrations is that stripe_glow appears to be missing from the call to get_belt_animation_set, and get_belt_animation_set.alternate immediately below is maybe missing a couple of Or options - arrows, arrow-doubled and no-arrows, specifically?
L26 in Data is just a require() call so I don't think it's there, and 60 and 93 in BRBRs functions definitions work fine when Beyond Belts isn't active; I'm fairly confident that it's on BB's side - just a handful of missing option checks from L33 onwards.

2 days ago
(updated 4 hours ago)

I think I've fixed it? I need to diff the original and patched file to give a full list of what was changed, but I have it running in an instance now. I don't have an especially convenient way to send a PR or fixed integrations file because this mod's source code repo appears to be blocked in my country... As both knniDE and Supershadow30 have published their mods as MIT mods I could submit a fork to the portal and refer either of you to it but that seems an awkward way to do it.

Edit: Turns out it fits into a comment; see updated ..\integration\black-rubber-belts-remastered.lua below. Hand-written, tested to work for a number of BRBR Startup Configs.

4 hours ago
-- Integration: Black Rubber Belts - Remastered (Factorio 2.0+ successor to DeadlockBlackRubberBelts).
-- The remastered mod has built-in compat for legacy fork IDs (AdvancedBeltsSA, AdvancedBeltsSA-VL),
-- but it looks for the old prototype names and mod IDs. Our bb-prefixed tiers are invisible to it,
-- so we register them ourselves the same way it handles vanilla belts internally.

if not mods["black-rubber-belts-remastered"] then return end

local IR2RB = require("__black-rubber-belts-remastered__.code.functions")
local tiers = require("tiers").list
local color = require("tiers").color

local rail_style      = settings.startup["rail-style"].value    -- ~ Re-sorted.
local alt_bases       = (rail_style == "ir3-alt")
local arrow_glow      = settings.startup["arrow-glow"].value
local arrow_style = (settings.startup["arrow-style"].value).."-"..(settings.startup["tier-style"].value == "tier-based" and beltdata.tier or settings.startup["tier-style"].value)
local rail_glow       = settings.startup["rail-glow"].value
local stripe_style    = settings.startup["stripe-style"].value  -- + Added.
local stripe_glow     = settings.startup["stripe-glow"].value   -- + Added.

for _, t in ipairs(tiers) do
  -- Convert our 0-255 colour to 0-1 floats expected by the remastered API.
  local c    = color[t.name]
  local tint = {r = c.r / 255, g = c.g / 255, b = c.b / 255, a = (c.a or 255) / 255}
  local base = alt_bases and "tungsten" or "steel"

  -- Apply belt animation set
  local belt = data.raw["transport-belt"][t.name .. "-belt"]
  belt.belt_animation_set.animation_set = IR2RB.get_belt_animation_set(tint, base, arrow_style, stripe_style, arrow_glow, rail_glow, stripe_glow)
  if string.find(arrow_style, "quadrupled") then
      belt.belt_animation_set.alternate = true
  else
      belt.belt_animation_set.alternate = false 
  end -- Ported from BRBR Implementation
  belt.corpse = "small-remnants"

  -- Replace icons on the item, then mirror onto the entity
  IR2RB.replace_item_icon(t.name .. "-belt", "rubber-belt-" .. base)

    -- Add stripes to the belt icon if they're active
    if (settings.startup["stripe-style"].value ~= "no-stripe") then
        IR2RB.add_mask_to_item_icon(t.name .."-belt", "rubber-belt-mask-"..(settings.startup["stripe-style"].value), tint)
    end
    -- Add arrows to the belt icon if they're active
    if (settings.startup["arrow-style"].value ~= "no-arrows") then
        -- invert the arrow's tint for specific stripe styles
        local invert_tint = (settings.startup["stripe-style"].value == "stripe-thick") or (settings.startup["stripe-style"].value == "full-paint") or false
        IR2RB.add_mask_to_item_icon(t.name .."-belt", "rubber-belt-mask", (invert_tint and { r = 0.18, g = 0.18, b = 0.18, a = 1 } or tint))
    end

    -- Add colored rails to the icon if colored rails is on
    if (settings.startup["rail-style"].value == "colored") then
        IR2RB.add_mask_to_item_icon(t.name .."-belt", "rubber-rail-mask", tint) end
  IR2RB.copy_item_icons_to_entity("transport-belt", t.name .. "-belt")
end

-- Propagate the new animation_set to splitters / undergrounds
-- (lane-splitters, when present via the lane-balancers integration, derive
-- their belt_animation_set from the splitter at integration time).
for _, t in ipairs(tiers) do
  local belt_anim_set = data.raw["transport-belt"][t.name .. "-belt"].belt_animation_set.animation_set
  data.raw["splitter"][t.name .. "-splitter"].belt_animation_set.animation_set            = belt_anim_set
  data.raw["underground-belt"][t.name .. "-underground"].belt_animation_set.animation_set = belt_anim_set
end
an hour ago

Either knniDE adds this to Beyond Belts, or they remove their integration and let me add like 5 lines of code to black rubber belts.

New response