HandyHands - Automatic handcrafting

by Qon

Automatically start handcrafting an item that is quickbar filtered (or in logistics requests) that you don't have enough of whenever your crafting queue is empty. Prioritises items in your cursor and what you need the most. It's like having logistics deliveries for early game!

Utilities
3 years ago
0.13 - 1.1
9.31K

b [Resolved] HandyHands Issue with Bob's Miner Class and Hard crafting

4 years ago

With Bob's Miner, I am able to use smelting recipes through hand crafting.
I choose an Iron Plate in my quick bar and HandyHands crafts Iron Plates, when I have Vanilla Iron Ore in my inventory.
So far so good.

Now to the issue:
The "Hard crafting" mod introduces rich variants of copper and iron ore, and also various recipes to get Iron Plates.
For Iron Plates, in addition to Vanilla Iron Ore, you can now smelt Iron Nuggets or Rich Iron Ore to get Iron Plates as well. You can manually smelt them in hand with the miner's class, but HandyHands refuses to use those items to auto-craft Iron Plates.

It seems like every smelt recipes, which is introduced by the "Hard crafting" mod, cannot be used by HandyHands.
But it also seems like every hand crafting recipe from the same mod can be used by HandyHands.

For example: I can auto-craft Pile of Gravel (recipe added by "Hard crafting"), but I cannot auto-craft stone bricks, which uses 1 Pile of Gravel as smelting recipe (recipe also added by "Hard crafting").

What do you think about it ?

4 years ago

HandyHands uses the recipe with the same name as the item that it tries to craft. If no such recipe exists then HandyHands doesn't go through all the recipes in search of alternative recipes that are incorrectly names but produces the item. It's mostly due to bad coding in others mods that issues arise. And searching for special recipes that are not named like the item is needlessly annoying to code if you want it to be reasonably fast because the simple solution would kill your FPS. So I just tell people to ask the mod authors that don't follow the conventions to fix their stuff instead, since my solution works fine as long as noone else does anything bad.

When multiple recipes have the same output it's a bit different. Not sure if it's worth solving though.

Read: https://mods.factorio.com/mod/HandyHands/discussion/5ca4cec68e609a000d1b53d0

3 years ago

Hmm, so it's also not working for items with multiple recipes ?
Is this following design possible:
You load up all recipes of the game and put them in a GUI (similar to FNEI). In that GUI, you are able to choose recipes, which are available for hand-crafting, for your auto-crafting. Maybe it could be a FNEI addon or have a structural resemblance with FNEI, if it's possible.
What do you think about the problems, that could arise from that design ? Would that be better performance-wise ?

3 years ago
(updated 3 years ago)

I'm not going to make a GUI. In part because that seems like more hours and hours of work (potentially more than all work put into the mod already) for no real benefit and for compatability with a fringe case of mods that have a couple of incompatible items, and also because I think it might actually make the mod worse. I like the simplicity of the mod not having a GUI, that it just works and does the right thing automatically. If you spend time in a GUI then you are wasting time instead of having the mod working for you.

Loading through all recipes and doing a map from items to recipes is the approach, but instead of putting them in a GUI the mod should just try which ones are available and pick whatever works first. If you really want to prioritise recipes then just handcraft manually or build a factory for it. It's a bit out of scope for this mod to do that part for you. It's supposed to be handy, not replace you. q:
The recipe map would have to be rebuilt whenever you unlock new recipes and maybe some other times.

This would also fix the issue of other modmakes writing "bad" code for their mods, though I'm only considering doing it for the items that have multiple recipes bacause then they actually can't all be named the same as the item they produce. I'm a bit busy atm though so can't promise if or when it would happen though.

3 years ago

Okay, I understand. It would be a lot of work to support multiple recipes for one item (And in that case, a GUI would also be an overkill lol). Though I hope that, when it's implemented, that it supports "bad" code as well, because there are mods with mod developers, that aren't available anymore for asking to update their mod (even if it's a little portion, that has "bad" code).

The least I can do is wait for that update to be released. Meanwhile, I wish you good luck with what business you have at the moment, so you can return again someday as soon as you have more free time ;).

Thank you for taking your time and have a nice day!

3 years ago

Though I hope that, when it's implemented, that it supports "bad" code as well

It will. It would require more effort to exclude those. And I haven't avoided doing workarounds for those mods because I'm petty or something, it just haven't been worth my time for me to solve something that is a problem in someone elses mod and that only appears in some rare cases. But with multiple recipes it's my responsibility if I want my mod to actually work, and the solution fixes both cases at the same time. And if people enjoy my mod more that's a plus.

Doing it without a GUI is a bit of work but not unreasonably much if there is genuine need. Since interest has been shown I'm sort of inclined to do it. Depends also on how much time the Factorio client updater fail and waste my time and drain my energy...

3 years ago

Implemented a fix, testing it now before I release it. I hope it works. Took a while for me to come back to it...

3 years ago

HandyHands v1.9.0 should hopefully fix it. Haven't tested with the mods that have reported incompabilities, but my code seems to work and is no longer necessarily relying on recipe names so it should work for every mod anyways now.

New response