[Mod] Fast Craft [fast_craft]

Post Reply
User avatar
Skamiz Kazzarch
Member
Posts: 618
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

[Mod] Fast Craft [fast_craft]

by Skamiz Kazzarch » Post

Yet another mod adding an alternative crafting system.
fc_mtg.png
fc_mtg.png (132.73 KiB) Viewed 5548 times
Spoiler
fc_mineclone.png
fc_mineclone.png (84.04 KiB) Viewed 5548 times
fc_cicrev.png
fc_cicrev.png (65.59 KiB) Viewed 5548 times
Download: https://github.com/Skamiz/fast_craft/ar ... master.zip
Source: https://github.com/Skamiz/fast_craft
Depends: nothing
Optional Depends: sfinv, mcl_formspec
License: MIT

Why?
After many years of the default crafting system, I have grown somewhat tired of it and wanted to make my own system for my game. And while I was at it I added support for MTG and Mineclone.

What does it do?
Adds yet another way to craft. This one is loosely inspired by Terraria. Instead of having to arrange items in the crafting grid, you just have to select a recipe from a list and then choose how many times to craft it.

Originally this was meant just as a stand alone crafting system. The ability to craft default recipes is just a bonus.
What does that mean? Fast craft can do a few things extra.
First thing, since it doesn't work with the crafting grid, it isn't limited to nine input items. If you want your tools to each cost 15 ingots, a tool handle, string, and glue, fast craft can do that. Also you recipes aren't constrained by being arranged into patterns, which have to try to look sensible to the player.
And since recipes aren't defined by their patterns there is no issue with recipe collisions. You can have as many recipes as you want for the same set of inputs.
It also supports multiple outputs beside the main one. Useful if you want recipes which take things apart into multiple components.
And lastly, it supports custom crafting conditions. Want a ritual dagger that can only be crafted under the full moon on midnight? Can be done.

Compatibility
By default it tries to import recipes from the default crafting system and if possible simplify them.
Example: '3 full nodes -> 6 slabs' gets converted to '1 full node -> 2 slabs'.
Both can be turned off in the mod configuration.

Adds a 'sfinv' tab if possible making it compatible with MTG and most of it's derivatives.
If Mineclone is detected a button is added to the inventory and a condition is added to all 3*3 recipes to be only craftable when standing within 3 nodes of a workbench.
If neither is the case it just overrides the player inventory formspec.

Caveats
The biggest one is, that when importing recipes, I have to use 'minetest.get_craft_result(recipe)' to find out if there are any replacements. And that function is slow. Barely noticeable on a MTG world with no mods. But on a modded game, with 3250 recipes it adds 40 seconds to the time it takes to start a world. There are alternatives which don't slow world start up, but they aren't necessarily good ones. See this issue: https://github.com/minetest/minetest/issues/4901

Additionally there are a few edge cases with groups and replacements in recipes which could result into the crafting process taking/giving more items then it should.
And by edge cases I mean I only ever saw one recipe that could trigger one of these cases, and that one was implemented myself in code which was never released. So hopefully that shouldn't be a problem.

And lastly, there is no way to detect when the player opens their inventory. So sometimes the formspec is out of date and has to be manually updated by pushing any button.

Similar stuff
Easy crafting table by Quertymine3
Extensible gridless craft system by FaceDeer
Unlockable Crafting by Rubenwardy
Add all recipes to rw's crafting by Texmex
Artisanry by BobbyBonsaimind

User avatar
duckgo
Member
Posts: 205
Joined: Sun Sep 20, 2020 08:01
In-game: duckgo
Contact:

Re: [Mod] Fast Craft [fast_craft]

by duckgo » Post

bro, this is very good, I really liked this mod, I don't play without it anymore... 👍👍👍

User avatar
Blockhead
Member
Posts: 1674
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: [Mod] Fast Craft [fast_craft]

by Blockhead » Post

Repixture also has a similar crafting method built into the game. I think the 'killer feature' that would drive adoption of alternative crafting methods regardless of game would be to support as many inventory mods as possible e.g. Unified Inventory, i3, Mineclone's inventory and so on.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
duckgo
Member
Posts: 205
Joined: Sun Sep 20, 2020 08:01
In-game: duckgo
Contact:

Re: [Mod] Fast Craft [fast_craft]

by duckgo » Post

Hi, first thank you very much for the mod, I keep following your work :)

:)
Last edited by duckgo on Mon Sep 12, 2022 10:07, edited 1 time in total.

User avatar
Blockhead
Member
Posts: 1674
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: [Mod] Fast Craft [fast_craft]

by Blockhead » Post

Cool idea, but is there something like the pipeworks autocrafter that supports the recipe format?
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
Skamiz Kazzarch
Member
Posts: 618
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Fast Craft [fast_craft]

by Skamiz Kazzarch » Post

I am not sure what exactly you mean Blockhead.
If you mean an auto-crafter that can craft recipes which have been registered directly for this mod and thus aren't in the default system the answer is no.
I suppose it could be done, but recipes aren't specified by their input or output, but by their index, so you would need a way for the player to do that. Additionally these recipes allow for custom crafting conditions like the player having only 1 heart or facing towards the south. No clue how that would be translated to a node.

Though I don't think anyone besides me even registered recipes specifically for this crafting system, so there isn't exactly a great need for an auto-crafter in the first place.

Mostly I feel like I am misunderstanding the question. Please elaborate?

User avatar
Skamiz Kazzarch
Member
Posts: 618
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Fast Craft [fast_craft]

by Skamiz Kazzarch » Post

duckgo wrote:
Sun Sep 11, 2022 21:17
~snip~
Added awards compatibility.
Turns out the awards mod is written in such a good way that I only had to add 3 lines of code to my mod for compatibility.
Re-download it. Try it out. And let me know if anything still doesn't work.

User avatar
duckgo
Member
Posts: 205
Joined: Sun Sep 20, 2020 08:01
In-game: duckgo
Contact:

Re: [Mod] Fast Craft [fast_craft]

by duckgo » Post

Skamiz Kazzarch wrote:
Mon Sep 12, 2022 09:23
duckgo wrote:
Sun Sep 11, 2022 21:17
~snip~
Added awards compatibility.
Turns out the awards mod is written in such a good way that I only had to add 3 lines of code to my mod for compatibility.
Re-download it. Try it out. And let me know if anything still doesn't work.
Thanks, I will try it right now 🤩🤩🤩

User avatar
duckgo
Member
Posts: 205
Joined: Sun Sep 20, 2020 08:01
In-game: duckgo
Contact:

Re: [Mod] Fast Craft [fast_craft]

by duckgo » Post

I took the test, and it worked... Once again, thank you very much, I love your mod :)

User avatar
LRV
Helper
Posts: 378
Joined: Mon Dec 19, 2016 17:29
GitHub: Mooncarguy
In-game: Mooncarman Mooncarguy

Re: [Mod] Fast Craft [fast_craft]

by LRV » Post

Skamiz Kazzarch wrote:
Sun May 07, 2023 09:09
Mods I would like to have moved:
[...]
viewtopic.php?f=9&t=28125
Topic follows the requirements and was therefore moved to 'Mod Releases'.
This is a cool signature. :)

User avatar
duckgo
Member
Posts: 205
Joined: Sun Sep 20, 2020 08:01
In-game: duckgo
Contact:

Re: [Mod] Fast Craft [fast_craft]

by duckgo » Post

Hello Skamiz Kazzarch,
there is 1 bug in fastcraft, when you use the command "fast_craft", the game crashes, and the description is wrong "fact_craft, I think they are simple things to fix ..thanks 😁👍
Spoiler

Code: Select all

AsyncErr: Lua: Runtime error from mod 'fast_craft' in callback ScriptApiServer::on_chat_message(): ...netest\games\survivetest\mods\PLAYER\fast_craft\init.lua:554: attempt to index a nil value
stack traceback:
	...netest\games\survivetest\mods\PLAYER\fast_craft\init.lua:554: in function 'func'
	...les\Minetest\bin\..\builtin\profiler\instrumentation.lua:108: in function 'func'
	C:\Program Files\Minetest\bin\..\builtin\game\chat.lua:79: in function <C:\Program Files\Minetest\bin\..\builtin\game\chat.lua:52>
	C:\Program Files\Minetest\bin\..\builtin\game\register.lua:446: in function <C:\Program Files\Minetest\bin\..\builtin\game\register.lua:432>



User avatar
Skamiz Kazzarch
Member
Posts: 618
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Fast Craft [fast_craft]

by Skamiz Kazzarch » Post

Ups. Looks like I left in some debug code from adding Mineclone compatibility. Fixed now.

User avatar
duckgo
Member
Posts: 205
Joined: Sun Sep 20, 2020 08:01
In-game: duckgo
Contact:

Re: [Mod] Fast Craft [fast_craft]

by duckgo » Post

Skamiz Kazzarch wrote:
Tue Jun 27, 2023 16:53
Ups. Looks like I left in some debug code from adding Mineclone compatibility. Fixed now.
😁👍

PiTTi
Member
Posts: 29
Joined: Tue Aug 29, 2017 00:21
In-game: PiTTi
Location: Narnia - (DE) MCL2-Server

Re: [Mod] Fast Craft [fast_craft]

by PiTTi » Post

hello,
in mcl2 0.85 the fast_craft button has disappeared. Is there a way to get him back?
fast_craft in mcl 0.84.png
fast_craft in mcl 0.84.png (21.61 KiB) Viewed 2585 times
fast craft knopf in mcl2 0.85.png
fast craft knopf in mcl2 0.85.png (23.56 KiB) Viewed 2585 times

User avatar
Skamiz Kazzarch
Member
Posts: 618
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Fast Craft [fast_craft]

by Skamiz Kazzarch » Post

Looks like the Fast Craft button is now hidden behind the Help button. Very simple to fix.
Give me a day to iron out some other changes I have made to the mod and I will upload new version.

PiTTi
Member
Posts: 29
Joined: Tue Aug 29, 2017 00:21
In-game: PiTTi
Location: Narnia - (DE) MCL2-Server

Re: [Mod] Fast Craft [fast_craft]

by PiTTi » Post

Take your time, we*ll be patient. Our players love your mod :-)

User avatar
Skamiz Kazzarch
Member
Posts: 618
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Fast Craft [fast_craft]

by Skamiz Kazzarch » Post

Update:
- mostly code refactoring to make maintenance easier
- MCL inventory now shows all 4 * 9 slots, instead of only 4 * 8
- native "Survivetest" support (formspec was adjusted to look closer to other sfinv tabs)
- theoretical "Parity of the Minor Bearing" game support, it works, but depends on an unreleased mod to actually look good
- removed "Craft amounts" setting
- "/fast_craft" chat command now shows a generic formspec, instead of a game specific one
Screenshot from 2023-12-11 09-02-08.png
Screenshot from 2023-12-11 09-02-08.png (54.26 KiB) Viewed 2521 times
Turns out, the button wasn't just hidden behind another. Mineclone finally manged to move to a newer formspec version and uses new functions to do it, so I had to make a new hack to insert my button.
PiTTi wrote:
Sun Dec 10, 2023 21:10
Take your time, we*ll be patient. Our players love your mod :-)
Might I ask which server? It's always satisfying to encounter my mods out in the wild, but usually the only feedback that anyone is even using it, is when someone comes here to report a bug.

PiTTi
Member
Posts: 29
Joined: Tue Aug 29, 2017 00:21
In-game: PiTTi
Location: Narnia - (DE) MCL2-Server

Re: [Mod] Fast Craft [fast_craft]

by PiTTi » Post

First of all, thank you very much for the super fast update :-)
I just installed it and tested it, everything works again. The fact that you can now use the button without standing directly at a workbench is also great!
fast_craft.png
fast_craft.png (136.93 KiB) Viewed 2505 times
Our server is called Narnia, a small whitelisted server. you are whitelisted, you can see your mod in working. It would be our pleasure :)

User avatar
Skamiz Kazzarch
Member
Posts: 618
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Fast Craft [fast_craft]

by Skamiz Kazzarch » Post

Update:
- full support of the MCL stonecutter recipes
- api change: recipes now can have multiple conditions, if any one is fulfilled the recipe is available

Post Reply

Who is online

Users browsing this forum: Google [Bot], Kazooo and 18 guests