[Request] auto BP of filled requester of given recipe

This is the place to request new mods or give ideas about what could be done.
Post Reply
User avatar
metsume
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri Mar 04, 2016 6:33 pm
Contact:

[Request] auto BP of filled requester of given recipe

Post by metsume »

I wanna quickly make blueprints of request chest prefiltered with all materials needed to make single given item.

If I select electric circuit, I wanna spawn bp of requester chest that is already requesting iron plate and 3 copper wire.
If I select assembling machine II, I want a bp of chest that request 2 steel, 3 gears, 3ec and assembler I.

Liquids may be totally skipped, possibly with an option of adding barrels to the requester then extra unpacker assembler 2 tiles away? nah, way too much than I need.

In addition, the ui could let me select deeper recipe and request materials of that materials too, like to select copper plate instead of copper wire for ec? nah, just a song of possible future development of a mod.

Why? for vanilla game: to quickly set requester chest for bot-transport base. Also maybe for moments when I lack few plates to make an accumulator to make single solar panel, coz battery cant be made by hand - that normal chain-craft of ingredients cannot pop (like our avatar could make pre-recipes in hand too, but sometimes cant);
for true purpose, for modded game, where I can make some recipes only in very specific conditions, and collecting materials require a lot of calculating how much of all I need - to be specific, for space exploration mod, where many items, that include buildings can be made only on surface of space platforms or asteroid field or spaceship, but cannot be made on planet surface - i need to gather a lot of materials to make few buildings then to operate them in space, yet, calculating how many total materials i need for 3x A-building, then 4x B-building, then 2x C-building... is a mess. Tried to prepare book by myself, but that could work for that single mod set of mine, with mods, that could be ultimate solution.

Here s quick assemblers gathering book for an example:

0eNrNVMFugzAM/RefE6lA16rcdtxhXzBVKKQetRYSRkK3quLfl9COsKlae+ikXkA2z+/ZfhYHKFWHTUvaFaUxb5AfYsZC/jIJwzeSRh/TliotVMi5fYOQAzmsgYEWdYiEtViXinTFayG3pJEn0DMgvcFPyJN+zQC1I0d45BuCfaG7usTWA0YmZSqyjiSXW7SOt/je+bfHMGiM9QRGhy486YzB3j+9yglUvJLyyKPAt/JITK3RvFHCoaeSpgsTrno2ItOfyApFyz+2iCrCHybwbISjQul8SeiZWtmRixVZvw6jD8vKJ7tloETpqXN4fH7y0c63PUy2zGbJapEm2XIR1zcLujczJr0zYzwJqt/OpP/vTKyY/33HY01yjZuX7Uxuamd2Z3aevbgLvtoGccNrs+nU5AbmV6378r7Tcyx8+P9FqlPbYSwGQjraYRH7PCvQfwFD0sSL

Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: [Request] auto BP of filled requester of given recipe

Post by Honktown »

Is there a certain goal in mind? I would normally have my requester chests separate so inserters can feed each ingredient continuously. It wouldn't be difficult making a chest where the requests are 10x a recipe count (that would actually be really simple, and can be used with any requester chest). I've never messed with GUI code though, but I play with mods with some guis.
I have mods! I guess!
Link

mrvn
Smart Inserter
Smart Inserter
Posts: 5696
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [Request] auto BP of filled requester of given recipe

Post by mrvn »

You actually can (and do when the recipe needs >= stacksize amounts) get deadlocks with requesting all items in one chest.

That said for most recipes it is safe. But I would usually want 1, 5, 10, 20 or so copies of the recipe. But more useful I would find the sum of 2, 3 or 4 recipes. for when I put a requester chest in the middle with 2, 3 or 4 assemblers around it. Items produced by one recipe and needed by another should not be included.

Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: [Request] auto BP of filled requester of given recipe

Post by Honktown »

Well uh:

https://wiki.factorio.com/Requester_chest

0.12.0:
Copy entity settings mechanism now allows copy from assembling machines and paste to requester chests.

If someone's good with guis, they can make a gui that just copies an assembler to a buffer, and if it's still valid on "paste", applies the settings to an open chest. I'm going a long way around: recipes->results->"dictionary" of results to recipes->set request slot 10->close gui->recipe request fills logistic slots with multiplier->do it again->cycles to next recipes in "dictionary"
I have mods! I guess!
Link

Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: [Request] auto BP of filled requester of given recipe

Post by Honktown »

https://mods.factorio.com/mod/RecipeRequester

Honk honk. just4u

Edit: I forget I modified my stack sizes. I don't think there'd be issues with most recipes (purple science takes 30 rails... satellites take 6 items and 50-100 a piece or whatever... that's about the most I can think). Don't go making 300 satellites at 4 assemblers and it'll probably be fine.
I have mods! I guess!
Link

User avatar
metsume
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri Mar 04, 2016 6:33 pm
Contact:

Re: [Request] auto BP of filled requester of given recipe

Post by metsume »

Greatly thx Honk,
works great, even had a chance to discover, that base vanilla game have similar option to put assembler recipe to requester but in amount of materials needed for one minute of assembler work, as copy-paste function. Yet, this one require to have building that can craft needed recipe, and amount of result misses my needs a lot.

Peace was never an option!

mrvn
Smart Inserter
Smart Inserter
Posts: 5696
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [Request] auto BP of filled requester of given recipe

Post by mrvn »

Yes, vanilla has that copy&paste feature. What is lacking is a choice of the multiplier and no way to add 2 recipes.

Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: [Request] auto BP of filled requester of given recipe

Post by Honktown »

mrvn wrote:
Wed Jan 15, 2020 2:24 pm
Yes, vanilla has that copy&paste feature. What is lacking is a choice of the multiplier and no way to add 2 recipes.
Would you want my mod to add recipes based on the last and second to last slot (and even third)? It would be easy enough to implement, but stuff could get a little confused (cycling recipes wouldn't work - I would leave it broken for more than one recipe added unless I had some inspiration). It's not like there's a performance concern, since I only do my thing when a chest is closed.
I have mods! I guess!
Link

User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 882
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: [Request] auto BP of filled requester of given recipe

Post by Impatient »

Honktown you are a wizard!

If I may add my input.

1. If I drop a blueprint on to the gui you created, I would like it to translate that immediately (before closing the chest) to order all the items necessary for that blueprint.
2. If I select a recipe, I would like it to immediately translate it to the ingredients of that recipe.
3. Independently from 1 and 2 I would like to have a mechanic that alows me to break down an ordered item type into it's recipes ingredients.

Examples:
I have a bp of a standard 4-4 balancer (6 spliters + 2u-belts + 14 belts).

ad 1) If I drop the bp onto the gui, the chest immediately is set to order (6 spliters + 2u-belts + 14 belts).
ad 2) If I select the recipe of a yellow splitter (on an empty chest), then the chest immediately is set to order it's ingredients (5ec + 5 ip + 4 belts).
ad 3) (continuing from example for feature 1. After dropping the bp, the chest was set to order (6 spliters + 2u-belts + 14 belts)) If I <modifier> click the splitters, they immediately are broken down to the splitters recipes ingredients.
The chest would then order:
(6 x (5ec + 5 ip + 4 belts) + 2u-belts + 14 belts) =
(30ec + 30 ip + 24 belts) + 2u-belts + 14 belts) =
(30ec + 30ip + 2u-belts + 38 belts)

4. If I select several recipes or drop several bps then the ordered items are just added together.

The quantity slider always just multiplies the shwon ammounts of ordered items. That, I guess, would mean, that if I need recipe ingredients or bp items in different quantities ( eg 5x recipeX, 2x bpA, 1x bpB), I would need to use different chests.

Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: [Request] auto BP of filled requester of given recipe

Post by Honktown »

Impatient wrote:
Thu Jan 16, 2020 1:42 am
Honktown you are a wizard!

If I may add my input.

1. If I drop a blueprint on to the gui you created, I would like it to translate that immediately (before closing the chest) to order all the items necessary for that blueprint.
2. If I select a recipe, I would like it to immediately translate it to the ingredients of that recipe.
3. Independently from 1 and 2 I would like to have a mechanic that alows me to break down an ordered item type into it's recipes ingredients.

Examples:
I have a bp of a standard 4-4 balancer (6 spliters + 2u-belts + 14 belts).

ad 1) If I drop the bp onto the gui, the chest immediately is set to order (6 spliters + 2u-belts + 14 belts).
ad 2) If I select the recipe of a yellow splitter (on an empty chest), then the chest immediately is set to order it's ingredients (5ec + 5 ip + 4 belts).
ad 3) (continuing from example for feature 1. After dropping the bp, the chest was set to order (6 spliters + 2u-belts + 14 belts)) If I <modifier> click the splitters, they immediately are broken down to the splitters recipes ingredients.
The chest would then order:
(6 x (5ec + 5 ip + 4 belts) + 2u-belts + 14 belts) =
(30ec + 30 ip + 24 belts) + 2u-belts + 14 belts) =
(30ec + 30ip + 2u-belts + 38 belts)

4. If I select several recipes or drop several bps then the ordered items are just added together.

The quantity slider always just multiplies the shwon ammounts of ordered items. That, I guess, would mean, that if I need recipe ingredients or bp items in different quantities ( eg 5x recipeX, 2x bpA, 1x bpB), I would need to use different chests.
Let's see, I didn't read the whole thing yet so I'll respond as I read.

A blueprint is more likely to have >11 kinds of items in it than a recipe. I could make the mod, but it just wouldn't work for certain blueprints unless I also increased the max requests available (easy enough to do, two lines in data-final-fixes for requesters and buffers). I might have to do something like scan the inventory for blueprints, and it would read it and fill the requests. Would also be possible to warp the chest into a passive provider when the request is filled (maybe as an option). A second step could be watching the chests while it's not fulfilled, so you can place and remove the blueprint and then wait for deliveries and it would gradually clear the requests.

I can have the recipe immediately translate, but I would be uncomfortable doing it: I tested gui events, and for an odd reason they weren't firing, which means I'd have to do something janky. I'm not sure if you can only listen to *your* gui events, or if I did something wrong. I was thinking of asking someone on the forum here about it, because I've seen someone whose mod they were working on was all complicated gui stuff. There might be a way around it, but it'd require some testing (do a translation if the last slot doesn't equal 1 or stack size while the chest is open - don't know if entering part of a number would immediately trigger it and screw up the amount, or if it waits until one leaves the text box to "change" the number).

For 3, you can place a chest outside of a logistic net if possible. My mod DOES tell you how many ingredients (minus fluids), but it makes it a logistic request. I don't know if there'd be another way to do it without introducing a new chest that somehow has request slots but doesn't actually work (chests slots can't be filtered like inventory without mods afaik, so I can't go from blueprint to filtered slots and red everywhere else). I'm not versed in gui stuff to make a pane that would calculate a recipe and have it pinned until it's cleared (maybe that mod already exists?).

In the examples, it might be doable if the dang gui events worked, because they say you can get the modifier keys of a click event. 2 is what my mod does, but it only works for one recipe (at the moment). I can add an (per-user?) option so if you put something in the last slot, it removes a request for the item (if present) and puts in a request for the ingredients, but doesn't clear existing requests. Then if there were enough slots, you could place a blueprint, and if you're missing the items, just put in a request for that many in the last slot and it'd add the recipe stuff to existing requests. Would only kind of work once, because I can't really determine if a recipe was already added to the requests (I mean, I could keep a separate tracking table while the chest is opened and figure out what to do with that to make it consistent each step, but that gets complicated).

Edit: Looking for specfic modder, found some existing mods:

https://mods.factorio.com/mod/blueprint_request_chest (says deprecated, but also says updated to .17)

https://mods.factorio.com/mod/FJEI (recipe browser - doesn't look like it works with a recipe multiplier and unsure if it can pin the recipe)

https://mods.factorio.com/mod/FNEI (another recipe browser)
I have mods! I guess!
Link

User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 882
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: [Request] auto BP of filled requester of given recipe

Post by Impatient »

Honktown wrote:
Thu Jan 16, 2020 2:19 am
A blueprint is more likely to have >11 kinds of items in it than a recipe. ... unless I also increased the max requests available (easy enough to do, two lines in data-final-fixes for requesters and buffers).
check
Honktown wrote:
Thu Jan 16, 2020 2:19 am
I might have to do something like scan the inventory for blueprints, and it would read it and fill the requests.
I wish there was some sort of drop zone gui element which can be reused. the event data would give the item droped (including the specific bp).
Honktown wrote:
Thu Jan 16, 2020 2:19 am
Would also be possible to warp the chest into a passive provider when the request is filled (maybe as an option). A second step could be watching the chests while it's not fulfilled, so you can place and remove the blueprint and then wait for deliveries and it would gradually clear the requests.
I am not sure why you think about that. In my picture, after the requests are set, the chests acts a normal requester.
Honktown wrote:
Thu Jan 16, 2020 2:19 am
I can have the recipe immediately translate, but I would be uncomfortable doing it: I tested gui events, and for an odd reason they weren't firing, ...
Bug report or api feature request?
Honktown wrote:
Thu Jan 16, 2020 2:19 am
In the examples, it might be doable if the dang gui events worked, because they say you can get the modifier keys of a click event.
It doesn't have to be specifically <modifier>+click. Any mechanic would do.
Honktown wrote:
Thu Jan 16, 2020 2:19 am
2 is what my mod does, but it only works for one recipe (at the moment). I can add an (per-user?) option so if you put something in the last slot, it removes a request for the item (if present) and puts in a request for the ingredients, but doesn't clear existing requests. Then if there were enough slots, you could place a blueprint, and if you're missing the items, just put in a request for that many in the last slot and it'd add the recipe stuff to existing requests. Would only kind of work once, because I can't really determine if a recipe was already added to the requests (I mean, I could keep a separate tracking table while the chest is opened and figure out what to do with that to make it consistent each step, but that gets complicated).
I guess the native requester chest gui is too limited for those features.

User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 882
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: [Request] auto BP of filled requester of given recipe

Post by Impatient »

Regarding the button used to split an item into its ingredients: I just tested that eg the middle mouse button has no function yet on a specific request.

Post Reply

Return to “Ideas and Requests For Mods”