udf / factorio-auto-resource-redux

A factorio mod that automates most logistics so you can focus on combat
MIT License
3 stars 3 forks source link

alerts: handle missing material alerts with any storage #13

Open bengardner opened 2 months ago

bengardner commented 2 months ago

This allows using the player inventory, if available. If you have construction robots, you can now automatically build without a roboport and storage chest. This saves searching for the item in the resource bar and clicking it.

udf commented 2 months ago

Thanks for this PR, I was thinking about adding this, but I didn't come up with a nice solution for sucking items back into storage in the case of cancelled requests (for example if you were to walk past a bunch of ghosts, outside of roboport coverage, you'll get stuff inserted into your inventory). I'm not sure if it'd be an issue in practise, so I'll have to give your changes a try first.

bengardner commented 2 months ago

Yeah, you'd get items stuck in your inventory if you have fewer available construction bots than missing items and you leave the construction range before all the items/bots are sent out. Might be significant if you built via the map and you pass the build area in a fast-moving vehicle. But the player trash is painless, so it is easy to get rid of the extra items.

I don't know how that would work with a Spidertron. Maybe only put items in the inventory of the player that placed the ghost? Although it is nice to be able to build in multiplayer mode and have another player supply the items.

In practice, though, this most often triggers when the player puts down a ghost within construction range and the required items are not in the player inventory, but are in the global inventory. It works great.