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

cornernote
Member
 
Posts: 844
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:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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

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

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: 844
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

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: 4412
Joined: Mon Oct 03, 2011 17:58
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

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

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: 844
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

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: 844
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

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
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
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

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

by InfinityProject » Fri Jul 13, 2012 03:45

Was working in one world, now this comes up when I try to place the sign:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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 » Fri Jul 13, 2012 04:11

InfinityProject wrote:Was working in one world, now this comes up when I try to place the sign:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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

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: 844
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
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
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: 844
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
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
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: 844
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!
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Tue Jul 17, 2012 08:25

If this was installed on the server, will it add additional lag?

Or does the user handle it all
 

User avatar
Bas080
Member
 
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080

by Bas080 » Tue Jul 17, 2012 08:28

What could it be?

10:23:53: ERROR[main]: ServerError: LuaError: error: ...hare/minetest/games/simple/mods/craft_guide/init.lua:259: attempt to index global 'crafts' (a nil value)
10:23:53: ERROR[main]: stack traceback:
10:23:53: ERROR[main]: [C]: in function 'add_node'
10:23:53: ERROR[main]: /usr/bin/../share/minetest/builtin/item.lua:159: in function </usr/bin/../share/minetest/builtin/item.lua:124>
 

Kays
New member
 
Posts: 8
Joined: Wed Jul 04, 2012 09:45

by Kays » Wed Jul 18, 2012 01:27

Attempted to install according to the directions, was able to place the sign but it crashed the game. Restarting allowed me to view the sign but it was empty. I'm assuming I messed something up. In step 2, where do you insert that line. In step 3, can you delete the line or have to comment it out with // or /* . I've tried both but I must have done something wrong.
 

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

by cornernote » Wed Jul 18, 2012 02:31

Kays wrote:Attempted to install according to the directions, was able to place the sign but it crashed the game. Restarting allowed me to view the sign but it was empty. I'm assuming I messed something up. In step 2, where do you insert that line. In step 3, can you delete the line or have to comment it out with // or /* . I've tried both but I must have done something wrong.



In step 2, insert the line to default.lua on line 17...

eg:
FIND:
dofile(minetest.get_modpath("default").."/leafdecay.lua")
BELOW, INSERT:
dofile(minetest.get_modpath("default").."/register_craft.lua")

In step 3 you can remove the line, or comment it with -- (2 dashes).
 

Kays
New member
 
Posts: 8
Joined: Wed Jul 04, 2012 09:45

by Kays » Mon Jul 23, 2012 08:16

cornernote wrote:
Kays wrote:Attempted to install according to the directions, was able to place the sign but it crashed the game. Restarting allowed me to view the sign but it was empty. I'm assuming I messed something up. In step 2, where do you insert that line. In step 3, can you delete the line or have to comment it out with // or /* . I've tried both but I must have done something wrong.



In step 2, insert the line to default.lua on line 17...

eg:
FIND:
dofile(minetest.get_modpath("default").."/leafdecay.lua")
BELOW, INSERT:
dofile(minetest.get_modpath("default").."/register_craft.lua")

In step 3 you can remove the line, or comment it with -- (2 dashes).



Whatever I did wrong before, I did right this time around. No longer crashes, and it displays all the recipes exactly as advertised. Very nice.
 

Next

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 51 guests

cron