This module is open source, so it's distributed freely. If you find it useful then I ask not for your wealth, but simply to spare your time to consider the world we share by watching Earthlings, a multi-award winning film available to watch online for free. A must-see for anyone who wishes to make the world a better place.
Crafting
You can create a craft guide using the recipe in the image above, or give yourself one using:
I had to think about it for a while (without screenshot), Now I read it again and saw the screenshot. I now think this is a very good help for all kind of players.
Great idea! With minecraft there is no way to read recipes in-game, but with this mod in Minetest we can view recipes in-game, making Minetest better than Minecraft a little bit more
"All we need it the right major crisis and the nations will accept the new world order."
Looks like someone found my code to be useful. It looks to be a little modified but I can definitely tell some of my code is in there. Not accusing you of anything. I was actually wanting to put a crafting output system into my inventory mod but can't find a simpler idea than what you have.
ashenk69, some of the code was copied from the creative_inventory module (i will add credit into my code). Without your code I would not have been able to achieve this. Thanks so much!
One note, I found that the pagination needed a little tweaking. I basically made it so the item is not removed from the stack when you goto next/prev page. I think I twiddled with the pagination logic a little too.
Brilliant idea of yours to use an inventory slot to paginate.
Also thanks to everyone who helped and to everyone who made other modules which also helped me understand the code.
Last edited by cornernote on Thu Jul 12, 2012 02:04, edited 1 time in total.
SegFault22 wrote:Great idea! With minecraft there is no way to read recipes in-game, but with this mod in Minetest we can view recipes in-game, making Minetest better than Minecraft a little bit more
The code goes into init.lua, depends.txt can be empty, or have the word "default" (without the quotes) inside it. Put all that in a folder called craft_sign and you are good to go!
I really recommending changing the default.lua aswell so you get to see all the crafts, not just the ones that load after this mod.
I think I was able to get it to register all the crafts that are in the game. By moving the craft recording code into a separate mod folder. I set depends.txt file to depend on nothing and the crafts variable was already a global variable so you can access it in any other mod folder no problem. So now it stores all the mod crafts and it still stores the default crafts even though it doesn't print anything out for them in the debug file. I also put in a check so it didn't crash every time you would try and put in an object that didn't have a recipe.
ServerError: LuaError: error:
...bin\..\games\minetest_game\mods\craft_guide\init.lua:259:attempt to index
global 'crafts' (a nil value)
stack traceback:
[C]:in function 'add_node'
...4.dev-20120606-c57e508-win32\bin\..\builtin/item.lua:159:in function
ServerError: LuaError: error:
...bin\..\games\minetest_game\mods\craft_guide\init.lua:259:attempt to index
global 'crafts' (a nil value)
stack traceback:
[C]:in function 'add_node'
...4.dev-20120606-c57e508-win32\bin\..\builtin/item.lua:159:in function
in register_craft.lua (in your default module, if you copied it there)
make sure this line:
crafts = {}
is before this line:
local minetest_register_craft = minetest.register_craft
it should be that way in 0.0.2, let me know if you still have issues
Last edited by cornernote on Fri Jul 13, 2012 04:12, edited 1 time in total.
in mine it is, but it still crashes me, same error message as infinity posted.
06:12:52: VERBOSE[main]: error_message = ServerError: LuaError: error: ...e508-win32\bin\..\mods\minetest\craft_guide\init.lua:259: attempt to index global 'crafts' (a nil value)
06:12:52: VERBOSE[main]: stack traceback:
06:12:52: VERBOSE[main]: [C]: in function 'add_node'
06:12:52: VERBOSE[main]: ...4.dev-20120606-c57e508-win32\bin\..\builtin/item.lua:159: in function <...4.dev-20120606-c57e508-win32\bin\..\builtin/item.lua:124>
Last edited by RandomBot on Mon Jul 16, 2012 10:30, edited 1 time in total.
"Everyone has a plan, until they get punched in the face"
- Mike Tyson