Page 13 of 14

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Tue Jun 11, 2019 11:18 am
by mrvn
I think I screwed up my game. I've modified the rail loaders so that there is a lager version (railloader mk II) but I had a bug in the pattern matching to detect the new entities. Now I think one of the inserters are placed wrong. The effect I'm seeing is that something constantly takes something out of the unloader and puts it back in. Worse, if a train is present, it sometimes puts the items back in the train and then out again. So the train never gets 2s inactivity and never leaves.

I fixed the code but now I have to deconstruct every loader/unloader and place them again. And most have items in them making that a huge problem.

Is there a mod function I can trigger to remove and rebuild all the hidden entities of the railloader and unloader?

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Tue Jun 11, 2019 4:03 pm
by Therax
mrvn wrote:
Tue Jun 11, 2019 11:18 am
Is there a mod function I can trigger to remove and rebuild all the hidden entities of the railloader and unloader?
Unfortunately there isn’t. The function that creates the inserters also creates the chest.

If you’re not going for mod achievements it’s probably possible to fix through the console, but it’s hard for me to tell from here exactly what went wrong.

You could script moving the contents of each railloader into a chest, then mining/rebuilding, then moving the chestcontents back into the new railloader.

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Wed Jun 12, 2019 4:08 pm
by mrvn
Therax wrote:
Tue Jun 11, 2019 4:03 pm
mrvn wrote:
Tue Jun 11, 2019 11:18 am
Is there a mod function I can trigger to remove and rebuild all the hidden entities of the railloader and unloader?
Unfortunately there isn’t. The function that creates the inserters also creates the chest.

If you’re not going for mod achievements it’s probably possible to fix through the console, but it’s hard for me to tell from here exactly what went wrong.

You could script moving the contents of each railloader into a chest, then mining/rebuilding, then moving the chestcontents back into the new railloader.
I was hoping you already have some function that would find all chests and for each recreate or update the hidden entities. But I'm sure I can script something and then have the mod call it once on the next load.

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Sat Jun 15, 2019 3:06 pm
by mrvn
In control.lua in the on_blueprint function you build an array of all the directions of bulk rail loader and unloader chests by looking at the direction of the rails below the chest. Then in a second loop you create placement proxies for each chest. Problem is that if the first loop doesn't find any rails then you don't add an entry in the directions array so the second loop will a) get out of sync and b) overflow the array dimensions. I fixed that by adding a dummy direction when no rail is found:

Code: Select all

diff --git a/railloader_0.6.1/control.lua b/railloader_0.6.1/control.lua
index c22ee5f..3e53fe0 100644
--- a/railloader_0.6.1/control.lua
+++ b/railloader_0.6.1/control.lua
@@ -309,6 +309,8 @@ local function on_blueprint(event)
       }[1]
       if rail then
         directions[#directions+1] = rail.direction
+      else
+        directions[#directions+1] = 0
       end
     end
   end

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Sat Jun 15, 2019 5:26 pm
by Therax
mrvn wrote:
Sat Jun 15, 2019 3:06 pm
Problem is that if the first loop doesn't find any rails then you don't add an entry in the directions array so the second loop will a) get out of sync and b) overflow the array dimensions. I fixed that by adding a dummy direction when no rail is found:
You should never have a BRL without rails underneath it. When a BRL is built the rails are created automatically and made unminable. If something is breaking that setup that’s a bug in whatever is breaking it.

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Sun Jun 16, 2019 9:12 am
by mrvn
Therax wrote:
Sat Jun 15, 2019 5:26 pm
mrvn wrote:
Sat Jun 15, 2019 3:06 pm
Problem is that if the first loop doesn't find any rails then you don't add an entry in the directions array so the second loop will a) get out of sync and b) overflow the array dimensions. I fixed that by adding a dummy direction when no rail is found:
You should never have a BRL without rails underneath it. When a BRL is built the rails are created automatically and made unminable. If something is breaking that setup that’s a bug in whatever is breaking it.
Sure, it shouldn't happen. But it can happen or you wouldn't check for it. I think it can happen with waterfill as that drowns even unminable entities.

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Mon Jun 17, 2019 4:56 am
by Therax
mrvn wrote:
Sun Jun 16, 2019 9:12 am
Sure, it shouldn't happen. But it can happen or you wouldn't check for it. I think it can happen with waterfill as that drowns even unminable entities.
Actually, I check for it because chests don't have a concept of direction, they always point "north." So I need to know the direction of the rails underneath to know what direction the BRL in the blueprint should be facing. I always expect a rail to be present. Anything like Waterfill that destroys the (unminable, undamageable) rail would almost certainly destroy the overlapping main chest entity as well.

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Mon Jun 17, 2019 9:44 am
by mrvn
Therax wrote:
Mon Jun 17, 2019 4:56 am
mrvn wrote:
Sun Jun 16, 2019 9:12 am
Sure, it shouldn't happen. But it can happen or you wouldn't check for it. I think it can happen with waterfill as that drowns even unminable entities.
Actually, I check for it because chests don't have a concept of direction, they always point "north." So I need to know the direction of the rails underneath to know what direction the BRL in the blueprint should be facing. I always expect a rail to be present. Anything like Waterfill that destroys the (unminable, undamageable) rail would almost certainly destroy the overlapping main chest entity as well.
I know why you look for the rail. That's not what I'm talking about. It's the "if rail then" part. You expect that you might not find a rail. As long as there is an "if rail then" there must be an "else" for the code to be correct.

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Mon Jun 17, 2019 6:44 pm
by Therax
mrvn wrote:
Mon Jun 17, 2019 9:44 am
I know why you look for the rail. That's not what I'm talking about. It's the "if rail then" part. You expect that you might not find a rail. As long as there is an "if rail then" there must be an "else" for the code to be correct.
Sorry, you are correct. I misunderstood what you were saying. How did you discover the bug? Did you have a situation where you blueprinted a BRL which had no rails? How did that come about?

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Sat Jun 22, 2019 12:55 pm
by mrvn
Therax wrote:
Mon Jun 17, 2019 6:44 pm
mrvn wrote:
Mon Jun 17, 2019 9:44 am
I know why you look for the rail. That's not what I'm talking about. It's the "if rail then" part. You expect that you might not find a rail. As long as there is an "if rail then" there must be an "else" for the code to be correct.
Sorry, you are correct. I misunderstood what you were saying. How did you discover the bug? Did you have a situation where you blueprinted a BRL which had no rails? How did that come about?
As mentioned I expanded the mod to have a loader mkII with bigger chest. I broke lots of things while adding that. I think I discovered it there.

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Sun Jun 30, 2019 10:50 am
by MoiAimeBien
Hi,
When BRL is used with other mod :
Bio-Industries
Bob's Functions Library
Bob's Logistics

The standard recipe for rail is removed.
Instead it's replace with "Wooden straight rail".
So the BRL beacame uncraftable due to that.

I'dont really know who is reponsible for the disapearance of the vanilla rail...

Thanks for reading.

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Sun Jun 30, 2019 5:20 pm
by Therax
MoiAimeBien wrote:
Sun Jun 30, 2019 10:50 am
Hi,
When BRL is used with other mod :
Bio-Industries
Bob's Functions Library
Bob's Logistics

The standard recipe for rail is removed.
Instead it's replace with "Wooden straight rail".
So the BRL beacame uncraftable due to that.

I'dont really know who is reponsible for the disapearance of the vanilla rail...

Thanks for reading.
Bio-Industries doesn't remove the vanilla rail, but it is the advanced version of rails. You can upgrade wooden straight rails to regular rails by crafting them with stone bricks.

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Mon Jul 01, 2019 1:04 am
by mrvn
Therax wrote:
Sun Jun 30, 2019 5:20 pm
MoiAimeBien wrote:
Sun Jun 30, 2019 10:50 am
Hi,
When BRL is used with other mod :
Bio-Industries
Bob's Functions Library
Bob's Logistics

The standard recipe for rail is removed.
Instead it's replace with "Wooden straight rail".
So the BRL beacame uncraftable due to that.

I'dont really know who is reponsible for the disapearance of the vanilla rail...

Thanks for reading.
Bio-Industries doesn't remove the vanilla rail, but it is the advanced version of rails. You can upgrade wooden straight rails to regular rails by crafting them with stone bricks.
It also adds a new tech for the advanced rails so you need to do some more research before you can build BRLs.

Personally I've edited the BRLs to have a wooden rail recipe. I should really polish the changes and send them as patch. Currently the new recipes are unconditional which needs to change. Here is what I made:

1) BRLs mk I: needs wooden rails, smaller inventory
2) BRLs mk II: needs rails (mk II), normal inventory
3) BRLs mk III: needs BRL mk II + warehouse, extra large inventory

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Sat Apr 25, 2020 10:08 am
by jakeyjkp
Unloader.png
Unloader.png (3.88 MiB) Viewed 4813 times
I'm probably a bit thick here but I can't get the unloaders to move the unloaded stuff. Here there's some stone in the unloader but how does it get from there?

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Sat Apr 25, 2020 10:32 am
by steinio
jakeyjkp wrote:
Sat Apr 25, 2020 10:08 am
Unloader.png

I'm probably a bit thick here but I can't get the unloaders to move the unloaded stuff. Here there's some stone in the unloader but how does it get from there?
Inserters like from every container?
The mod miniloaders can fill the belts with full throughput.

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Sat Apr 25, 2020 8:30 pm
by jakeyjkp
Ah yes - I'll go with them. Thanks for the pointer Steinio. Just noticed we joined these forms same day. :roll: But I ain't added much...

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Sat Apr 25, 2020 8:51 pm
by steinio
jakeyjkp wrote:
Sat Apr 25, 2020 8:30 pm
Ah yes - I'll go with them. Thanks for the pointer Steinio. Just noticed we joined these forms same day. :roll: But I ain't added much...
Ha, better few but quality content then a lot nonsense like the most of my posts :)

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Mon Apr 27, 2020 12:04 pm
by ProMix
BLR don't load to rail wagon with filters
I think that the reason for this icreased inserter stack size. My theory - internal inserter have items but can't put in inventory.
Save: https://yadi.sk/d/els-xQlmtyiPpw
P.S. Sorry for english

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Thu May 14, 2020 9:16 pm
by greenskye
Is it possible for BRLs to respect slot limiting when blueprinting? Trying to limit the massive inventories to a single rail car worth, but it doesn't seem to save in blueprints

Re: [MOD 0.16] Bulk Rail Loaders

Posted: Fri May 15, 2020 5:43 am
by Therax
greenskye wrote:
Thu May 14, 2020 9:16 pm
Is it possible for BRLs to respect slot limiting when blueprinting? Trying to limit the massive inventories to a single rail car worth, but it doesn't seem to save in blueprints
Yes, it’s possible. It’s even been on my todo list for a while, but just haven’t gotten around to it. I’ll have another look and see how much work it will take.