[MOD] Deadlock's Stacking Beltboxes & Compact Loaders
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
Thank you for stepping in and continuing to maintain the mods, there is a slight issue. I’m not able to de stack the stacks by hand because the icons are red but apart from that everything seems to be working.
-
- Fast Inserter
- Posts: 128
- Joined: Thu Feb 08, 2018 8:25 am
- Contact:
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
Good catch, that's my own dumb fault for doing most of my testing in cheat mode.
That's fixed in the 0.0.2 test version, attached. And a bug with unlocking the loader recipes in existing games.
I've also added ownlyme's auto-unstacking behavior behind a new option that's disabled by default - though it works well enough that maybe the right approach is to set both this option and the "Hide unstacking recipes" option to enabled by default, if anyone has feedback there. There's also a minor tweak to loader snapping logic to enable one specific intuitive inventory-snapping case for users who only have belt-snapping enabled, which I think fixes one of the snapping complaints from many pages ago - again, test and let me know if anything is busted for you.
Edit: see the post on the previous page for updated test versions
Last edited by shanemadden on Thu Nov 29, 2018 1:55 am, edited 1 time in total.
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
Looks great. Haven't been able to try it out on a running game, but have glanced over the code and it's exactly what I had in mind, and probably even tidier. Nice work.shanemadden wrote: ↑Mon Nov 26, 2018 12:35 amDeadlock, I'm hoping that the changes are pretty much what you had in mind - the structure's changed around a bunch but I tried to keep it simple and consistent, with most of the underlying logic and code unchanged, so it shouldn't be too hard to find your way around. The base mod itself has basically no special cases for anything at all, which is nice - all the ugly stuff is in the migration. I hope you like it!
-
- Fast Inserter
- Posts: 128
- Joined: Thu Feb 08, 2018 8:25 am
- Contact:
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
Good to hear, thanks! Let me know if there's anything you'd like to see adjusted, I want to make sure this mod stays aligned with your vision (and stays easy for you to pick up development on if you get the inclination to work on it on the future).Deadlock989 wrote: ↑Wed Nov 28, 2018 6:54 pm Looks great. Haven't been able to try it out on a running game, but have glanced over the code and it's exactly what I had in mind, and probably even tidier. Nice work.
There's minor update to the test versions attached to the post on the previous page. For the migration mods (1.7.1 versions) there's a message printed displaying the number of items and entities migrated to the new mod, and a slight tweak to how it scans inventories for items to replace to reduce the complexity a bit.
The 0.0.3 version of the base mod has a bugfix in the way the auto-unstacking event handler is only registered when the option is enabled, and a new "batch recipes" option, disabled by default, to enable support of extremely high speed beltboxes (which start running into UPS limitations at speeds like those that Ultimate Belts adds): it switches the stacking and unstacking recipes to work in groups of 4x stacks (but at the same overall number of stacks per second). This has the interesting side-effect of causing the stacks to always be loaded onto both sides of the belt, which some people might like even if they're not using beltboxes with mods that add insanely fast belts?
-
- Fast Inserter
- Posts: 128
- Joined: Thu Feb 08, 2018 8:25 am
- Contact:
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
Another minor update to the test version attached to the post on the previous page.
There's a change to smooth out the behavior when multiple mods add stacks for the same items (if someone has two different mods installed both adding stacks for Bob's items for instance).
The more interesting change is for those who requested support for stacking science packs and ammo - these (and a handful of other item types that should be safe to stack) are now supported through a new optional parameter to the API function to create stacks. It's unlikely that I'll be adding stacking for any of the vanilla items of these classes, but mods adding their own stacks will be free to do so.
(these examples use autogenerated layered icons which are more rendering work for the engine, specifying icon images is recommended for distributed mods):
Note that stacking and unstacking items with durability (like science packs and ammo) resets their durability - so if someone's really dedicated to getting some research for free, they could pull partially-used packs out of labs, feed them to a stacker, and get them back to 100%.
There's a change to smooth out the behavior when multiple mods add stacks for the same items (if someone has two different mods installed both adding stacks for Bob's items for instance).
The more interesting change is for those who requested support for stacking science packs and ammo - these (and a handful of other item types that should be safe to stack) are now supported through a new optional parameter to the API function to create stacks. It's unlikely that I'll be adding stacking for any of the vanilla items of these classes, but mods adding their own stacks will be free to do so.
(these examples use autogenerated layered icons which are more rendering work for the engine, specifying icon images is recommended for distributed mods):
Code: Select all
deadlock.add_stack("science-pack-1", nil, "deadlock-stacking-1", nil, "tool")
deadlock.add_stack("piercing-rounds-magazine", nil, "deadlock-stacking-1", nil, "ammo")
Note that stacking and unstacking items with durability (like science packs and ammo) resets their durability - so if someone's really dedicated to getting some research for free, they could pull partially-used packs out of labs, feed them to a stacker, and get them back to 100%.
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
Maybe the game engine should sum up the health of those items till it has a full 5 healths. Similar how wounded turrets are averaged in the inventory.shanemadden wrote: ↑Sun Dec 09, 2018 4:52 pm Note that stacking and unstacking items with durability (like science packs and ammo) resets their durability - so if someone's really dedicated to getting some research for free, they could pull partially-used packs out of labs, feed them to a stacker, and get them back to 100%.
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
I may of done something stupid but I’m on version 0.0.4 but I can’t stack science pack.
-
- Fast Inserter
- Posts: 128
- Joined: Thu Feb 08, 2018 8:25 am
- Contact:
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
My hunch is that this might not be something the devs are willing to make changes on since recipes just completely ignore health at the moment, but it can't hurt to ask - I'll figure out how to formulate the request and see what's possible.
You're definitely not stupid, science pack stacking isn't actually included, just the capability in the modding interface to do so.
I'm leaning toward not including them by default in the base mod, but a very simple mod can add stacking for the science packs - the one attached with just 9 lines of code should do it for you (if anyone makes a real mod based on this one, you should likely specify icons instead of letting them be generated).
- Attachments
-
- deadlock-science_0.0.1.zip
- (639 Bytes) Downloaded 115 times
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
I don't think this should be a the recipe level. Rather at the inventory level. Putting 10 science packs with 50% health into an inventory should result in 5 full packs. The change in the recipe would be that the cycle only starts at 5 full items and not 4 full and one 50% item.shanemadden wrote: ↑Wed Dec 12, 2018 8:10 pmMy hunch is that this might not be something the devs are willing to make changes on since recipes just completely ignore health at the moment, but it can't hurt to ask - I'll figure out how to formulate the request and see what's possible.
Actually what does currently happen when you put 10 50% science packs into the players inventory or a stacker? (Sorry, can't test at the moment).
-
- Fast Inserter
- Posts: 128
- Joined: Thu Feb 08, 2018 8:25 am
- Contact:
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
You're right, that's exactly how it works now - combining 10 packs at 50% results in 5 packs at 100%.mrvn wrote: ↑Thu Dec 13, 2018 1:38 pm I don't think this should be a the recipe level. Rather at the inventory level. Putting 10 science packs with 50% health into an inventory should result in 5 full packs. The change in the recipe would be that the cycle only starts at 5 full items and not 4 full and one 50% item.
Actually what does currently happen when you put 10 50% science packs into the players inventory or a stacker? (Sorry, can't test at the moment).
Code: Select all
/c for i = 1, 10 do game.player.insert({name = "science-pack-1",count = 1,durability = 0.5}) end
-
- Fast Inserter
- Posts: 193
- Joined: Fri May 06, 2016 10:35 pm
- Contact:
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
How would I go about adding the crushed Bob/Angel ores to the stackable recipes? There are recipes for the un-crushed ores & crushed rock, but not the crushed ores
-
- Fast Inserter
- Posts: 128
- Joined: Thu Feb 08, 2018 8:25 am
- Contact:
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
I'm guessing you're using https://mods.factorio.com/mod/deadlock- ... ating-bobs to add the stacks for Bob's items? There's a thread in the discussion section on the mod portal where the author mentions that the support should be coming for those in the 0.17 version (with good icons).Bizobinator wrote: ↑Mon Dec 17, 2018 6:35 pm How would I go about adding the crushed Bob/Angel ores to the stackable recipes? There are recipes for the un-crushed ores & crushed rock, but not the crushed ores
This is untested but should work assuming I'm getting the right item names from a quick glance at the Angel's source (7 seems to be skipped):
Code: Select all
if deadlock_stacking then
deadlock_stacking.create("angels-ore1-crushed", nil, "deadlock-stacking-1")
deadlock_stacking.create("angels-ore2-crushed", nil, "deadlock-stacking-1")
deadlock_stacking.create("angels-ore3-crushed", nil, "deadlock-stacking-1")
deadlock_stacking.create("angels-ore4-crushed", nil, "deadlock-stacking-1")
deadlock_stacking.create("angels-ore5-crushed", nil, "deadlock-stacking-1")
deadlock_stacking.create("angels-ore6-crushed", nil, "deadlock-stacking-1")
deadlock_stacking.create("angels-ore8-crushed", nil, "deadlock-stacking-1")
deadlock_stacking.create("angels-ore9-crushed", nil, "deadlock-stacking-1")
end
-
- Fast Inserter
- Posts: 193
- Joined: Fri May 06, 2016 10:35 pm
- Contact:
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
shanemadden wrote: ↑Mon Dec 17, 2018 11:38 pmI'm guessing you're using https://mods.factorio.com/mod/deadlock- ... ating-bobs to add the stacks for Bob's items? There's a thread in the discussion section on the mod portal where the author mentions that the support should be coming for those in the 0.17 version (with good icons).Bizobinator wrote: ↑Mon Dec 17, 2018 6:35 pm How would I go about adding the crushed Bob/Angel ores to the stackable recipes? There are recipes for the un-crushed ores & crushed rock, but not the crushed ores
This is untested but should work assuming I'm getting the right item names from a quick glance at the Angel's source (7 seems to be skipped):
Code: Select all
if deadlock_stacking then deadlock_stacking.create("angels-ore1-crushed", nil, "deadlock-stacking-1") deadlock_stacking.create("angels-ore2-crushed", nil, "deadlock-stacking-1") deadlock_stacking.create("angels-ore3-crushed", nil, "deadlock-stacking-1") deadlock_stacking.create("angels-ore4-crushed", nil, "deadlock-stacking-1") deadlock_stacking.create("angels-ore5-crushed", nil, "deadlock-stacking-1") deadlock_stacking.create("angels-ore6-crushed", nil, "deadlock-stacking-1") deadlock_stacking.create("angels-ore8-crushed", nil, "deadlock-stacking-1") deadlock_stacking.create("angels-ore9-crushed", nil, "deadlock-stacking-1") end
Oh! Any idea when the 0.17 version is going to drop? o_O
-
- Fast Inserter
- Posts: 128
- Joined: Thu Feb 08, 2018 8:25 am
- Contact:
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
0.17 of Factorio itself should be out as experimental in January (per https://factorio.com/blog/post/fff-269), I plan on releasing the new combined beltboxes and loaders mod alongside it (beta versions attached on the previous page).Bizobinator wrote: ↑Tue Dec 18, 2018 3:25 pm Oh! Any idea when the 0.17 version is going to drop? o_O
For the Bob's integration mod in particular it'll be up to the author - making the art is probably the biggest obstacle on their end, so they're likely shooting for 0.17 to be able to take care of all of the needed changes in one big release.
-
- Fast Inserter
- Posts: 193
- Joined: Fri May 06, 2016 10:35 pm
- Contact:
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
Ohhhhh..... 0.17 Factorio version, not 0.17 version of the mod
>_<
>_<
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
I have just made my small mod to update your loaders for UltimateBelts mod and it worls properly.
The code:
Can you add UltimateBelts to your mod so others don't have to use similar tweak?
Please consider adding in prototypes/mods
mods-ultimatebelts.lua
Then ofc locale info...
Also data-updates.lua needs adding somewhere:
PS. I will try now with making stacking boxes compatible with UltimateBelts... Can I use similar solution to deadlock_loaders.create ?
The code:
Code: Select all
-- get DCL to generate a matching loader
if deadlock_loaders then
deadlock_loaders.create( {
tier = 6,
transport_belt = "ultra-fast-belt",
underground_belt = "ultra-fast-underground-belt",
splitter = "ultra-fast-splitter",
colour = {r=0,g=120,b=0},
ingredients = nil,
crafting_category = nil,
technology = "ultra-fast-logistics",
localisation_prefix = "ufl",
} )
deadlock_loaders.create( {
tier = 7,
transport_belt = "extreme-fast-belt",
underground_belt = "extreme-fast-underground-belt",
splitter = "extreme-fast-splitter",
colour = {r=120,g=0,b=0},
ingredients = nil,
crafting_category = nil,
technology = "extreme-fast-logistics",
localisation_prefix = "ufl",
} )
deadlock_loaders.create( {
tier = 8,
transport_belt = "ultra-express-belt",
underground_belt = "ultra-express-underground-belt",
splitter = "ultra-express-splitter",
colour = {r=90,g=0,b=120},
ingredients = nil,
crafting_category = nil,
technology = "ultra-express-logistics",
localisation_prefix = "ufl",
} )
deadlock_loaders.create( {
tier = 9,
transport_belt = "extreme-express-belt",
underground_belt = "extreme-express-underground-belt",
splitter = "extreme-express-splitter",
colour = {r=90,g=0,b=120},
ingredients = nil,
crafting_category = nil,
technology = "extreme-express-logistics",
localisation_prefix = "ufl",
} )
deadlock_loaders.create( {
tier = 10,
transport_belt = "ultimate-belt",
underground_belt = "original-ultimate-underground-belt",
splitter = "original-ultimate-splitter",
colour = {r=90,g=180,b=180},
ingredients = nil,
crafting_category = nil,
technology = "ultimate-logistics",
localisation_prefix = "ufl",
} )
end
Can you add UltimateBelts to your mod so others don't have to use similar tweak?
Please consider adding in prototypes/mods
mods-ultimatebelts.lua
Code: Select all
local tiers = {
{
tier = 6,
transport_belt = "ultra-fast-belt",
underground_belt = "ultra-fast-underground-belt",
splitter = "ultra-fast-splitter",
colour = {r=0,g=120,b=0},
ingredients = nil,
crafting_category = nil,
technology = "ultra-fast-logistics",
localisation_prefix = "ufl",
},
{
tier = 7,
transport_belt = "extreme-fast-belt",
underground_belt = "extreme-fast-underground-belt",
splitter = "extreme-fast-splitter",
colour = {r=120,g=0,b=0},
ingredients = nil,
crafting_category = nil,
technology = "extreme-fast-logistics",
localisation_prefix = "ufl",
},
{
tier = 8,
transport_belt = "ultra-express-belt",
underground_belt = "ultra-express-underground-belt",
splitter = "ultra-express-splitter",
colour = {r=90,g=0,b=120},
ingredients = nil,
crafting_category = nil,
technology = "ultra-express-logistics",
localisation_prefix = "ufl",
},
{
tier = 9,
transport_belt = "extreme-express-belt",
underground_belt = "extreme-express-underground-belt",
splitter = "extreme-express-splitter",
colour = {r=90,g=0,b=120},
ingredients = nil,
crafting_category = nil,
technology = "extreme-express-logistics",
localisation_prefix = "ufl",
},
{
tier = 10,
transport_belt = "ultimate-belt",
underground_belt = "original-ultimate-underground-belt",
splitter = "original-ultimate-splitter",
colour = {r=90,g=180,b=180},
ingredients = nil,
crafting_category = nil,
technology = "ultimate-logistics",
localisation_prefix = "ufl",
},
}
for _,tier in pairs(tiers) do deadlock_loaders.create(tier) end
Code: Select all
ufl-loader-6=Ultra Fast loader 80
ufl-loader-7=Extreme Fast loader 120
ufl-loader-8=Ultra Express loader 160
ufl-loader-9=Extreme Express loader 200
ufl-loader-10=Ultimate Ufl loader 240
Code: Select all
if mods["UltimateBelts"] then
require("prototypes.mods.mods-ultimatebelts")
end
Last edited by veriszg on Wed Dec 19, 2018 11:48 pm, edited 1 time in total.
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
Correction for prototypes\mods\mods-ultimatebelts.lua
I made a bug with colors. This is correct version (0,90,120) for tier 9
I made a bug with colors. This is correct version (0,90,120) for tier 9
Code: Select all
{
tier = 9,
transport_belt = "extreme-express-belt",
underground_belt = "extreme-express-underground-belt",
splitter = "extreme-express-splitter",
colour = {r=0,g=90,b=120},
ingredients = nil,
crafting_category = nil,
technology = "extreme-express-logistics",
localisation_prefix = "ufl",
},
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
Also tweaked Stacking Beltboxes mod and now testing its compatibility with UltimateBelts (tier 6-10).
Changed in your mod the file shared lua. Added parts:
Checking mod:
Updated ITEM_TIER table, because without it the game greeted me with an error So...
Don't know If the check for mod existence is ok. The game should check for bobs mod and UltimateBelts. You will probably know how to write it properly. Maybe nested if or maybe if consisting of checking for bobs and ultimate belts. Your choice My solution works in my game.
Changed in your mod the file shared lua. Added parts:
Checking mod:
Code: Select all
if mods["UltimateBelts"] then
DSB.TIER_COLOURS[6] = {r=0,g=120,b=0}
DSB.TIER_COLOURS[7] = {r=120,g=0,b=0}
DSB.TIER_COLOURS[8] = {r=90,g=0,b=120}
DSB.TIER_COLOURS[9] = {r=0,g=90,b=120}
DSB.TIER_COLOURS[10] = {r=90,g=180,b=180}
DSB.PREREQS[6] = {"ultra-fast-logistics", "deadlock-stacking-5"}
DSB.PREREQS[7] = {"extreme-fast-logistics", "deadlock-stacking-6"}
DSB.PREREQS[8] = {"ultra-express-logistics", "deadlock-stacking-7"}
DSB.PREREQS[9] = {"extreme-express-logistics", "deadlock-stacking-8"}
DSB.PREREQS[10] = {"ultimate-logistics", "deadlock-stacking-9"}
DSB.BASE_RESEARCH[6] = "ultra-fast-logistics"
DSB.BASE_RESEARCH[7] = "extreme-fast-logistics"
DSB.BASE_RESEARCH[8] = "ultra-express-logistics"
DSB.BASE_RESEARCH[9] = "extreme-express-logistics"
DSB.BASE_RESEARCH[10] = "ultimate-logistics"
DSB.BELTS[6] = "ultra-fast-belt"
DSB.BELTS[7] = "extreme-fast-belt"
DSB.BELTS[8] = "ultra-express-belt"
DSB.BELTS[9] = "extreme-express-belt"
DSB.BELTS[10] = "ultimate-belt"
DSB.TIERS = 10
end
Code: Select all
DSB.ITEM_TIER = {
[1] = { "raw-wood", "iron-ore", "copper-ore", "stone", "coal", "iron-plate", "copper-plate", "steel-plate", "stone-brick" },
[2] = { "copper-cable", "iron-gear-wheel", "iron-stick", "sulfur", "plastic-bar", "solid-fuel", "electronic-circuit", "advanced-circuit" },
[3] = { "processing-unit", "battery", "uranium-ore", "uranium-235", "uranium-238" },
[4] = {}, -- not used without other mods
[5] = {}, -- not used without other mods
[6] = {}, -- not used without other mods
[7] = {}, -- not used without other mods
[8] = {}, -- not used without other mods
[9] = {}, -- not used without other mods
[10] = {}, -- not used without other mods
}
-
- Fast Inserter
- Posts: 128
- Joined: Thu Feb 08, 2018 8:25 am
- Contact:
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
Hey veriszg,
Your work is appreciated but unfortunately you're working against the currently released version instead of the rewritten 0.17 version.
That's the bad news but you'll like the good news: I've already tested the rewritten version of DSB and DCL (now one mod) with Ultimate Belts (and added a feature to help beltboxes function at such high speeds, described in an earlier post on this page) - I haven't clocked their exact performance but the beltboxes generated for Ultimate Belts seem to be pushing at least 160-180 items per second, while loaders are limited by the engine to 120 items/sec (use miniloaders if you want faster, load from multiple sides, etc).
Tyarns has said he'll be adding support to Ultimate Belts when the new version(s) are out, but if you want to test out the support beforehand you can do so; download the 0.0.4 test version attached on the prior page and add a bit of code like this to make beltboxes and loaders, for the top tier as an example:
Code: Select all
deadlock.add_tier({
transport_belt = "ultimate-belt",
colour = {r=165, g=165, b=165},
underground_belt = "original-ultimate-underground-belt",
splitter = "original-ultimate-splitter",
technology = "ultimate-logistics",
order = "z",
loader_ingredients = {
{"ultimate-belt",1},
{"wood",1}
},
beltbox_ingredients = {
{"ultimate-belt",1},
{"wood",1}
},
})
Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)
Thanks for the info! I'll try to use current version then.
Still I feel that I learned a bit about the game and modding even if these tweaks are now obsolete
Still I feel that I learned a bit about the game and modding even if these tweaks are now obsolete