[MOD] Deadlock's Stacking Beltboxes & Compact Loaders

Topics and discussion about specific mods
Anson
Fast Inserter
Fast Inserter
Posts: 249
Joined: Sun May 22, 2016 4:41 pm
Contact:

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by Anson »

Neuromantix wrote:Suggestion - corner loader - 90 degrees output relative to input
for inserters, there already exists Bob's Adjustable Inserters.
for loaders, one could try Belt Buffer, although that has lots of overpowered additional functionality, they are 1x2 in size, and which of the 6 adjacent tiles are inputs or outputs can be difficult to setup.

having Deadlock's loaders output items on one side and accept input from any of the three other sides would be really nice and make loader and beltbox setups even more compact (eg allowing a 2x2 setup instead of needing 1x3), but i don't know whether that would be possible since AFAIK the loaders are versions of vanilla loaders, and it also would either require two additional items with +-90 degree angles between input and output, or make the existing item much more difficult. either way it would require lots of reprogramming and new graphics.
But still something i wouldn't reject at all to have myself :-)
Deadlock989 wrote:lots of details
thank you very much for all those details !

here is my simple version of a "pure stacker". it first filters the "to be stacked" items, then allows an inserter (filter inserter to make if foolproof) to add more items, and then merges the two branches again.
btw: i always use fresh fish and never transport them by belt. thus i always use fish as filter to block one output of a splitter that is used for merging. that clearly shows the purpose (merger instead of splitter) and avoids having stuck items in the deadend.

setting this up is easy, but it takes a lot of space, at least 10 tiles (2x5 or with the above 90-degree-loaders 3x4; in tilable setups 2x4 or 3x3). does anybody have an idea for a more compact setup ?
as a result, tilable 2x4 causes problems in beaconed assembly lanes (missing the fourth beacon for every third assembler), and 3x3 would prohibit beaconing completely. it also would make it impossible to have more than 1 belt between assemblers and beacons and/or to weave belts (thus only one belt each for input and output would be possible)
on the other hand, i already have built a beaconed assembly lane setup with 4 incoming and 1 outgoing belts by removing every second assembler and replacing it with the (un)stackers.
purestacker.PNG
purestacker.PNG (318.69 KiB) Viewed 5476 times
snapping is still a problem ... i just tried and got this result:
in mod settings, both snap options were turned on. in the screenshot, the left and right versions are for the loaders pointing to the right or to the left side while being placed.
the yellow dots mark what was placed first and what second: on the bottom belt i placed the loaders first which immediately snapped properly to the belts and also stayed that way when i placed the stackers last. but on the top belt, i placed the stackers first and then the loaders, which results in all loaders being turned with the connecting belt to the right and all directions being turned towards the stacker (for loading from the belt) no matter which direction the belt was going or which direction the item had on the cursor.
when i tried the same again without having any belts placed, all loaders snapped properly to the stackers when placed after the stackers and when placed before the stackers they got placed exactly as they were on the cursor and didn't change later when placing the stackers.
badsnap.PNG
badsnap.PNG (261.37 KiB) Viewed 5476 times
dood
Filter Inserter
Filter Inserter
Posts: 360
Joined: Wed Mar 21, 2018 8:36 am
Contact:

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by dood »

Anson wrote:
Neuromantix wrote:Suggestion - corner loader - 90 degrees output relative to input
for inserters, there already exists Bob's Adjustable Inserters.
for loaders, one could try Belt Buffer, although that has lots of overpowered additional functionality, they are 1x2 in size, and which of the 6 adjacent tiles are inputs or outputs can be difficult to setup.

having Deadlock's loaders output items on one side and accept input from any of the three other sides would be really nice and make loader and beltbox setups even more compact (eg allowing a 2x2 setup instead of needing 1x3), but i don't know whether that would be possible since AFAIK the loaders are versions of vanilla loaders, and it also would either require two additional items with +-90 degree angles between input and output, or make the existing item much more difficult. either way it would require lots of reprogramming and new graphics.
But still something i wouldn't reject at all to have myself :-)
I don't get it.
Image
What's the problem?
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by Deadlock989 »

I'm out of town for a while without a real PC.

Re: "corner loaders" - unfortunately there's no engine support for this. Unlike inserters which can have pickup and drop-off positions defined, loaders are just assumed to be straight.

Re: snapping - it's either the tiny screen I'm on or the sudden drop in working neurons resulting from the weekend, but I'm having a hard time following the description. From what I can tell, it's intended behaviour - loaders only "snap" to inventories, so if they are placed before machines or chests are placed, there's nothing to snap to yet. The snapping code is only run when loaders are placed, they aren't checked when any other entity is placed.
shanemadden
Fast Inserter
Fast Inserter
Posts: 128
Joined: Thu Feb 08, 2018 8:25 am
Contact:

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by shanemadden »

The thing that I was thinking would make snapping smoother for my use (though I'm unsure if it'd resolve Anson's issue): check for neighbor belt-type entities instead of just looking for inventory-having entities, and use the belt's orientation to determine loader mode (belt facing into the belt-end of the loader then input mode; belt facing away from belt-end then output mode). If a player's building the belts before the buildings, I think this makes things still face the intended way.

Since you're out of town and I didn't want to just drop a feature request in your lap that I could implement myself (and it's a lazy Sunday afternoon here), so I took a swing at implementing it. Here's a diff for control.lua to add that snapping behavior, I tried to keep it close to your coding conventions:

Code: Select all

@@ -34,6 +34,17 @@
     end
     return false
 end
+-- is any entity in the list that's belt-ish facing toward the loader
+function are_belt_facing(entities, direction)
+    for _,entity in pairs(entities) do
+        if (entity.type == "transport-belt" or
+            entity.type == "underground-belt" or
+            entity.type == "splitter") and
+            entity.direction == opposite[direction]
+        then return true end
+    end
+    return false
+end

 -- if there's a loadable thing behind but not ahead, turn around
 -- if there's a loadable thing ahead but not behind, turn around and switch mode
@@ -44,12 +55,16 @@
     if event.revived then return end
     local snap2back = settings.get_player_settings(game.players[event.player_index])["deadlock-loaders-snap-to-back"].value
     local snap2front = settings.get_player_settings(game.players[event.player_index])["deadlock-loaders-snap-to-front"].value
+    -- needs a setting
+    local snap2belt = true
     -- no need to check anything if all configs are off
-    if not snap2back and not snap2front then return end
+    if not snap2back and not snap2front and not snap2belt then return end
     -- check neighbours and snap if necessary
     local belt_end = get_neighbour_entities(built, built.direction)
     local loading_end = get_neighbour_entities(built, opposite[built.direction])
-    if snap2back and not are_loadable(belt_end) and are_loadable(loading_end) then
+    if snap2belt and are_belt_facing(belt_end, built.direction) then
+        built.rotate( {by_player = event.player_index} )
+    elseif snap2back and not are_loadable(belt_end) and are_loadable(loading_end) then
         built.rotate( {by_player = event.player_index} )
     elseif snap2front and are_loadable(belt_end) and not are_loadable(loading_end) then
         built.direction = opposite[built.direction]
Randonx
Inserter
Inserter
Posts: 21
Joined: Thu Apr 14, 2016 5:31 am
Contact:

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by Randonx »

This may have been answered before, but I couldn't find it in any of the 12 pages previous. For some reason my Compact Loaders seem to have lots of trouble pulling materials out of an object, whereas they have no trouble whatsoever inputting into a chest or assembler. I can get it to work every once in a while, but that's without changing anything that I can determine.

If anybody knows what the cause might be, let me know.
dood
Filter Inserter
Filter Inserter
Posts: 360
Joined: Wed Mar 21, 2018 8:36 am
Contact:

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by dood »

Are you rotating the loaders to go out of the chests?
If you place a loader next to anything with an inventory, it will automatically rotate itself to go into it.
mrvn
Smart Inserter
Smart Inserter
Posts: 5884
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by mrvn »

Neuromantix wrote:Suggestion - corner loader - 90 degrees output relative to input
Already works that way except for the gfx.

Personally I would have expected for sideloading a loader to behave like an underground belt and only load one side of the belt.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by Deadlock989 »

shanemadden wrote:The thing that I was thinking would make snapping smoother for my use (though I'm unsure if it'd resolve Anson's issue): check for neighbor belt-type entities instead of just looking for inventory-having entities, and use the belt's orientation to determine loader mode (belt facing into the belt-end of the loader then input mode; belt facing away from belt-end then output mode). If a player's building the belts before the buildings, I think this makes things still face the intended way.

Since you're out of town and I didn't want to just drop a feature request in your lap that I could implement myself (and it's a lazy Sunday afternoon here), so I took a swing at implementing it. Here's a diff for control.lua to add that snapping behavior, I tried to keep it close to your coding conventions:
Thanks for this, I'll take a look when I get home and settled. It sounds more like the behaviour that the old Loader Snapping mod by Articulating had, that ended up in both Miniloaders and Loader Redux. I didn't use that because it seemed overly complex (and internally referred to something called "idiot snapping", which I didn't think warranted coding for) but at first glance yours seems much simpler and cleaner. Personally I'd like the snapping to be as simple as possible and put the burden on players to actually place things intelligently - I know, what was I thinking - but since underneathies have some built-in placement stuff and loaders are technically unfinished, I accept that they need a bit of help.
Randonx wrote:This may have been answered before, but I couldn't find it in any of the 12 pages previous. For some reason my Compact Loaders seem to have lots of trouble pulling materials out of an object, whereas they have no trouble whatsoever inputting into a chest or assembler. I can get it to work every once in a while, but that's without changing anything that I can determine.

If anybody knows what the cause might be, let me know.
This doesn't ring any bells. When you say "an object", what do you mean - an assembler? A chest? Someone asked a similar question a few pages back and then disappeared, my suspicion is that they didn't know you can / have to rotate the input/output direction of loaders by hovering over it and pressing R, just like underneathies.
InflamedSebi
Burner Inserter
Burner Inserter
Posts: 12
Joined: Fri May 19, 2017 7:49 am
Contact:

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by InflamedSebi »

Hey :)
Great Mod.
Just wondering why there is no option to increase chest density?
The default stack size could stay at 1/5th for the compressed item, but having a deep storage option to keep the stack size and thus have 5x better storage.
Any chance to see that coming?
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by Deadlock989 »

InflamedSebi wrote:Hey :)
Great Mod.
Just wondering why there is no option to increase chest density?
The default stack size could stay at 1/5th for the compressed item, but having a deep storage option to keep the stack size and thus have 5x better storage.
Any chance to see that coming?
Thanks.

No, sorry. See FAQ. This was a deliberate decision. Many different options are available with other mods if you want to boost storage. These mods are all about belt throughput and nothing else.
User avatar
MasterZenII
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Apr 24, 2018 12:32 am
Contact:

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by MasterZenII »

Hey Deadlock! I love these mods, but a small issue I've had since updating to the latest version of Factorio today. The icons for some of the belt items in the inventory using your reskins have no coloration. The entities once placed seem to be fine, but the actual items in the player inventory don't have the tints. (Compact Loaders, Beltboxes, Belts, and Undergrounds are affected, Splitters are fine)

Any tips for what to try to do to fix this issue?
Randonx
Inserter
Inserter
Posts: 21
Joined: Thu Apr 14, 2016 5:31 am
Contact:

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by Randonx »

Randonx wrote:
This may have been answered before, but I couldn't find it in any of the 12 pages previous. For some reason my Compact Loaders seem to have lots of trouble pulling materials out of an object, whereas they have no trouble whatsoever inputting into a chest or assembler. I can get it to work every once in a while, but that's without changing anything that I can determine.

If anybody knows what the cause might be, let me know.
Deadlock989 wrote:
This doesn't ring any bells. When you say "an object", what do you mean - an assembler? A chest? Someone asked a similar question a few pages back and then disappeared, my suspicion is that they didn't know you can / have to rotate the input/output direction of loaders by hovering over it and pressing R, just like underneathies.
I'm getting extremely weird behavior. The only way I can get these things to work is as follows:
To put items into a chest, plop the loader down in the direction I want it to be. If I rotate it into the position I need it doesn't work.

If I want to pull items out of a chest, I have to place the loader backwards and then rotate it into place. Otherwise it won't work.

Is there some kind of way I can delete mod settings incase a previous Loader mod somehow left a setting behind that is affecting your loaders? I don't have any other loader mods installed, but I did at one point before I settled on which loaders I liked the best. (Which is yours, by far)
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by orzelek »

MasterZenII wrote:Hey Deadlock! I love these mods, but a small issue I've had since updating to the latest version of Factorio today. The icons for some of the belt items in the inventory using your reskins have no coloration. The entities once placed seem to be fine, but the actual items in the player inventory don't have the tints. (Compact Loaders, Beltboxes, Belts, and Undergrounds are affected, Splitters are fine)

Any tips for what to try to do to fix this issue?
Welcome to forums :)
I didn't check in game yet but there is a post in bug forums about what might be a similar issue with base game sulfur acid barells.
It seems to be same issue as this - tinting of icons might be broken in latest version.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by Deadlock989 »

MasterZenII wrote:Hey Deadlock! I love these mods, but a small issue I've had since updating to the latest version of Factorio today. The icons for some of the belt items in the inventory using your reskins have no coloration. The entities once placed seem to be fine, but the actual items in the player inventory don't have the tints. (Compact Loaders, Beltboxes, Belts, and Undergrounds are affected, Splitters are fine)

Any tips for what to try to do to fix this issue?
Very odd. It is probably another mod interfering. I can help if you post a mod list and maybe an example save.

Edited to add, orzelek posted above at the same time, sounds more likely.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by Deadlock989 »

Randonx wrote:If I want to pull items out of a chest, I have to place the loader backwards and then rotate it into place. Otherwise it won't work.
This is intended behaviour. The base game has no placement logic for loaders at all (they were never finished). By default, they always start pulling out of inventories when first placed down and you can't switch mode "in hand". I found this more annoying than the lesser annoyance of having to configure output loaders every time, so they "snap" to input mode when first placed. You can disable this behaviour by turning off snapping in per-player mod settings.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by Deadlock989 »

orzelek wrote:
MasterZenII wrote:Hey Deadlock! I love these mods, but a small issue I've had since updating to the latest version of Factorio today. The icons for some of the belt items in the inventory using your reskins have no coloration. The entities once placed seem to be fine, but the actual items in the player inventory don't have the tints. (Compact Loaders, Beltboxes, Belts, and Undergrounds are affected, Splitters are fine)

Any tips for what to try to do to fix this issue?
Welcome to forums :)
I didn't check in game yet but there is a post in bug forums about what might be a similar issue with base game sulfur acid barells.
It seems to be same issue as this - tinting of icons might be broken in latest version.
Confirmed that this is a bug in 0.16.37. Layered item icons are missing every layer above the base one when rendered in inventory grids. It's been reported.
User avatar
MasterZenII
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Apr 24, 2018 12:32 am
Contact:

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by MasterZenII »

Thank you for the warm welcome guys!
And thanks for the response Deadlock and orzelek. I'm just glad it wasn't a side effect of something I had done. x.x I've just started tinkering with modding when I noticed that the various bob's alloys didn't have stacking recipes with orzelek's patch. (it was just naming inconsistencies with the alloys compared to the other plates)

Once I started digging into the code I went a little overboard though...so I kinda worried it was my fault after I had finished. ^^;;
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by Deadlock989 »

I'm adding shanemadden's belt-facing snapping to Compact Loaders (see several posts back). But I'm not keen on adding a third config option for snapping, it's over-complex and I can't think of a good reason for that much fine control. I'm currently minded to have just a single option for snapping that covers all three tests: inventory-facing at the loading end, inventory-facing at the belt end and belt-facing at the belt end. This won't happen until at least the next Factorio version, when the broken icons are fixed.

If you currently play with just one of the settings turned on and don't like this potential change, speak up now.
shanemadden
Fast Inserter
Fast Inserter
Posts: 128
Joined: Thu Feb 08, 2018 8:25 am
Contact:

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by shanemadden »

Deadlock989 wrote:I'm adding shanemadden's belt-facing snapping to Compact Loaders (see several posts back). But I'm not keen on adding a third config option for snapping, it's over-complex and I can't think of a good reason for that much fine control. I'm currently minded to have just a single option for snapping that covers all three tests: inventory-facing at the loading end, inventory-facing at the belt end and belt-facing at the belt end. This won't happen until at least the next Factorio version, when the broken icons are fixed.

If you currently play with just one of the settings turned on and don't like this potential change, speak up now.
It makes sense to me to collapse down to one setting - though if you're doing that, there's one little change in the logic that I'd like to make to fix a specific case:

Image

When placing this last loader (with the belts already down), it'll snap into input mode since the beltbox is already down and it's an adjacent inventory, despite the belt facing away being a better "hint" for what mode we want to have the loader in, since I just have the belt snapping logic check for belts facing toward the loader (and output mode's the default). I was planning on just disabling inventory snapping to have this work the way I wanted, but it's probably an overall better user experience to just add one more if statement to the belt snapping logic to skip inventory snapping when the belt's oriented like this; I can tweak my patch if that sounds good?
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Stacking Beltbox (& Compact Loaders)

Post by Deadlock989 »

shanemadden wrote:When placing this last loader (with the belts already down), it'll snap into input mode since the beltbox is already down and it's an adjacent inventory, despite the belt facing away being a better "hint" for what mode we want to have the loader in, since I just have the belt snapping logic check for belts facing toward the loader (and output mode's the default). I was planning on just disabling inventory snapping to have this work the way I wanted, but it's probably an overall better user experience to just add one more if statement to the belt snapping logic to skip inventory snapping when the belt's oriented like this; I can tweak my patch if that sounds good?
Sounds good to me. I can do it if you like, or if you're bored, go for it. I'll credit you for the code either way.
Post Reply

Return to “Mods”