Page 5 of 9

Re: [MOD 0.14/0.15] Inventory Sensor 1.5.2

Posted: Wed Nov 15, 2017 5:20 pm
by runamucker
Optera wrote:This is by design. To work with manual trains and cars IS has to constantly scan for these vehicles. Doing so every tick would utterly tank performance so it's set to only scan every 2s. Automatic mode trains and static entities are handled instantly through events.
If you feel 2s is too slow you can change it in Options - Map Settings - Entity scan interval.

However for refueling locomotives even 10s would fast enough. Wire the inserter directly to IS and set it to stack size = 1; active if locomotive detected > 0.
The inserter will only start working after is found a locomotive and will never get stuck holding items it couldn't insert.

In the first problem, I'm talking about automatic trains not being handled instantly. It's only a couple seconds after they arrive that the sensor detects them. It doesn't appear to be reading the arrival of automatic locomotives from events.

And Problem 2? After a manual train has left the station, the train is still detected as being in the station until some other vehicle passes in front of it, as in the screenshot, taken about a minute after the train left the station. The desired behaviour is that IS has no output signal two seconds after the train leaves, but the output persists as if the train is still there.

Re: [MOD 0.14/0.15] Inventory Sensor 1.5.2

Posted: Wed Nov 15, 2017 8:41 pm
by Optera
Like I said vehicles are cleared and re-scanned every scan interval.
Trains are removed every update interval when their state changes to any state other than wait_station, wait_signal or manual.

The only explanation for your effects is setting very long update and scan intervals.

Re: [MOD 0.14/0.15] Inventory Sensor 1.5.2

Posted: Thu Nov 16, 2017 6:54 am
by runamucker
Optera wrote:Like I said vehicles are cleared and re-scanned every scan interval.
Trains are removed every update interval when their state changes to any state other than wait_station, wait_signal or manual.

The only explanation for your effects is setting very long update and scan intervals.

So for the first problem, to be clear, you intend that both automatic and manual trains arriving at a station should expect up to a 2 second delay in identification? If so, OK.

For the second problem, I'm using the default settings for the mod -- haven't touched anything. An IS object takes up to 2 seconds to identify all types of trains (both automatic and manual), and it insists that all manual trains are identified as still in front of the IS indefinitely long after they leave the station while the scan interval is still at default. I wouldn't mention it if I'd messed with the settings at all. If that's not the intended behaviour, then there's a conflict with something.

Re: [MOD 0.14/0.15] Inventory Sensor 1.5.2

Posted: Thu Nov 16, 2017 4:50 pm
by Optera
The only way to reproduce your effects is to have insane high intervals set. I don't know if you, your friends in MP or some factorio glitch set those and frankly I don't care.
Reset mod settings to default while effected saves are loaded and IS will again work again.

Re: [MOD 0.14/0.15] Inventory Sensor 1.5.2

Posted: Fri Nov 17, 2017 4:17 am
by runamucker
Optera wrote:The only way to reproduce your effects is to have insane high intervals set. I don't know if you, your friends in MP or some factorio glitch set those and frankly I don't care.
Reset mod settings to default while effected saves are loaded and IS will again work again.
I reset the mod settings. It still doesn't work. I don't play MP.

When the settings are wrong, all vehicles passing in front of it would cause this problem. But this only happens with manual trains. Not automatic trains, not cars, not tanks. So it's not about the scan interval settings.

Re: [MOD 0.14/0.15] Inventory Sensor 1.5.2

Posted: Fri Nov 17, 2017 1:33 pm
by Optera
Please attach the save file where this happens.
Preferably without any mod except IS.

Re: [MOD 0.14/0.15] Inventory Sensor 1.5.2

Posted: Fri Nov 17, 2017 7:56 pm
by runamucker
Optera wrote:Please attach the save file where this happens.
Preferably without any mod except IS.
Here. There's an IS at each platform.

Re: [MOD 0.14/0.15] Inventory Sensor 1.5.2

Posted: Fri Nov 17, 2017 9:48 pm
by Optera
Fixed in 1.5.3.
Seems like I removed some code a while ago and never noticed manual trains no longer reset connection properly. :oops:

Re: [MOD 0.14/0.15] Inventory Sensor 1.5.2

Posted: Fri Nov 17, 2017 11:17 pm
by runamucker
Optera wrote:Fixed in 1.5.3.
Seems like I removed some code a while ago and never noticed manual trains no longer reset connection properly. :oops:
yw

Re: [MOD 0.14/0.15] Inventory Sensor 1.5.2

Posted: Sat Nov 18, 2017 4:16 am
by Jürgen Erhard
And that fix broke it.

Loaded (very modded) save file. Didn't notice anything at first, I was busy building coal liquefaction. After I'm done, I… notice everything stopped in the refinery. No iron got produced. Huh? Check, check… oh, but there are iron trains in the waiting area. They are let through to the ore unloading stations when the ISes detect the ores that are currently requested. But the ISes only detected the cargo wagons, and no ore.

Trains are all auto.

Went back to 1.5.2, and everything works again. Classic regression.

Nope, never touched the settings.

Re: [MOD 0.14/0.15] Inventory Sensor 1.5.4

Posted: Sat Nov 18, 2017 6:10 am
by Optera
Jürgen Erhard wrote:And that fix broke it.

Classic regression.
Classic coding while drunk/tired.

Fixed in 1.5.4

Re: [MOD 0.14/0.15] Inventory Sensor 1.5.4

Posted: Wed Dec 06, 2017 12:12 am
by Kamuchi
Thanks Optera for this little tiny quality of life mod, was pulling my hair out for awhile untill remembering you made this :lol:
The train blueprint

Re: [MOD 0.16] Inventory Sensor 1.6.2

Posted: Mon Jan 22, 2018 5:54 am
by abordoli
Great mod!

Can this be used to sense the inventory inside labs? (including burner labs)/

Regards,
~B

Re: [MOD 0.16] Inventory Sensor 1.6.2

Posted: Mon Jan 22, 2018 6:46 am
by Optera
If labs are special assemblers it will work with the current version, otherwise I'd have to include their entity type to scan targets.

Edit:
Added Lab inventory and Research progress to 1.6.3.

Re: [MOD 0.16] Inventory Sensor 1.6.3

Posted: Wed Jan 24, 2018 2:22 pm
by Ironhair
Does this read the contents of train fuel?

Re: [MOD 0.16] Inventory Sensor 1.6.3

Posted: Wed Jan 24, 2018 2:28 pm
by Optera
Ironhair wrote:Does this read the contents of train fuel?
Items in burner input and output slots yes, fuel bar no.

Re: [MOD 0.16] Inventory Sensor 1.6.3

Posted: Wed Jan 24, 2018 2:31 pm
by Ironhair
Optera wrote:
Ironhair wrote:Does this read the contents of train fuel?
Items in burner input and output slots yes, fuel bar no.
Thank you for the very very quick reply.

Was hoping to limit loading solid fuel only in 1 slot, coal in other 2... while using big bags.
Didn't want to have my 2 loco trains with 3k solid fuel !! :(

Re: [MOD 0.16] Inventory Sensor 1.6.3

Posted: Wed Jan 24, 2018 2:33 pm
by Ironhair
Optera wrote:
Ironhair wrote:Does this read the contents of train fuel?
Items in burner input and output slots yes, fuel bar no.
Just to confirm, can I use this mod to limit how much solid fuel or rocket fuel I'm loading in a locomotive?

Re: [MOD 0.16] Inventory Sensor 1.6.3

Posted: Wed Jan 24, 2018 2:43 pm
by Optera
Ironhair wrote:Was hoping to limit loading solid fuel only in 1 slot, coal in other 2... while using big bags.
Didn't want to have my 2 loco trains with 3k solid fuel !! :(
That'd require a fair bit of circuit trickery and a filter inserter to get around some game mechanics.

You want the solid fuel in the first (leftmost) slot of the loco.
Inserters will always pick up coal before solid fuel due to how item array is sorted internally.

That means you have to build a circuit with IS that acts like this:

Code: Select all

IF InventorySensor reads Locomotive Detected THEN
  IF InventorySensor reads < 50 Solid Fuel THEN 
     output = solid fuel
  ELSE IF InventorySensor reads solid fuel >= 50 AND coal < 100 THEN
     output = coal
  END
END
If you drop the coal requirement it's as simple as hooking up an inserter to IS and set the inserter to only work if Solid Fuel < 50.
Note: this will also fill cargo wagons so at least a combinator checking for Locomotive Detected & Solid Fuel < 50 is recommended.

Re: [MOD 0.16] Inventory Sensor 1.6.3

Posted: Thu Jan 25, 2018 1:11 pm
by mrvn
Optera wrote:
Ironhair wrote:Was hoping to limit loading solid fuel only in 1 slot, coal in other 2... while using big bags.
Didn't want to have my 2 loco trains with 3k solid fuel !! :(
That'd require a fair bit of circuit trickery and a filter inserter to get around some game mechanics.

You want the solid fuel in the first (leftmost) slot of the loco.
Inserters will always pick up coal before solid fuel due to how item array is sorted internally.

That means you have to build a circuit with IS that acts like this:

Code: Select all

IF InventorySensor reads Locomotive Detected THEN
  IF InventorySensor reads < 50 Solid Fuel THEN 
     output = solid fuel
  ELSE IF InventorySensor reads solid fuel >= 50 AND coal < 100 THEN
     output = coal
  END
END
If you drop the coal requirement it's as simple as hooking up an inserter to IS and set the inserter to only work if Solid Fuel < 50.
Note: this will also fill cargo wagons so at least a combinator checking for Locomotive Detected & Solid Fuel < 50 is recommended.
"IF InventorySensor reads solid fuel >= 50" is redundant.