[MOD 0.13] HotCraft - direct handcraft with hotkey

Topics and discussion about specific mods
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

[MOD 0.13] HotCraft - direct handcraft with hotkey

Post 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 10669 times
Description
Download
For Factorio 0.13.X :
Please use the portal for downloads (see link above or use ingame mod install/update).
Last edited by binbinhfr on Fri Aug 05, 2016 5:33 pm, edited 1 time in total.
My mods on the Factorio Mod Portal :geek:

Wildejackson
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Sun Jul 31, 2016 2:40 am
Contact:

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

Post 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.

Qon
Smart Inserter
Smart Inserter
Posts: 2091
Joined: Thu Mar 17, 2016 6:27 am
Contact:

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

Post 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?

Tone
Inserter
Inserter
Posts: 24
Joined: Wed Jul 13, 2016 12:43 pm
Contact:

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

Post by Tone »

Thanks man :D :D

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

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

Post 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.
My mods on the Factorio Mod Portal :geek:

Tone
Inserter
Inserter
Posts: 24
Joined: Wed Jul 13, 2016 12:43 pm
Contact:

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

Post 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.
Last edited by Tone on Wed Aug 03, 2016 3:41 pm, edited 1 time in total.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

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

Post 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...
My mods on the Factorio Mod Portal :geek:

Tone
Inserter
Inserter
Posts: 24
Joined: Wed Jul 13, 2016 12:43 pm
Contact:

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

Post 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.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

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

Post 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.
My mods on the Factorio Mod Portal :geek:

Tone
Inserter
Inserter
Posts: 24
Joined: Wed Jul 13, 2016 12:43 pm
Contact:

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

Post 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!

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

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

Post 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.
My mods on the Factorio Mod Portal :geek:

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

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

Post 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.
My mods on the Factorio Mod Portal :geek:

Tone
Inserter
Inserter
Posts: 24
Joined: Wed Jul 13, 2016 12:43 pm
Contact:

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

Post 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.

Qon
Smart Inserter
Smart Inserter
Posts: 2091
Joined: Thu Mar 17, 2016 6:27 am
Contact:

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

Post 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 ;]

iceman_1212
Filter Inserter
Filter Inserter
Posts: 256
Joined: Wed Aug 17, 2016 9:49 am
Contact:

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

Post 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.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

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

Post 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
My mods on the Factorio Mod Portal :geek:

iceman_1212
Filter Inserter
Filter Inserter
Posts: 256
Joined: Wed Aug 17, 2016 9:49 am
Contact:

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

Post 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

AsherMaximum
Burner Inserter
Burner Inserter
Posts: 17
Joined: Tue Mar 08, 2016 12:44 am
Contact:

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

Post 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.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

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

Post 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.
My mods on the Factorio Mod Portal :geek:

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

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

Post by binbinhfr »

new 1.0.3 version integrating the changes made by AsherMaximum. Thx to him.
My mods on the Factorio Mod Portal :geek:

Post Reply

Return to “Mods”