Factory Planner


This mod allows you to plan your production in advance, specifying the recipes and machines that make up each assembly line. It provides powerful features that are fast and intuitive to use, so you can focus on actually building your factory.

Utilities
4 months ago
0.17 - 1.1
209K

i Request Materials

11 months ago

I don't know if this is really an "intended use" for Factory Planner, but when it comes to making my armour equipment (especially in modded games) I set up a factory with the number of items I want - for example, "1 power armor / minute", "8 portable solar panels / minute" etc and just ignore the "per minute" part. Then I can add the recipes, and get the breakdown of what materials I need.

Currently I have to manually feed those materials and numbers into my logistic request slots to get them delivered to me. Either that or use the Combinator button and hook it up to a requester chest, but I don't have requesters at that stage of the game!

I would love it if a similar feature to the "request buildings to make this" button, but for the materials. So in this example I'd click the button and get the batteries, gears, engines etc. needed for making my equipment delivered to me.

11 months ago

Thanks for the suggestion. I definitely understand your usecase, even if it's not quite what the mod is intended for. I would be up for just adding this functionality, but it's a bit trickier than for the combinator, since there's a lot to keep track of in the background, the system for these requests is pretty involved. Anyways, I wrote it down, if I can modularize that stuff properly, I'll add it!

11 months ago

Thank you for the response! I'm glad you made sense of my request :D

I've had a cursory look at the code. Would it not be a matter of updating item_boxes.lua and adding a second button alongside the combinator button, perhaps with item-request-proxy as the icon, then its handler should probably just be similar to put_ingredients_into_cursor but creating the item request proxy instead of calling the ui_util.put_item_combinator_into_cursor function? The only additional adjustment I can see would be making sure to round up non-integer ingredient amounts.

Of course I could be in the position of "knowing just enough to be dangerous", I'm sure you have a much better idea of what is/n't possible or desired!

11 months ago

That's the gist of it, but there is a lot of bookkeeping required around request proxys to know when they're fulfilled etc. It's those parts that I need to extend to work in two places.

11 months ago

Ahh, I knew there had to be something! Couldn't be as easy as "fire and forget", right? XD I did see some of that bookkeeping related to the "get missing machines" code, and it's definitely something that would prefer to be refactored rather than duplicated, so I'm seeing the issue quite clearly! Thanks again :)

11 months ago

There's always something for sure lol