Ober3550's Belt Changes


Belt speeds are a 2^N progression being 1,2,4,8. Belt costs adjusted.

Content
4 years ago
0.16 - 0.17
9
Logistics

b Failed to load mod "Oberbelt": __Oberbelt__/data.lua:26: attempt to index field '?' (a nil value)

4 years ago
(updated 4 years ago)

got error message

   0.822 Loading mod Oberbelt 0.17.1 (data.lua)
   0.824 Error ModManager.cpp:1323: Failed to load mod "Oberbelt": __Oberbelt__/data.lua:26: attempt to index field '?' (a nil value)
stack traceback:
    __Oberbelt__/data.lua:26: in main chunk
   0.825 Loading mod core 0.0.0 (data.lua)
   0.908 Checksum for core: 2898937788
   0.988 Error ModManager.cpp:1323: Error in assignID, recipe-category with name 'crafting' does not exist.

Source: default (utility-sprites).
   1.041 Initial atlas bitmap size is 16384
   1.042 Created atlas bitmap 2048x416 [icon, not-compressed, mipmap, linear-minification, linear-magnification, linear-mip-level]
   1.042 Created virtual atlas pages 4096x4096x0
   1.046 Texture processor created (2048). GPU accelerated compression Supported: yes, Enabled: yes/yes. Test passed. YCoCgDXT PSNR: 35.83, BC3 PSNR: 33.82
   1.053 Parallel Sprite Loader initialized (threads: 7)
   1.075 Sprites loaded
   1.087 Generated mipmaps (5) for atlas [0] of size 2048x416   
   1.087 Custom mipmaps uploaded.
   1.091 Factorio initialised
   1.096 Mods to disable:Failed to load mods: __Oberbelt__/data.lua:26: attempt to index field '?' (a nil value)
stack traceback:
    __Oberbelt__/data.lua:26: in main chunk

Mods to be disabled:
• Oberbelt

4 years ago
(updated 4 years ago)

you need to change 5 to 3 in this code if not boblogistics

for i=1,5 do
    data.raw["transport-belt"][belts[i]].speed = basespeed*(2^(i-1))
4 years ago
(updated 4 years ago)

i made for you fully automatic 2^N
and better if you rename data.lua to data-final-fixes.lua

local basespeed = 1/32

if mods.boblogistics then
    if settings.startup["bobmods-logistics-beltoverhaul"].value then
        data.raw["transport-belt"]["basic-transport-belt"].speed = 0.5*basespeed
        data.raw["splitter"]["basic-splitter"].speed = 0.5*basespeed
        data.raw["underground-belt"]["basic-underground-belt"].speed = 0.5*basespeed
        data.raw["underground-belt"]["basic-underground-belt"].max_distance = 5
        if mods.DeadlockLoaders then
            data.raw["loader"]["deadlock-loader-0"].speed = 0.5*basespeed
        end
    end
end

local function set_speed(type, name)
    exit = true
    speed = 1
    while exit do
        if data.raw[type][name].speed then
            data.raw[type][name].speed = basespeed*(2^(speed-1))
            speed = speed + 1
        end
        if data.raw[type][name].next_upgrade then
            name = data.raw[type][name].next_upgrade
        else
            exit = false
        end
    end
end

set_speed("transport-belt",     "transport-belt")
set_speed("underground-belt",   "underground-belt")
set_speed("splitter",           "splitter")
set_speed("loader",             "loader")
4 years ago

True. I can fix the 3 vs 5 however it needs to be data instead of updates or final fixes since miniloader catches belt speed changes in data updates. If I have it in data updates I need to loader earlier alphabetically or the mod author needs to be dependent on my mod which obviously doesn't work.

New response