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

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

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

by cornernote » Wed Jul 11, 2012 15:17

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: 778
Joined: Wed Feb 29, 2012 19:27
Location: Gallifrey

by lkjoel » Wed Jul 11, 2012 19:25

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: 1718
Joined: Fri May 18, 2012 20:27

by Topywo » Wed Jul 11, 2012 20:12

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: 870
Joined: Mon May 21, 2012 03:17
Location: NaN

by SegFault22 » Wed Jul 11, 2012 22:46

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
Resources are abundant; only money is scarce. People should not have to work hard and remain poor just to pay for the needs of survival.
Society can thrive without money - but only if productive members of society are rewarded for being productive.
 

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

by ashenk69 » Wed Jul 11, 2012 23:07

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: 843
Joined: Wed Jul 11, 2012 15:02

by cornernote » Thu Jul 12, 2012 01:51

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 » Thu Jul 12, 2012 05:27

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

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

by Jordach » Thu Jul 12, 2012 07:00

Stef wrote:where is the dowload?

you have to make the files yourself.

( ͡° ͜ʖ ͡°) ( ͡o ͜ʖ ͡o) [$ ( ͡° ͜ʖ ͡°) $] ( ͡$ ͜ʖ ͡$) ヽ༼ຈل͜ຈ༽ノ



My image and media server is back online and is functioning as normal.
 

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

by Stef » Thu Jul 12, 2012 07:09

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

by LolManKuba » Thu Jul 12, 2012 07:18

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: 843
Joined: Wed Jul 11, 2012 15:02

by cornernote » Thu Jul 12, 2012 07:23

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 » Thu Jul 12, 2012 07:47

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: 843
Joined: Wed Jul 11, 2012 15:02

by cornernote » Thu Jul 12, 2012 07:49

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 » Thu Jul 12, 2012 07:50

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

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

by sfan5 » Thu Jul 12, 2012 08:57

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 » Thu Jul 12, 2012 14:52

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 » Thu Jul 12, 2012 15:58

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

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

by InfinityProject » Fri Jul 13, 2012 03:45

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: 843
Joined: Wed Jul 11, 2012 15:02

by cornernote » Fri Jul 13, 2012 04:11

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 » Mon Jul 16, 2012 10:20

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: 843
Joined: Wed Jul 11, 2012 15:02

by cornernote » Mon Jul 16, 2012 11:02

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: 3764
Joined: Sun Apr 01, 2012 12:38
Location: Waynesville, NC
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

by VanessaE » Mon Jul 16, 2012 13:23

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 (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

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

by cornernote » Mon Jul 16, 2012 13:27

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

User avatar
VanessaE
Moderator
 
Posts: 3764
Joined: Sun Apr 01, 2012 12:38
Location: Waynesville, NC
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

by VanessaE » Mon Jul 16, 2012 13:41

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 (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

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

by cornernote » Mon Jul 16, 2012 13:42

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

Thanks VanessaE!
 

Next

Return to Mod Releases

Who is online

Users browsing this forum: Majestic-12 [Bot] and 5 guests