[Mod] Craft Guide [craft_guide] - Shows crafts for all loade

Post Reply
cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

[Mod] Craft Guide [craft_guide] - Shows crafts for all loade

by cornernote » Post

Craft Guide for Minetest

Shows crafts for all loaded mods.

Documentation | GitHub Project

Image

About

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:

Code: Select all

/giveme craft_guide:sign_wall
Credits

darkrose - updated minetest core to support craft lookup using the output
ashenk69 - code was originality adapted from his creative inventory mod

License

BSD-3-Clause, Copyright © 2014 Brett O'Donnell
Last edited by cornernote on Wed Oct 14, 2015 22:36, edited 2 times in total.

lkjoel
Member
Posts: 779
Joined: Wed Feb 29, 2012 19:27
Location: Gallifrey
Contact:

by lkjoel » Post

Screenshots?
My mods: The Nether | Doctor Who (WIP)

I have quit minetest ... again. I am heavily unimpressed by both the game and the community.

User avatar
Topywo
Member
Posts: 1721
Joined: Fri May 18, 2012 20:27

by Topywo » Post

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.

User avatar
SegFault22
Member
Posts: 872
Joined: Mon May 21, 2012 03:17
Location: NaN

by SegFault22 » Post

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 :D
"All we need it the right major crisis and the nations will accept the new world order."

ashenk69
Member
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Post

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.

cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Post

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.

User avatar
Stef
Member
Posts: 394
Joined: Wed Apr 04, 2012 10:46
Location: Belgium

by Stef » Post

where is the dowload?
Sorry for my crappy english, im dutch :D

Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

Stef wrote:where is the dowload?
you have to make the files yourself.

User avatar
Stef
Member
Posts: 394
Joined: Wed Apr 04, 2012 10:46
Location: Belgium

by Stef » Post

what files do i need? .lua and depends?
Sorry for my crappy english, im dutch :D

User avatar
LolManKuba
Member
Posts: 939
Joined: Fri Feb 10, 2012 22:36
Location: Ontario, Canada
Contact:

by LolManKuba » Post

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 :D
Wrong you can but it is also a mod.

cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Post

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.

User avatar
Stef
Member
Posts: 394
Joined: Wed Apr 04, 2012 10:46
Location: Belgium

by Stef » Post

some of the recipes are with unknow items, is this normal it's by mods only i think
Sorry for my crappy english, im dutch :D

cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Post

I tested it with a few mods and it seemed to work. Perhaps the mods you have can also use other mods that you don't have. Which mods are you running?

User avatar
Stef
Member
Posts: 394
Joined: Wed Apr 04, 2012 10:46
Location: Belgium

by Stef » Post

a lot, but by the ironstone or stone bricks of moreblocks mod it won't work
Sorry for my crappy english, im dutch :D

sfan5
Moderator
Posts: 4094
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

Looks nice!
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

ashenk69
Member
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Post

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.

User avatar
InfinityProject
Member
Posts: 1009
Joined: Sat Mar 17, 2012 00:52
Location: World of Infinity, US

by InfinityProject » Post

Dude................................................... This is awesome!

User avatar
InfinityProject
Member
Posts: 1009
Joined: Sat Mar 17, 2012 00:52
Location: World of Infinity, US

by InfinityProject » Post

Was working in one world, now this comes up when I try to place the sign:

Code: Select all

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

cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Post

InfinityProject wrote:Was working in one world, now this comes up when I try to place the sign:

Code: Select all

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.

User avatar
RandomBot
Member
Posts: 164
Joined: Sun May 20, 2012 03:46
Location: Behind you, go ahead, look....

by RandomBot » Post

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

cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Post

in init.lua there is a NOTES section. At step 3 I forgot to remove the comment.

Line 47:
--dofile(minetest.get_modpath("craft_guide").."/register_craft.lua") -- comment out this line

Should be:
dofile(minetest.get_modpath("craft_guide").."/register_craft.lua") -- comment out this line

Or, better still, follow the 3 steps to include all craftable items.

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

Can you please indicate in the first post to which parts the license applies? Thanks.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Post

It applies to all the files in the download. What else would it apply to?

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

It is possible to have different licenses for code vs. textures, and you're supposed to indicate it in the post. Anyway, noted and moved! :-)
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Post

ahh ok, i have no textures. I just used the plain old sign. I should do that in next version.

Thanks VanessaE!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 25 guests