Inventory slots and logistics

Place to get help with not working mods / modding interface.
Pi-C
Smart Inserter
Smart Inserter
Posts: 1759
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Inventory slots and logistics

Post by Pi-C »

Autodrive provides Logistic sensors you can insert into a vehicle so that it can be served by logistic bots if it is parked in an area covered by roboports (bots won't touch moving vehicles):
Logistic network sensor: Car will interact with the logistic network when parked. Filtered trunk slots are refilled like a requester chest, and unfiltered slots are exported like an active provider chest.
Unfortunately, the current implementation isn't very useful:

Suppose there are 2 outposts A and B. You could filter some of the slots in the trunk inventory of your vehicle so that it requests, say, coal. The vehicle could then go to A where bots would fill load coal into these slots. It could then drive to B, where coal is needed for smelting. Once arrived it would sit there and nothing would happen because the coal slots are marked as requester slots. You'd have to toggle the coal slots so that they provide coal for the bots to pick up.

Doing this manually (the way it currently works) may be possible if you only control one or two vehicles -- even then it would be cumbersome. Somebody came up with the idea to mark parking spaces with specific tiles. For example, if a vehicle is parked on concrete, filtered slots could be treated as requesters and unfiltered as providers while filtered slots would be providers and unfiltered slots requesters on hazard concrete.

This idea is a step in the right direction, but it has a serious flaw: It only allows for two states! The problem is that Autodrive also provides fuel and ammo sensors. If they are installed, and the vehicle's fuel or ammo inventories are empty, and if suitable fuel or ammo is in the trunk inventory, the vehicle will refuel/reload from the trunk. Thus, it makes sense to have inventory slots that will always be ignored by bots. (You wouldn't want them to take all of your ammo out of the trunk if you're about to move through a biter-infested area. On the other hand, a vehicle without any weapons doesn't need ammo itself, but could be used to transport ammo from A to B.) I've briefly thought about ignoring the first row of the inventory -- but mods may reduce inventory size to just a few slots, and auto-sorting the inventory may also have strange effects.

So, does anybody have an idea how I could mark three states: "Provide", "Request", and "Ignore"?
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Inventory slots and logistics

Post by eradicator »

Not really good solutions, just some thoughts:
1a) Ignore anything that the vehicle *can* itself use. Pro: Automatic, easy. Con: Makes fuel delivery impossible, and ammo delivery difficult.
1b) Ignore stuff that the vehicle *is* currently using. Now you can deliver coal to outposts if you drive on solid fuel. Still kinda annoying.

2) Introduce a "virtual item" that the player can use to manually seperate the trunk into 1/2/3 areas. I.e "all slots before this item are providers". As the item doesn't have any use except this it doesn't need to be craftable, just usable as a filter, though craftability might (or not) make it better to understand. Pro: Flexible usage. Arbirary slot types. Con: Difficult to explain to the player.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Pi-C
Smart Inserter
Smart Inserter
Posts: 1759
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Inventory slots and logistics

Post by Pi-C »

eradicator wrote: Tue Jul 21, 2020 1:21 pm Not really good solutions, just some thoughts:
1b) Ignore stuff that the vehicle *is* currently using. Now you can deliver coal to outposts if you drive on solid fuel. Still kinda annoying.
This could work. Unless somebody would create a vehicle with an insane amount of fuel slots. Imagine a vehicle having four or five fuel slots, each filled with a different kind of fuel -- then all of these would be ignored by bots. But seriously, who would ever do such a thing? So much potential it could blow up right in your face, you'd have to be self-destructive to attempt anything like that! No, no, something like that would never happen! :mrgreen:
heavy_truck.png
heavy_truck.png (27.09 KiB) Viewed 929 times
2) Introduce a "virtual item" that the player can use to manually seperate the trunk into 1/2/3 areas. I.e "all slots before this item are providers". As the item doesn't have any use except this it doesn't need to be craftable, just usable as a filter, though craftability might (or not) make it better to understand. Pro: Flexible usage. Arbirary slot types. Con: Difficult to explain to the player.
Actually, it would be enough to insert just one of these items: anything before it will be ignored by bots (better yet: these slots would always be requesters, because you'd want to have fuel and ammo replenished), anything after it would work as it does now. Technically, we already create requester and provider chests, so it would be possible to create an extra requester. I guess I'll try that. Thanks for the idea! :-)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Post Reply

Return to “Modding help”