Page 1 of 2

[MOD 0.13] HotCraft - direct handcraft with hotkey

Posted: Wed Aug 03, 2016 9:03 am
by binbinhfr
Infos
  • Type: Mod
  • Name: HotCraft
  • Description: directly handcraft items from your inventory or toolbelt by hotkey, without even browsing the recipes list.
  • Tested-With-Factorio-Version: 0.13.10
  • Multiplayer compatible: tested on a headless server...
  • Locale: all
  • Tags: Crafting, Handcraft, Hotkey
  • License: You are free to use and distribute this mod and also to modify it for personal use, but not to release a modified version without permission (unless visibly not maintained anymore).
  • Portal download : https://mods.factorio.com/mods/binbinhfr/HotCraft
logo.jpg
logo.jpg (26.86 KiB) Viewed 12159 times
Description
Download
For Factorio 0.13.X :
Please use the portal for downloads (see link above or use ingame mod install/update).

Re: [MOD 0.13+] HotCraft - direct handcraft with hotkey

Posted: Wed Aug 03, 2016 12:14 pm
by Wildejackson
How you do it Binbinhfr so consistently...
Fantastic work, very handy for the early game; helped shave off 10 minutes getting to red science automation in my Bob's/Angels mod game!
If I may suggest a feature, (not even sure if its available within the API) perhaps you could take a page out of ARK and make it so that if filtered slot is in your hotbar, simply pressing the button will craft the recipe.
Anyway great stuff, keep amazing us, as you always do.

Re: [MOD 0.13+] HotCraft - direct handcraft with hotkey

Posted: Wed Aug 03, 2016 1:08 pm
by Qon
I had an idea for a handcrafting mod. Something even better, imo. What if the mod automatically started handcrafting whatever you are missing if your hand crafting queue is empty? So a bit like logistics slots for early game. Either use the logistics slots and give them to the player early, or, if you have items in your toolbar filtered but the stack isn't full, autohandcraft those items until your stacks are full. Then you would always have the necessary items when you need them and handcrafting would start while you are placing items down. Actually I fear this would be soo good that people will never automate production of any entity :o

It wouldn't interfere with normal handcrafting because it only starts autohandcrafting 1 item at a time when the crafting queue is empty. I don't think it matters much which item it chooses to craft but you could prioritise item at hotkey 1 (leftmost item in toolbar) and do item 2 (and so on in normal text order) only when item 1 stack is full. Or whatever has the least % of a full stack might be better. And extra priority on the thing you are holdng in your hand so you don't run out while placing.

What do you think? Good addition to HotCraft or as a separate mod?

Re: [MOD 0.13+] HotCraft - direct handcraft with hotkey

Posted: Wed Aug 03, 2016 1:25 pm
by Tone
Thanks man :D :D

Re: [MOD 0.13+] HotCraft - direct handcraft with hotkey

Posted: Wed Aug 03, 2016 3:06 pm
by binbinhfr
Tone wrote:Thanks man :D :D
I knew you'll like it ! ;-)
Wildejackson wrote:If I may suggest a feature, (not even sure if its available within the API) perhaps you could take a page out of ARK and make it so that if filtered slot is in your hotbar, simply pressing the button will craft the recipe.
I don't know what you mean by "take a page out of ARK". What is an ARK ?
But I can add a hotkey so that any filtered stack in you hotbar get refilled by 5 items for example ? Is it what you meant ?

@Qon
Your idea sounds great (especially the 1 per 1 craft to avoid blocking the queue), but IMHO I don't think it really works with early stage of the game. Usually in this part of the game, I am quite short on items, and personnaly I don't want to auto handcraft items with these limited supplies. I want to chose manually what I want to craft. So I will keep my mod like this. ;-) But you should try to develop this AutoHandcraft mod, it's an easy one to implement.

Re: [MOD 0.13+] HotCraft - direct handcraft with hotkey

Posted: Wed Aug 03, 2016 3:14 pm
by Tone
binbinhfr wrote: I don't know what you mean by "take a page out of ARK". What is an ARK ?
But I can add a hotkey so that any filtered stack in you hotbar get refilled by 5 items for example ? Is it what you meant ?
Ark as in Ark: Survival Evolved the game in which is where I got the idea from originally. Also what he means is that say you have for example yellow belts on your hotbar and they are "filtered" as in the ghost item is there, you would hold "alt" for example and just click the ghost item on your hotbar in this example yellow belts and it will craft 1 with left click and 5 with right click, if this is even possible ofc.

Re: [MOD 0.13+] HotCraft - direct handcraft with hotkey

Posted: Wed Aug 03, 2016 3:41 pm
by binbinhfr
Tone wrote:Ark as in Ark: Survival Evolved the game in which is where I got the idea from in the first place. Also what he means is that say you have for example yellow belts on your hotbar and they are "filtered" as in the ghost item is there, you would hold "alt" for example and just click the ghost item on your hotbar in this example yellow belts and it will craft 1 with left click and 5 with right click, if this is even possible ofc.
OK thx for the info, i did not know this game.

For the rest, alas the API is great but... sometimes limited. As far as I know, it is not possible to detect a hold key pressed or a modifier pressed like ALT. For keyboard matters, you can only fire an event on a classic once-pressed-key.

I also tried to detect the "ghost" of an empty stack in the quickbar, but I cannot "hold" it (I can detect a held item). It does not either appear in player.selected, as classical entity when they are "hovered" . So I'm afraid I cannot read what the player is pointing when he hovers or click on such a ghost...

Re: [MOD 0.13+] HotCraft - direct handcraft with hotkey

Posted: Wed Aug 03, 2016 5:02 pm
by Tone
binbinhfr wrote: OK thx for the info, i did not know this game.

For the rest, alas the API is great but... sometimes limited. As far as I know, it is not possible to detect a hold key pressed or a modifier pressed like ALT. For keyboard matters, you can only fire an event on a classic once-pressed-key.

I also tried to detect the "ghost" of an empty stack in the quickbar, but I cannot "hold" it (I can detect a held item). It does not either appear in player.selected, as classical entity when they are "hovered" . So I'm afraid I cannot read what the player is pointing when he hovers or click on such a ghost...
I was afraid this would be the case, hopefully the devs can implement this into API at some point. Would be very useful for some other mods as well, specifically Improve move mod where instead of toggling the modifier key to walk you can just hold down shift to walk/crawl, how minecraft does it. However I know the API does not allow this but what about the copy/paste feature in vanilla factorio? Surely you have to hold shift + right/left click.

Re: [MOD 0.13+] HotCraft - direct handcraft with hotkey

Posted: Wed Aug 03, 2016 8:41 pm
by binbinhfr
where instead of toggling the modifier key to walk you can just hold down shift to walk/crawl
You can use my ProgressiveRunningmod if you have speed problems.
what about the copy/paste feature in vanilla factorio? Surely you have to hold shift + right/left click
Yes, but it's a builtin feature we do not access thru API.
The only way to access this with API is by a area-selection-tool, like I did in my CopySettingsTool. But it won't work on the quickbar. I allows selecting entities on the ground.

But at every new version, the API is richer and allows us the concretisation of new ideas, so maybe one day... :-)

For the moment, I look at the old mod GalacticTrade because I had this idea of BlackMarket, which is finally basically the same, now that I discovered GT. I just want the selling to be fully automated too. Because Factorio is about automation, no ? :-) But this mod is outdated and I do not succeed making it work completely. I will probably rewrite one because I like this idea of automatically selling products and buying some in return. I try to find something fun to add. I'm still not satisfied.

Re: [MOD 0.13+] HotCraft - direct handcraft with hotkey

Posted: Wed Aug 03, 2016 11:45 pm
by Tone
Ok thanks for the clarification. I must say you are quite the mod coding beast. Having a look at all your mods, I am already using quite a few of them in my single player world. Props to you sir!

Slightly off topic:
Maybe you can help me here. I have tried updating Planning Tool Mod which I believe is similar to your copy/paste mod in which both mods allow you to select an area. I have little to no coding experience however I did get it to load and the selection tool actually pops up but gui does not pop up and the tool does does nothing. I fixed the info.json to be compatible with 0.13, I removed "require defines" and changed game.player to game.players. Not sure what else I'm missing here or even doing for that matter :? I am also trying to add some sort of measurement tool to the selected area like this when drawing out a rectangle. You said you would like a challenge but for you this should be no challenge. ;)

Also an automated trading mod would be neat. Good luck with that!

Re: [MOD 0.13+] HotCraft - direct handcraft with hotkey

Posted: Thu Aug 04, 2016 9:04 am
by binbinhfr
Thx for the congratulations.
I'll have a look at this other tool during my vacations, to sse if it can be adapted to 0.13, but sometimes it is not always possible.

Re: [MOD 0.13+] HotCraft - direct handcraft with hotkey

Posted: Thu Aug 04, 2016 11:13 pm
by binbinhfr
About planning tool, there are a lot of problems to solve, because the API changed a lot since it was written.
problems as i rapidly saw them:
-get_surface into surfaces.nauvis
- player into players[1]
- the mod is not MP at all and does not use the proper events.
- bad use of on_load
- I doubt the mod can init on an existing map, need to use on_config, on_player_created, etc...

it needs a complete rewrite.

Re: [MOD 0.13+] HotCraft - direct handcraft with hotkey

Posted: Thu Aug 04, 2016 11:21 pm
by Tone
binbinhfr wrote:About planning tool, there are a lot of problems to solve, because the API changed a lot since it was written.
problems as i rapidly saw them:
-get_surface into surfaces.nauvis
- player into players[1]
- the mod is not MP at all and does not use the proper events.
- bad use of on_load
- I doubt the mod can init on an existing map, need to use on_config, on_player_created, etc...

it needs a complete rewrite.
No worries then. I thought it could be a simple update with just changing a few things around since I actually got it to launch without crashing. I appreciate the time you took to look at it.

Re: [MOD 0.13+] HotCraft - direct handcraft with hotkey

Posted: Mon Aug 08, 2016 1:12 pm
by Qon
binbinhfr wrote: @Qon
Your idea sounds great (especially the 1 per 1 craft to avoid blocking the queue), but IMHO I don't think it really works with early stage of the game. Usually in this part of the game, I am quite short on items, and personnaly I don't want to auto handcraft items with these limited supplies. I want to chose manually what I want to craft.
HandyHands v1.1.0 now allows you to change autocraft stack amount (default and for individual items) with hotkeys. [0, .5, 1, 2, 3, 4] stacks are possible but I might change the 0.5 to instead have 0.2 and 0.8 or similar. Would this help in the very early game? 0.2 stacks would be 10 items for all the stack size 50 items. You can respond in my HandyHands thread so that we don't go off-topic and pollute this thread with to much discussion of my mod.
binbinhfr wrote:So I will keep my mod like this. ;-) But you should try to develop this AutoHandcraft mod, it's an easy one to implement.
Was fun too ;]

Re: [MOD 0.13] HotCraft - direct handcraft with hotkey

Posted: Sat Aug 20, 2016 7:52 pm
by iceman_1212
So I had a look through my mods in detail yesterday and it turns out that the vast majority are from a handful of authors, including you :D (in particular, i am a huge fan of the drones mod)

Any chance it would be possible to play a different sound cue when we do have enough ingredients vs. when we don't have the necessary ingredients? Would be a nice quality of life feature, if not too much trouble to implement.

Re: [MOD 0.13] HotCraft - direct handcraft with hotkey

Posted: Sat Aug 20, 2016 8:56 pm
by binbinhfr
iceman_1212 wrote:So I had a look through my mods in detail yesterday and it turns out that the vast majority are from a handful of authors, including you :D (in particular, i am a huge fan of the drones mod)

Any chance it would be possible to play a different sound cue when we do have enough ingredients vs. when we don't have the necessary ingredients? Would be a nice quality of life feature, if not too much trouble to implement.
Thx for the appreciation ! :-)

One bad news, one good news...

1 - I cannot change the sound, because it is the default sound emited by factorio when it prints something in the console. (the "no ingredients" message is not from me, but from factorio it self.

2 - but I can test how many items you can craft, and craft only the possible number if you ask too much. So there will be no more message, and no more sound. Just be aware that if nothing happens, it means that you do not have the possibility to craft even one single item. ;)

please update ingame

Re: [MOD 0.13] HotCraft - direct handcraft with hotkey

Posted: Sun Aug 21, 2016 3:29 am
by iceman_1212
just had a chance to update and test - looks great :). Ty for the changes. Just discovered your electric void/producer mod for testing electrical network capacity - dloading as we speak. Had multiple blackouts in my last map :P

Re: [MOD 0.13] HotCraft - direct handcraft with hotkey

Posted: Tue Feb 13, 2018 1:26 pm
by AsherMaximum
I've modified this for my use to also craft an item you selected with the pipette tool if you don't have any of that item in your inventory. I can send you the code changes if you'd be interested in adding it.

Re: [MOD 0.13] HotCraft - direct handcraft with hotkey

Posted: Tue Feb 13, 2018 1:45 pm
by binbinhfr
AsherMaximum wrote:I've modified this for my use to also craft an item you selected with the pipette tool if you don't have any of that item in your inventory. I can send you the code changes if you'd be interested in adding it.
Yes I could integrate this change. Please send me the code so that I can test it.

Re: [MOD 0.13] HotCraft - direct handcraft with hotkey

Posted: Fri Feb 23, 2018 10:05 am
by binbinhfr
new 1.0.3 version integrating the changes made by AsherMaximum. Thx to him.