Responsive Crafting Queue

This is the place to request new mods or give ideas about what could be done.
Post Reply
Vile
Inserter
Inserter
Posts: 20
Joined: Thu Jul 23, 2015 3:42 am
Contact:

Responsive Crafting Queue

Post by Vile »

I don't want to change the way the queue operates in terms of crafting time, or back to front, or whatever. I want the crafting queue to be more responsive to the player receiving items. Whether I craft something, pick something up from the ground, or a box, or a robot delivers something, I want the mod to remove the item from the existing queue. I'm not a mod writer, but this seems possible to me with existing functionality.

The way the queue works currently, any item you want to craft has a recipe, the program removes any items you already have from the recipe and it begins to craft anything left. If, you cancel an item during the build, you get any finished items added to your inventory as they've already been crafted even though you can't see them anywhere (hidden queue?). Now, say you're crafting the roboport from scratch (no idea why) and you are 5 advanced circuits into it before a robot delivers the other 40. If you do nothing, the queue will continue crafting advanced circuits. If you cancel, you'll get the five circuits added to your inventory, then re-start the craft and it knows you have all the advanced circuits you need so your player won't try to craft them again. I would simply like to skip that step. When items get added to your inventory from any source, decrement them from the crafting queue, but continue the build.

Is this possible with the current api?

Divran
Long Handed Inserter
Long Handed Inserter
Posts: 52
Joined: Wed Jan 14, 2015 9:13 pm
Contact:

Re: Responsive Crafting Queue

Post by Divran »

I would've loved to attempt this, but I don't really know where to get started. I checked the wiki and the functionality required doesn't exist there. Now that doesn't mean it doesn't exist, since they might have forgotten to update the wiki, but there's no way to know if they did. This is because objects in factorio are not Lua objects, which means you can't iterate them and retrieve all their values. But like I said, if the wiki is up to date, then no, this functionality doesn't exist. There's no way to know if the user is crafting anything, much less what they're crafting. All we can know is when the crafting process is finished.

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Responsive Crafting Queue

Post by prg »

You can call .help() on the various objects in the game to get a list of methods and values in them. The wiki tends to be reasonably up to date about those.

There's a player.crafting_queue_size that's nonzero when the player is crafting something, but with this alone you won't be able to do anything too interesting.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

Divran
Long Handed Inserter
Long Handed Inserter
Posts: 52
Joined: Wed Jan 14, 2015 9:13 pm
Contact:

Re: Responsive Crafting Queue

Post by Divran »

Thanks for .help()

Created a modding feature request here https://forums.factorio.com/forum/vie ... 28&t=17966

Post Reply

Return to “Ideas and Requests For Mods”