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
2 years ago
0.17 - 1.1
89.4K
Logistics

b Pollution modifier missing in stacks of burnable items

5 years ago

As per title, coal for example creates 200% pollution, but the stacks don't.

5 years ago

That pollution modifier is from bob's mods. So vanilla stack shouldn't have it but with bob's stack would need it too.

5 years ago

Oh, I thought vanilla coal has a modifier, too? Well, then it's trickier, if Bob's modifies it after the stack item has been created already... It's the same for solid fuel (80% pollution in Bob's, IIRC), and I'd have to look if there are Bob's only burnables with a modifier (and if the modifier carries over correctly for them).

5 years ago

Yeah, the stacked vanilla items are getting modified late by Bob's changes to pollution modifiers. I don't want to add workarounds to the base mod when possible for simplicity's sake, when we can just do something like this...

if data.raw.item["deadlock-stack-coal"] then
    data.raw.item["deadlock-stack-coal"].fuel_emissions_multiplier = data.raw.item["coal"].fuel_emissions_multiplier
end
-- (and another for solid fuel and any others others Bob modifies)

... run after Bob's modifications to the vanilla items run, probably just in data-final-fixes with an optional dep on bobplates, which makes the changes, to ensure the changes are synced to the stacked item after they're finalized. OhChirpy, you could add this to your mod or I can add it to this one; I figure most people using Deadlock+Bob's probably have both mods installed.

5 years ago

Why not just optional dependency on bobplates on base mod and simply copy fuel emissions during creation of stack recipe?
You are creating stacking recipes in data updates anyway and bobplates add multipliers in same phase.
This problem is not unique to bob mods - any mod that changes emissions will have it. So stack creation should be aware that it needs to copy this multiplier. And since it's a modification of base game stack dependency will allow you to create stack always after bobplates.

5 years ago
(updated 5 years ago)

Stack creation already does copy the multiplier, it's simply an ordering issue.

Yes, I could alter the load order to make the stacks after bobplates loads, but it's also a perfectly valid fix to simply re-sync the value after bobplates changes it. The old Deadlock mods both got extremely loaded down with workarounds for other mod's load order quirks, I'm very intentionally avoiding adding such workarounds to this mod. The API is much more featureful in this refactored mod but keeping the code simple this time around requires a 'you break it, you bought it' philosophy in the data phase.

5 years ago
(updated 5 years ago)

I agree with orzolek, but if you don't want to opt-depend I can add the bob's specific fixes you provided, too.

Edit: ha, in flight colission :). I'll add it in the next version, then.

5 years ago
(updated 5 years ago)

Just published a new version of https://mods.factorio.com/mod/deadlock-integrations with the multipler fix, feel free to lift the code right from there. I'll remove it later, won't hurt to have both mods running it.

The facepalm is that I noticed bobplates also changing stack sizes on wood and coal and a handful of other vanilla items, that's going to be out of whack too >.<

I can see why Deadlock had moved all the stack creation to final-fixes. You know, this ordering stuff goes both ways, life would be much easier for everyone else if this was in Bob's data.lua..

5 years ago
(updated 5 years ago)

Alright, I caved on this one after seeing what all bobplates changes - new version publishing nowish adds an optdep on bobplates to deal with these ordering issues.

Edit to clarify: OhChirpy, should be no need for any addition changes on your end. Let me know if you see anything else messed up!

5 years ago

Ok. For reference, this was the code I'd have included:

-- Fix all fuel multipliers for stacked burnables.
-- This is necessary as Bob touches coal and other vanilla items after they gain
-- their stacks.
local stack_prefix = "deadlock-stack-"
for name, item in data.raw.item do
if item and name and name:sub(1, #stack-prefix) == stack-prefix then
local org_name = name:sub(#stack-prefix+1)
if data.raw.item[org_name] and (data.raw.item[org_name].fuel_value or 0) > 0 then
for _, attr in ipairs({"fuel_emissions_multiplier", "fuel_top_speed_multiplier", "fuel_acceleration_multiplier"}) do
item[attr] = (data.raw.item[org_name][attr] or 1)
end
end
end

New response