[MOD 0.12.35] Logistics Railway 1.0.8

Topics and discussion about specific mods
Pacifyer
Burner Inserter
Burner Inserter
Posts: 7
Joined: Mon Dec 07, 2015 5:30 pm
Contact:

Re: [MOD 0.12.26] Logistics Railway 1.0.4

Post by Pacifyer » Sun Mar 20, 2016 10:43 pm

I have found an odd behavior, and I'm not sure if it's a bug or a feature. I recently installed your mod and the newly-named 8L mod. I opened up my test map and started to play around with both together. Here's an image to go along with the description:

Image

With the 8L mod, each wagon is exactly 8 blocks in length. The belt pieces show the borders of the wagons. That means each wagon should correspond to exactly 4 logistic rail pieces.

When I set different items for each of the 4 requester rails, only the item from the 2nd rail piece is fulfilled.

When I use the active provider, only then 2nd works (as shown in the image). Any other placement of a single active provider rail does not unload the wagon.

Is this intended, or an unintended interaction with the 8L mod?

Thanks!

Yinan
Fast Inserter
Fast Inserter
Posts: 125
Joined: Sun Feb 14, 2016 2:40 pm
Contact:

Re: [MOD 0.12.26] Logistics Railway 1.0.4

Post by Yinan » Sun Mar 20, 2016 10:50 pm

Isn't that the normal behaviour even without the 8L mod?

I mean when creating the entity for the logistic cargo, it has to choose one of the rails it has (or I think that's what it does).
Why would you even have different settings for the rail pieces if you want to configure the same wagon? Just put everything in one rail and just copy that setting to the other rails for the same wagon.

Pacifyer
Burner Inserter
Burner Inserter
Posts: 7
Joined: Mon Dec 07, 2015 5:30 pm
Contact:

Re: [MOD 0.12.26] Logistics Railway 1.0.4

Post by Pacifyer » Sun Mar 20, 2016 11:18 pm

Isn't that the normal behaviour even without the 8L mod?
I don't know, that's why I'm asking. I guess I should disable the mod and see, but that requires re-configuring trains as well.

As for why you'd want more than one requester -- when you want more distinct item types in the wagon than you can select from one requester rail. The requester rail allows for 10 items, but a wagon can hold 30. I regularly use 14-18 different items per wagon when setting up an outpost construction train, or for my FARL. With stack sizes being 50 for most items, there are quite a few items that don't need more than one stack.

------------------
EDIT:

I removed 8L and confirmed that only one rail piece works, no matter the wagon length. It's whatever piece is closest to the center, probably whichever rail piece intersects with the hitbox of the wagon. For the 8L mod, that always lines up with the second rail piece. For vanilla, it could vary between the second or third, depending on the wagon's order in the train (I didn't check thoroughly).

Supercheese
Filter Inserter
Filter Inserter
Posts: 835
Joined: Mon Sep 14, 2015 7:40 am
Contact:

Re: [MOD 0.12.26] Logistics Railway 1.0.4

Post by Supercheese » Mon Mar 21, 2016 12:21 am

Pacifyer wrote:As for why you'd want more than one requester -- when you want more distinct item types in the wagon than you can select from one requester rail. The requester rail allows for 10 items, but a wagon can hold 30. I regularly use 14-18 different items per wagon when setting up an outpost construction train, or for my FARL. With stack sizes being 50 for most items, there are quite a few items that don't need more than one stack.

I removed 8L and confirmed that only one rail piece works, no matter the wagon length. It's whatever piece is closest to the center, probably whichever rail piece intersects with the hitbox of the wagon. For the 8L mod, that always lines up with the second rail piece. For vanilla, it could vary between the second or third, depending on the wagon's order in the train (I didn't check thoroughly).
Yes, as you have discovered each wagon can only have 10 requests set, corresponding to the particular requester rail piece it finds directly beneath it. This is a limitation of all Requester Chests, it seems they are hard-coded to have exactly 10 request slots, and there doesn't seem to be any way to change this in a mod.

To work around this limitation, you can either use multiple wagons or have two separate loading stations, and set some of your request slots on one station, and the rest on the second station.

EmperorZelos
Long Handed Inserter
Long Handed Inserter
Posts: 56
Joined: Sat Mar 05, 2016 5:44 am
Contact:

Re: [MOD 0.12.26] Logistics Railway 1.0.4

Post by EmperorZelos » Fri Mar 25, 2016 1:48 pm

May I suggest trying to make it compatible with smart trains? Smart trains automatically just stop and hecne the railway dosen't get activated.

Supercheese
Filter Inserter
Filter Inserter
Posts: 835
Joined: Mon Sep 14, 2015 7:40 am
Contact:

Re: [MOD 0.12.26] Logistics Railway 1.0.4

Post by Supercheese » Fri Mar 25, 2016 10:00 pm

EmperorZelos wrote:May I suggest trying to make it compatible with smart trains? Smart trains automatically just stop and hecne the railway dosen't get activated.
I'm not certain what Smart Trains does, as I haven't used it, but if it toggles trains into Manual mode then this would indeed make it incompatible. Is this, in fact, what happens?

Yes, this is what happens, and that makes it incompatible. In any event, Smart Trains would be broken by this mod, since it checks the wagon inventory but Logistics Railway transfers the wagon inventory into another invisible entity. This would completely mess with "Leave when empty/full" orders.

See below.

Supercheese
Filter Inserter
Filter Inserter
Posts: 835
Joined: Mon Sep 14, 2015 7:40 am
Contact:

Re: [MOD 0.12.29] Logistics Railway 1.0.5

Post by Supercheese » Sun Mar 27, 2016 9:40 pm

Thanks to Choumiko, Logistics Railway 1.0.5 is now compatible with Smart Trains (v0.3.77 or greater)! :)

Choumiko
Smart Inserter
Smart Inserter
Posts: 1307
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.12.29] Logistics Railway 1.0.5

Post by Choumiko » Mon Mar 28, 2016 10:00 am

I've just realised an issue. Your proxy chests have inventory size 200 for modded wagon support i assume. This means that the wait until full rule from SmartTrains won't work for now. Thinking about ways to fix it :D

Edit: Ignore that, Logistics Railway actually set's the chests bar to the carg wagons inventory size. Mistake was me not returning true when checking for full inventory :roll: SmartTrains update #2 for today incoming..

operations
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri Apr 01, 2016 2:13 am
Contact:

Re: [MOD 0.12.29] Logistics Railway 1.0.5

Post by operations » Fri Apr 01, 2016 2:40 am

Thanks for the mod. Again something that should have been there in the first place.

But unfortunately there is an issue when using requester rail with multiple requests and cargo wagons that have filters set.

Simple example: RequesterRail has requests set like item X and item Y with quantities set to 1.5k(max) but the cargo wagon only accepts item Y. The bots will fetch both items (most of the times slot#1 request first) place them into the dummy and due to the filter on the cargo wagon only item y will be "accepted" when the train moves on or is stopped/set to manual mode. Because the dummy is deleted if the train moves on or is set to manual mode, you effectivly loose the amount of item x that was delivered to the dummy. :evil:

It would be nice if this rail type (the dummy) could "read" filters and thus possible max quantities or simply copy them from the cargo wagon (maybe overwriting/limiting its own requests) to prevent item loss.

Greetz

Supercheese
Filter Inserter
Filter Inserter
Posts: 835
Joined: Mon Sep 14, 2015 7:40 am
Contact:

Re: [MOD 0.12.29] Logistics Railway 1.0.5

Post by Supercheese » Fri Apr 01, 2016 7:15 am

operations wrote:Thanks for the mod. Again something that should have been there in the first place.

But unfortunately there is an issue when using requester rail with multiple requests and cargo wagons that have filters set.

Simple example: RequesterRail has requests set like item X and item Y with quantities set to 1.5k(max) but the cargo wagon only accepts item Y. The bots will fetch both items (most of the times slot#1 request first) place them into the dummy and due to the filter on the cargo wagon only item y will be "accepted" when the train moves on or is stopped/set to manual mode. Because the dummy is deleted if the train moves on or is set to manual mode, you effectivly loose the amount of item x that was delivered to the dummy. :evil:

It would be nice if this rail type (the dummy) could "read" filters and thus possible max quantities or simply copy them from the cargo wagon (maybe overwriting/limiting its own requests) to prevent item loss.
Yeah, if you have wagons with filters try and request the "wrong" items, things won't work out well. Maybe just be careful not to over-request something? Or just don't use filters and let the requester filters themselves handle things?

operations
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri Apr 01, 2016 2:13 am
Contact:

Re: [MOD 0.12.29] Logistics Railway 1.0.5

Post by operations » Fri Apr 01, 2016 5:55 pm

Code: Select all

			if requester then
				wagon.minable = false -- Don't want any changes to the wagon's inventory while it's been copied over to the proxy chest
				wagon.operable = false
				local chest = wagon.surface.create_entity({name = "requester-chest-from-wagon", position = wagon.position, force = wagon.force})
				local wagon_inventory = wagon.get_inventory(defines.inventory.chest)
				local wagon_filters = {}
				for f = 1, #wagon_inventory do
					local _slot_filter = wagon.get_filter(f)
					if _slot_filter then
						local _slot_filter_not_listed = true
						for l = 1, #wagon_filters do
							if wagon_filters[l] == _slot_filter then
								_slot_filter_not_listed = false
							end
						end
						if _slot_filter_not_listed then
							table.insert(wagon_filters, _slot_filter)
						end
					end
				end
				wagon_inventory.setbar(0)
				local chest_inventory = chest.get_inventory(defines.inventory.chest)
				if #chest_inventory > #wagon_inventory then
					chest_inventory.setbar(#wagon_inventory)	-- Limit the chest inventory size to equal the wagon inventory size; proxy chest has a lot of slots to accommodate modded wagons
				end
				copyInventory(wagon, chest) -- Wagon to chest
				wagon.clear_items_inside()
				local dummy_requester = wagon.surface.find_entity("requester-rail-dummy-chest", wagon.position)
				for s = 1, 10 do			-- It seems all requester chests are limited to 10 request slots
					local request = dummy_requester.get_request_slot(s)
					if request then
						for r = 1, #wagon_filters do
							if request.name == wagon_filters[r] then
								chest.set_request_slot(request, s)
							end
						end
					end
				end
        created = chest
Well after a few hours I was at least able to make it work for my purpose meaning my wagons only have one filter set but the requester rail has set many different requests. Only the ones set inside the cargo-wagon will be passed on to the dummy.

The problem still remains the same if your cargo wagon has more then one filter set exceeding the cargo wagons inventory. To implement that particular part it would be required to:
-fetch stack sizes of items
-count how many slots are actually set to filter x
-calculate maximum quantity of the item and set the request count accordingly

But thats something I leave to people who know lua and factorio lua. Feel free to implement, alter or not to care about it.

Greetz

PS: I didn't implement an if switch for the case that the cargo wagon has no filter set at all, resulting in no request being set for the dummy if the cargo wagon has no filter set.

operations
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri Apr 01, 2016 2:13 am
Contact:

Re: [MOD 0.12.29] Logistics Railway 1.0.5

Post by operations » Fri Apr 01, 2016 11:27 pm

Code
Ok. It seems I couldn't live with the fact leaving that loose end I left open. Altough this if far from perfect it does have its uses. If you replace the "if requester" part within the control.lua with this functionalty changes as follows:
- if no filter is set on the cargo wagon everything is handled as before
- if you set one or multiple filters on the cargo wagon and the requester rail has a request set for that/those specific items, the bots will fetch the items in stack sizes (e.g. 50 iron ore if not altered by mods) no matter what the amount specified in the request actually is. For example if you have a cargo wagon that has filters set for lets say 12 slots iron ore 12 slots copper ore and 5 slots stone, these slots will be filled (of course only if enough supply and the requests are a given) the last slot not having a filter set will stay empty regardless of any settings the requester rail might have.

So what is this good for?
Example
A truly dynamic depot with railstations that all are able to handle every of the (up to) 10 possible requests regardless which train actually shows up. I don't know if people do use one train for lets say 2 stops for iron ore next 2 stops for copper so on and so forth... I don't. Enjoy ... or not!

Greetz

Supercheese
Filter Inserter
Filter Inserter
Posts: 835
Joined: Mon Sep 14, 2015 7:40 am
Contact:

Re: [MOD 0.12.29] Logistics Railway 1.0.5

Post by Supercheese » Fri Apr 01, 2016 11:37 pm

Cool, looks good and I'll test it out. If no bugs are found, I'll add it for the next version -- that will mark 4 different contributors to this mod! It might not sound like much, but that makes it the most collaborative coding project I've ever worked on. :)

OvermindDL1
Fast Inserter
Fast Inserter
Posts: 168
Joined: Sun Oct 05, 2014 6:12 am
Contact:

Re: [MOD 0.12.29] Logistics Railway 1.0.5

Post by OvermindDL1 » Sat Apr 02, 2016 1:04 am

Awesome rails, but any chance on making them more expensive, at least some higher level circuitry or a logistics chest (although I guess the inventory disappears, meh)? And in turn having them drop themselves instead of dropping a normal rail or is this caused by a Factorio limitation?

Supercheese
Filter Inserter
Filter Inserter
Posts: 835
Joined: Mon Sep 14, 2015 7:40 am
Contact:

Re: [MOD 0.12.29] Logistics Railway 1.0.5

Post by Supercheese » Sat Apr 02, 2016 5:09 am

OvermindDL1 wrote:Awesome rails, but any chance on making them more expensive, at least some higher level circuitry or a logistics chest (although I guess the inventory disappears, meh)? And in turn having them drop themselves instead of dropping a normal rail or is this caused by a Factorio limitation?
I can make a config option to increase the cost of the rails. Currently I just have them give you back a regular rail because all it takes to craft them is a single regular rail, so this way you get more flexibility -- e.g. "ah crap I didn't mean to make all these active provider rails, just passive ones" -> promptly plops them all down and picks them back up, allowing to re-craft the passive rails. Naturally this would be changed if the recipe was altered to be more expensive.

Yinan
Fast Inserter
Fast Inserter
Posts: 125
Joined: Sun Feb 14, 2016 2:40 pm
Contact:

Re: [MOD 0.12.29] Logistics Railway 1.0.5

Post by Yinan » Sat Apr 02, 2016 9:00 am

Yeah plz only do that as an option.
I like it the way it currently is.

Supercheese
Filter Inserter
Filter Inserter
Posts: 835
Joined: Mon Sep 14, 2015 7:40 am
Contact:

Re: [MOD 0.12.29] Logistics Railway 1.0.6

Post by Supercheese » Sat Apr 02, 2016 8:54 pm

The new functionality to handle cargo wagon filters -- thanks to operations -- and a config option to increase the recipe cost of Logistics Rails to include 1 Advanced Circuit have been added in version 1.0.6. :)

Drac
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Apr 16, 2016 6:57 pm
Contact:

Re: [MOD 0.12.26] Logistics Railway 1.0.0

Post by Drac » Fri Apr 22, 2016 12:37 am

CmdrKeen wrote:
Any time a Cargo Wagon becomes a Logistics Wagon, its inventory is dumped into a separate invisible entity, and it is in fact that entity that interacts with the logistics network.
When its inventory has been given to the other entity, the wagon's regular inventory is emptied, and any changes to its regular inventory will not interact with the logistics network.
When the train begins moving again, the invisible entity's inventory is given back to the wagon. However, if the wagon's regular inventory has filled up during this time, any items from the invisible entity will be lost, as the wagon has run out of space.
Although you shouldn't be using any inserters on Logistics Wagons, if there are inserters present, they could accidentally insert items that could be destroyed.
As such, any inserters in the vicinity of Logistics Wagons are automatically disabled in order to prevent this. They are re-enabled when the train begins moving again.
Also, please refrain from manually placing any items into wagons that are on top of Logistics Rails, as this may cause you to lose items if the wagon becomes too full.
you might try

Code: Select all

entity.minable = false 
enity.operable = false 
when the cargo wagons are stationary, and set them back to true when the train starts moving today.
I have not had a problem losing things however i did find out that if you have a blueprint inside the wagon when it makes the switch it will clear the blueprint.

Supercheese
Filter Inserter
Filter Inserter
Posts: 835
Joined: Mon Sep 14, 2015 7:40 am
Contact:

Re: [MOD 0.12.26] Logistics Railway 1.0.0

Post by Supercheese » Fri Apr 22, 2016 5:02 am

Drac wrote:I have not had a problem losing things however i did find out that if you have a blueprint inside the wagon when it makes the switch it will clear the blueprint.
Yeah, blueprints are weird like that. I don't know how to copy blueprints from one inventory to another without losing their contents.

Yinan
Fast Inserter
Fast Inserter
Posts: 125
Joined: Sun Feb 14, 2016 2:40 pm
Contact:

Re: [MOD 0.12.29] Logistics Railway 1.0.6

Post by Yinan » Fri Apr 22, 2016 6:58 am

Who the hell transports filled out Blueprints in a train wagon???

Post Reply

Return to “Mods”

Who is online

Users browsing this forum: No registered users