[MOD 0.17] HandyHands - Autocrafting - v1.2.2 ammo & pause

Topics and discussion about specific mods
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [MOD 0.13] HandyHands - AutoHandcrafting - v1.1.0 hotconfig

Post by Qon »

Arumba wrote:Hey, I was hoping to suggest an addition to your mod that would be really useful to me! Right now the mod works great for items on your toolbelt. In addition, I would love it if you could automatically craft ammo for your equipped weapons. Most notably regular firearm magazines, pierce rounds, and shotgun shells.

My suggestion would be to only autocraft the type of ammo that is already in the ammo slot. So if you have say 5 rounds of regular ammo, i would autocraft up to 100 regular ammo. If you have 5 piercing ammo, it would autocraft up to 100 piercing, etc.

Would something like this be possible?
Yes it's possible. It's a great suggestion, but I'm unsure how to best implement it without it being confusing.

I've been thinking about autocrafting for non-filtered items. I was imagining it to work just like individual item settings where the mod would autocraft anything you had a setting for even if it wasn't filtered. But I shelfed that idea for a while at least since it could be more annoying than helpful in some cases. For ammo I guess if I just treated the ammo slots as if they were filtered then you could turn that off by giving ammo individual item limits. Maybe I'll combine the two and autocraft if you have a set amount for that ammo type and have some of it in your ammo slot. In case someone doesn't want their ammo autocrafted I don't want to bother them. At the moment you can autocraft ammo like anything else. Not sure if it actually ends up in your ammo slots by default though.

I've been thinking of a pause feature also. I think that if you cancel a craft that was started by HandyHands and you have nothing else in your crafting queue then you probably don't want HandyHands to immediatly add that item back to the crafting queue. In that case I guess HandyHands should pause until you hit "increase" to unpause.
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [MOD 0.13] HandyHands - AutoHandcrafting - v1.1.0 hotconfig

Post by Qon »

HandyHands v1.2.0 is out now!
Qon wrote:My new idea is to treat all stack sizes > 500 (or maybe 200) as if they were actually 10 times smaller. So if a stack is 500 and HandyHands default is 1 stack then it will create 50 items instead of 500. Maybe as a config option.
Done.
Arumba wrote:Hey, I was hoping to suggest an addition to your mod that would be really useful to me! Right now the mod works great for items on your toolbelt. In addition, I would love it if you could automatically craft ammo for your equipped weapons. Most notably regular firearm magazines, pierce rounds, and shotgun shells.

My suggestion would be to only autocraft the type of ammo that is already in the ammo slot. So if you have say 5 rounds of regular ammo, i would autocraft up to 100 regular ammo. If you have 5 piercing ammo, it would autocraft up to 100 piercing, etc.
Done.

Full changelog:

Code: Select all

v1.2.0
------------------------------- 
Features:

* Ammo crafting! Treat ammo slots as if they were filtered with the ammo they contain. 
  firearms-magazine defaults to 0.05 stacks on first join so that you don't lose your starting iron.
* Default stack size is 0.2
* Pause feature! If you cancel a craft that was started by HandyHands then the autocrafting is paused.
* Treat stacks >= 500 is if they were 1/10 the size. So a setting of 1 stack of a 500 stack item just gives you 50.
  The text output doesn't give you this info yet.
* New autocraft limits available: 0.2 and 0.8 stacks. (and all the others are still there) Settings code is now easier to modify for other stack sizes.
* Remote interfaces added for coders who want to read or set HandyHands settings. Also the code was restructured and commented for readability.
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
mindmix
Inserter
Inserter
Posts: 25
Joined: Wed Nov 04, 2015 9:06 pm
Contact:

Re: [MOD 0.13] HandyHands - Autocrafting - v1.2.0 ammo & pause

Post by mindmix »

1.2.0 once again crashes when playing in god mode, because god doesn't have an ammo inventory (line 69, ab is assumed to be list, no checks are made for nil values)
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [MOD 0.13] HandyHands - Autocrafting - v1.2.0 ammo & pause

Post by Qon »

mindmix wrote:1.2.0 once again crashes when playing in god mode, because god doesn't have an ammo inventory (line 69, ab is assumed to be list, no checks are made for nil values)
Sorry! I hope I fixed it now in v1.2.1. I tried to be quick though. I actually tried crafting and pausing while in God-Mode this time at least so I might not have to puch a 1.2.2 immediatly this time. Hope it works. I'll make sure to do some god mode testing before releasing again :roll:

... Maybe I should write a note about it somewhere ...
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
R3CONN3R
Burner Inserter
Burner Inserter
Posts: 7
Joined: Thu Jul 30, 2015 1:44 am
Contact:

Re: [MOD 0.13] HandyHands - Autocrafting - v1.2.1 ammo & pause

Post by R3CONN3R »

Hey!
I tried adding handy hands to an existing save and I'm getting this error

Code: Select all

Error while running event on_tick (ID 0)
__HandyHands__/control.lua:53: attempt to index local 'data' (a nil value)
Im guessing

Code: Select all

if data == nil then
        data = init_player(event.player_index)
    end
never gets called
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [MOD 0.13] HandyHands - Autocrafting - v1.2.1 ammo & pause

Post by Qon »

R3CONN3R wrote:Hey!
I tried adding handy hands to an existing save and I'm getting this error

Code: Select all

Error while running event on_tick (ID 0)
__HandyHands__/control.lua:53: attempt to index local 'data' (a nil value)
Im guessing

Code: Select all

if data == nil then
        data = init_player(event.player_index)
    end
never gets called
Thanks R3CONN3R! Fixed in 1.2.2! You were right! The lua-api documentation was a bit fuzzy on the details. I thought on_player_joined event was fired whenever a player logs in to the word, but apparently it's only the first time they join that the even fires.
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
R3CONN3R
Burner Inserter
Burner Inserter
Posts: 7
Joined: Thu Jul 30, 2015 1:44 am
Contact:

Re: [MOD 0.13] HandyHands - Autocrafting - v1.2.1 ammo & pause

Post by R3CONN3R »

Qon wrote: Thanks R3CONN3R! Fixed in 1.2.2! You were right! The lua-api documentation was a bit fuzzy on the details. I thought on_player_joined event was fired whenever a player logs in to the word, but apparently it's only the first time they join that the even fires.
Works fine now!
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [MOD 0.13] HandyHands - Autocrafting - v1.2.1 ammo & pause

Post by Qon »

R3CONN3R wrote:Works fine now!
Great, and thanks for qonfirming.
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [MOD 0.13] HandyHands - Autocrafting - v1.2.2 ammo & pause

Post by Qon »

A comment thread with some suggestions.
Mentioned by others:
  • Do you think something could be done about the crafting sound? I like the idea of the mods, but hearing it craft EVERYTHING 1 by 1 drove me insane within 5 minutes of installing it.
  • well i actually i want an interval between 0 and 0.2
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Omez
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Aug 21, 2016 11:21 am
Contact:

Re: [MOD 0.13] HandyHands - Autocrafting - v1.2.2 ammo & pause

Post by Omez »

126.825 Error MainLoop.cpp:698: Exception at tick 5650820: Error while running event on_tick (ID 0)
No crafting queue.
stack traceback:
__HandyHands__/control.lua:64: in function <__HandyHands__/control.lua:46>
126.825 Error MultiplayerManager.cpp:129: MultiplayerManager failed: "Error while running event on_tick (ID 0)
No crafting queue.
stack traceback:
__HandyHands__/control.lua:64: in function <__HandyHands__/control.lua:46>"
126.825 Info MultiplayerManager.cpp:1000: networkTick(6739) mapTick(5650820) changing state from(InGame) to(Failed)
^C 137.548 Received SIGINT, shutting down


Running on a headless linux server, just died on the server.
Even tried with no inventory, same happens. Running 1.2.3 of handyhands
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [MOD 0.13] HandyHands - Autocrafting - v1.2.2 ammo & pause

Post by Qon »

Omez wrote:

Code: Select all

126.825 Error MainLoop.cpp:698: Exception at tick 5650820: Error while running event on_tick (ID 0)
No crafting queue.
stack traceback:
        __HandyHands__/control.lua:64: in function <__HandyHands__/control.lua:46>
 126.825 Error MultiplayerManager.cpp:129: MultiplayerManager failed: "Error while running event on_tick (ID 0)
No crafting queue.
stack traceback:
        __HandyHands__/control.lua:64: in function <__HandyHands__/control.lua:46>"
 126.825 Info MultiplayerManager.cpp:1000: networkTick(6739) mapTick(5650820) changing state from(InGame) to(Failed)
^C 137.548 Received SIGINT, shutting down

Running on a headless linux server, just died on the server.
Even tried with no inventory, same happens. Running 1.2.3 of handyhands
That looks like a Factorio bug. It references the .cpp files. I know the older Factorio 0.13.x versions had a crash when handcraftning on GNU/Linux. I think you are running an old Factorio version. Update to 0.13.17 and that should solve it. Please verify.
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Omez
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Aug 21, 2016 11:21 am
Contact:

Re: [MOD 0.13] HandyHands - Autocrafting - v1.2.2 ammo & pause

Post by Omez »

Qon wrote:That looks like a Factorio bug. It references the .cpp files. I know the older Factorio 0.13.x versions had a crash when handcraftning on GNU/Linux. I think you are running an old Factorio version. Update to 0.13.17 and that should solve it. Please verify.

running 0.13.17 atm.
Got a few other mods installed, but I never saw this error occur before I updated handy hands from 1.2.0 or something to 1.2.2
I'll let you know if any more additional information comes up.
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [MOD 0.13] HandyHands - Autocrafting - v1.2.2 ammo & pause

Post by Qon »

Omez wrote: running 0.13.17 atm.
Got a few other mods installed, but I never saw this error occur before I updated handy hands from 1.2.0 or something to 1.2.2
So you got the error while running Factorio 0.13.17? Or did you update to 0.13.17 now and it works without errors now?
What did you do that caused the crash in the first place?
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Omez
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Aug 21, 2016 11:21 am
Contact:

Re: [MOD 0.13] HandyHands - Autocrafting - v1.2.2 ammo & pause

Post by Omez »

Qon wrote:
Omez wrote: running 0.13.17 atm.
Got a few other mods installed, but I never saw this error occur before I updated handy hands from 1.2.0 or something to 1.2.2
So you got the error while running Factorio 0.13.17? Or did you update to 0.13.17 now and it works without errors now?
What did you do that caused the crash in the first place?

I got the error running Factorio 0.13.17.
The error occurred when I died ingame (to alien mobs)
Tested emptying my inventory and toolbar and unbinding any items in toolbar slots.
Same fault, server crashes.

I haven't tested newest handyhands with older factorio, but we were running 0.13.15 with handyhands 1.2.0 or something, and it worked fine.
iceman_1212
Filter Inserter
Filter Inserter
Posts: 256
Joined: Wed Aug 17, 2016 9:49 am
Contact:

Re: [MOD 0.13] HandyHands - Autocrafting - v1.2.2 ammo & pause

Post by iceman_1212 »

this mod feels SO overpowered in the early and mid game, I LOVE IT - it's like having logistic requests all game long :D

one small suggestion:
- would it be possible to have enable/disable/delete settings be on its own hotkey? a few times, i accidentally deleted my settings because i tapped the "lower stack size" hotkey one too many times.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.13] HandyHands - Autocrafting - v1.2.2 ammo & pause

Post by Nexela »

iceman_1212 wrote:this mod feels SO overpowered in the early and mid game, I LOVE IT - it's like having logistic requests all game long :D

one small suggestion:
- would it be possible to have enable/disable/delete settings be on its own hotkey? a few times, i accidentally deleted my settings because i tapped the "lower stack size" hotkey one too many times.

I agree! putting toggle enable on Shift-i and delete on Shift-K might be the best way to go.
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [MOD 0.13] HandyHands - Autocrafting - v1.2.2 ammo & pause

Post by Qon »

iceman_1212 wrote:this mod feels SO overpowered in the early and mid game, I LOVE IT - it's like having logistic requests all game long :D
Glad you are enjoying it :}
I think it's nice that it doesn't give you any OP items that make your factory itself non-vanilla. It just helps you with something you could do by yourself. It's not really un unfair advantage, just some unpleasantries removed. And it still feels OP 8-) .
iceman_1212 wrote: one small suggestion:
- would it be possible to have enable/disable/delete settings be on its own hotkey? a few times, i accidentally deleted my settings because i tapped the "lower stack size" hotkey one too many times.
Nexela wrote:I agree! putting toggle enable on Shift-i and delete on Shift-K might be the best way to go.
Did you know that the mod pauses when you cancel a craft that was started by HandyHands? (If the canceling action happens before you add something to the queue manually, so that you can reprioritize without accidental pausing)
Introducing more hotkeys will just be a hassle to set up when it's not needed. I could make it so you need two K presses, one to qonfirm that you want to remove all settings. Would that solve your problem?
Enable/disable while you are not currently autocrafting, is that really needed?

This is why I didn't want to introduce too many autocraft limits, I predicted earlier that people would be annoyed by that and ask for more hass... hotkeys q:
Edit:
Qon wrote:I don't want something with too much fine control so that people get frustrated clicking through the values. Then people will demand more hotkeys and a GUI. And then people will complain that there's too many hotkeys to keep track of or too many GUI buttons on their screen. It should be simple and easy so that you don't have to think about it and so that you don't need more hotkeys and settings. Just filter it and HandyHands got your back and will make sure you have enough, don't even think about it any more.
The pause feature is supposed to be intelligent and seamless. When you don't want autocrafting you pause it just like you stop normal crafting. It's not another button to keep track of to pause HandyHands. Imagine if HandyHands had a pause button but you can't remember which one it is. And you try to stop the crafting by clicking the crafting queue, but HandyHands just laughs at the panic in your face and keeps adding items back to your crafting queue immediatly when they are canceled. Well, slightly less dramatic and slightly more cursing and disabling I guess ;)
Future feature will be to check for inventory space before adding things to inventory queue I guess. You shouldn't even have to pause by canceling your crafting queue when your inventory is full...

If I ever add another hotkey it will probably be to bring up a GUI that does everything else. But I want even the I and K buttons to not be that necessary so I will continue to try to make it just work without more keys as long as possible.
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [MOD 0.13] HandyHands - Autocrafting - v1.2.2 ammo & pause

Post by Qon »

Omez wrote:I got the error running Factorio 0.13.17.
The error occurred when I died ingame (to alien mobs)
Tested emptying my inventory and toolbar and unbinding any items in toolbar slots.
Same fault, server crashes.
I've tried emptying all my inventories and unfiltering all slots and being killed by biters, all at once. No crash. I'm playing locally on windows 7. The code doesn't make any references to any local player explicitly though, and OS should not affect mod code at all. If the whole server application crashes then that's not the mods fault. All I'm doing at line 64 is checking crafting queue size anyways which should not be a problem for any player.

You should report to the Factorio devs with full crash log. When you do, link the bug report thread here so I can read it also!
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.13] HandyHands - Autocrafting - v1.2.2 ammo & pause

Post by Nexela »

Using mods that add extra toolbelts is just too much for checking every 5 ticks. This will get even more noticeable if your megabase already lowers ups
at default settings I get a 10ups drop
Handyhandsohno.png
Handyhandsohno.png (82.55 KiB) Viewed 11170 times
If I change it to every 30 ticks I get about a 2ups drop
littlebetter.png
littlebetter.png (106.98 KiB) Viewed 11170 times
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [MOD 0.13] HandyHands - Autocrafting - v1.2.2 ammo & pause

Post by Qon »

Nexela wrote:Using mods that add extra toolbelts is just too much for checking every 5 ticks. This will get even more noticeable if your megabase already lowers ups
at default settings I get a 10ups drop
Last time I checked it was at about 0.1. A few extra toolbars shouldn't make it 50 times slower. Maybe some new feature is causing the slowdown.
I will try to do some proper optimisations to fix it for you.

Is this while auto crafting, or is your crafting queue empty?
How many players are connected at that moment?
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Post Reply

Return to “Mods”