Coder Social home page Coder Social logo

craftguide's Introduction

Preview1 Crafting Guide

ContentDB ContentDB

craftguide is the most comprehensive crafting guide on Minetest.

Consult the Minetest Wiki for more details.

This crafting guide is a blue book named "Crafting Guide" or a wooden sign.

This crafting guide features a progressive mode. This mode is a Terraria-like system that shows recipes you can craft from items you ever had in your inventory. To enable it: craftguide_progressive_mode = true in minetest.conf.

Use the command /craft to show the recipe(s) of the pointed node.

For developers, craftguide also has a modding API.

Love this mod? Donations are appreciated: https://www.paypal.me/jpg84240

Preview2

craftguide's People

Contributors

bell07 avatar codexp avatar emojigit avatar kilbith avatar linewriter1024 avatar louisroyer avatar orbea avatar p-ouellette avatar r3r3r3 avatar rubenwardy avatar smalljoker avatar sofar avatar t4im avatar taikedz avatar wuzzy2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

craftguide's Issues

Progressive Mode can "miss" a couple of craft recipes

How to repro:

  1. Set Progressive Mode
  2. Start MTG
  3. /giveme craftguide:book
  4. Mine tree
  5. Look in craftguide. Everything looks fine so far
  6. Craft wooden planks and immedaitely craft sticks
  7. Look in craftguide again. Whoops, where did the tool recipes go?!

Apparently the craftguide seemed to have “missed” the fact that you had wooden planks in your inventory.

You could also try this:

  1. Set Progressive Mode
  2. Start MTG
  3. /giveme craftguide:book
  4. Mine sand
  5. Throw it away
  6. Look in craftguide again. Whoops, where's the glass recipe?!

I wanna bet there are a couple of other situtations how this could happen. :-(

Suggestion: Add option to have a crafting guide page to sfinv

There should be an option to register a sfinv page for a crafting guide. Something similar is done for sfinv_buttons. Would be nice to have this. I tried a little but kept running into issues. Likely because I don't know what I am doing with this mod. I came up with this idea when I was playing on the MustTest server, and noticed that they have a craft guide page, but are not using your craft guide. What do you guys think?

This would require an optional dependency on sfinv.

Lava Bucket “Replaced by Empty Bucket on crafting”

This text shows up in tooltip of lava bucket. [Minetest Game]

It's correct that it will be replaced, but by crafting? No.

This is a fuel recipe, so the item will be replaced not by crafting, but by burning / being used as fuel. Two possibilities:

  • Either change the text to “Replaced by Empty Bucket”
  • Or change text to appropriate text depending on craft type:
    • Crafting: “Replaced by Empty Bucket on crafting”
    • Smelting: “Replaced by Empty Bucket on smelting”
    • Fuel: “Replaced by Empty Bucket on burning”

Make the mod support translations?

This mod contains English words like "Alternate", "Burning time" etc.

Will it be possible to make the mod support translation? You could implement any kind of translation tools, not just intllib (though it's more convenient to use intllib as it has gettext .po support)

Not able to see recipes for burneable items

I am not able to get the recipe "tree" -> "wood". If I search for tree I get only the recipe the tree is burneable. The button "Recipe x / y" is not shown.

If I search for "wood" at the first, I see the recipe. But if I click to tree, the issue appears again.

Edit: By the way, I do not see the recipe the wood is burneable ...

[Crash] bad argument #7 to 'fmt' (string expected, got nil)

Craftguide v1.8; MT v5.0.1; MTG v5.0.1; OS Debian 10

This happens with the binoculars:

ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'craftguide' in callback on_playerReceiveFields(): .../craftguide/init.lua:621: bad argument #7 to 'fmt' (string expected, got nil)
ERROR[Main]: stack traceback:
ERROR[Main]: [C]: in function 'fmt'
ERROR[Main]: .../craftguide/init.lua:621: in function 'get_recipe_fs'
ERROR[Main]: .../craftguide/init.lua:724: in function 'make_formspec'
ERROR[Main]: .../craftguide/init.lua:734: in function 'show_fs'
ERROR[Main]: .../craftguide/init.lua:1008: in function 'fields'
ERROR[Main]: .../craftguide/init.lua:1041: in function '?'
ERROR[Main]: .../minetest/bin/../builtin/game/register.lua:419: in function <.../minetest/bin/../builtin/game/register.lua:399>

Layout adjustment concepts

Some concepts for possible layout improvements to the lower part of the crafting guide:

craftguide_mockup
Smaller Alternate button and grid shifted to the left to be more centred and aligned.

craftguide_mockup_fuels
Shifted back out to the right (and then some), but now has a separate display for fuels. This means you keep the selected item in the same place all the time, and all fuels get the same visual indicator, even if they have recipes.

craftguide_mockup_fuels2
Alternative layout based around the same ideas as # 2, but this time everything is more centred again and should still look well balanced for selected items that are not fuels.

Sign should not be in group wood

The "craftguide:sign" should not be in group wood. They are a lot of recipes using with group:wood. Currently it is possible to use the "craftguide:sign" to craft armor, boot lader and much more.

One specific technic recipe not recognized

The LV Furnace seems not to be recognized when searching for furnace (and other related keywords) although it has a recipe and crafting it works. Unified inventory for example has no issues finding the furnace and showing the recipe – so it generally is registered as expected.

2018-09-03-060108_618x298_scrot

2018-09-03-060116_664x399_scrot

2018-09-03-060400_1138x416_scrot

~/.minetest/mods/craftguide$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean


~/.minetest/mods/unified_inventory$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
~/.minetest/worlds/test $ grep ' = true' world.mt 
creative_mode = true
load_mod_mesecons_extrawires = true
load_mod_mesecons_lamp = true
load_mod_mesecons_hydroturbine = true
load_mod_mesecons_torch = true
load_mod_mesecons_wires = true
load_mod_mesecons_powerplant = true
load_mod_mesecons_gates = true
load_mod_mesecons_random = true
load_mod_mesecons_insulated = true
load_mod_mesecons_receiver = true
load_mod_mesecons = true
load_mod_mesecons_doors = true
load_mod_mesecons_switch = true
load_mod_mesecons_luacontroller = true
load_mod_mesecons_solarpanel = true
load_mod_mesecons_detector = true
load_mod_craftguide = true
load_mod_mesecons_commandblock = true
load_mod_mesecons_button = true
load_mod_extranodes = true
load_mod_technic_chests = true
load_mod_mesecons_blinkyplant = true
load_mod_wrench = true
load_mod_mesecons_lightstone = true
load_mod_mesecons_delayer = true
load_mod_mesecons_fpga = true
load_mod_mesecons_pressureplates = true
load_mod_mesecons_walllever = true
load_mod_mesecons_alias = true
load_mod_mesecons_stickyblocks = true
load_mod_mesecons_microcontroller = true
load_mod_mesecons_materials = true
load_mod_mesecons_movestones = true
load_mod_mesecons_mvps = true
load_mod_concrete = true
load_mod_mesecons_noteblock = true
load_mod_mesecons_pistons = true
load_mod_technic = true
load_mod_technic_worldgen = true
load_mod_pipeworks = true
load_mod_unified_inventory = true

Progressive list update does not work as expected without pages change

Steps to reproduce:

  1. Start with progressive mode and minetest game
  2. Drop aspen tree nearly to player and get jungle tree to inventory
  3. Look to the crafting guide => You get the jungle wood recipe as expected
  4. Collect aspen tree without changing sfinv pages (shortly leave inventory, collect and start back)
  5. Issue: There is no way to refresh the prorgessive selection for changed items, except changing the sfinv pages

Please also note the progressive selection should be refresheable in case of active search using search button

Lua Debug library called

This mod calls the debug Lua library, which it shouldn't do.

You should exert care when using this library. The functions provided here should be used exclusively for debugging and similar tasks, such as profiling. Please resist the temptation to use them as a usual programming tool: they can be very slow. (…)

https://www.lua.org/manual/5.1/manual.html#5.9

Use of semantic versioning and github tags

I propose the use of semantic versioning and github tags.

The actual version of craftguide is incompatible with stable version of Minetest (0.4.14) and if someone want compatible version of mod is inconvenient search for commits.

I propose github tags, it's more easy for download, too.

(Note: I use bower and minetest bower to manage my mods. Semantic versioning and github tags will make my life easier, too 😃)

Update

My suggestion isn't create versions tags like Minetest but create own version tags.

API call to open crafting guide

I suggest to add an API call which I would consider very crucial and important would be “open the crafting guide”. xD

It could look like this:

craftguide.show(selected_item, is_reverse)
→ opens craft guide with the current filter applied.
selected_item: optional param, if set, this item is pre-selected. If the item does not exist or has no recipe, use the player's previous selection. By default, player's previous selection is used
is_reverse: optional param. if true, use reverse crafting mode, if false, use “forwards crafting” mode, if nil, use player's previous selection

Some recipes not being shown

In Hamlet's Quest mods are stored in subfolders, or modpacks.

In MT v0.4.17 everything was fine, now the craftguide isn't showing the recipes of some mods.

These are: anvil, handholds, breadcrumbs, sounding_line and ropes.

I have tried updating each and every mod's mod.conf, I have tried with the new modpack.conf, eventually I've discovered that moving player_api in the mods' root folder (../minetest/games/game/mods/) helped to show some more recipes (don't ask me why). I have also tried removing the hq_tweaks folder to be sure that no modifications done by me were interfering.

Eventually I tried moving every mod from the modpacks (../minetest/games/game/mods/modpack/) to the mods' root folder (../minetest/games/game/mods/), and the craftguide was correctly showing every recipe.

Until I tried the gravelsieve mod (which I had put in ../minetest/mods/), once again the recipe wasn't being shown.

Have you any idea why this could be possibly happening? I am getting crazy trying to figure where is the issue.

Game crash: attempt to call field 'colorize' (a nil value)

When I open craftguide, Minetest crash.

2016-12-09 21:33:15: ACTION[Server]: USER uses craftguide:book, pointing at [node under=15,3,-22 above=16,3,-22]
2016-12-09 21:33:15: ERROR[Main]: ServerError: Lua: Runtime error from mod 'craftguide' in callback item_OnUse(): /home/USER/.minetest/mods/craftguide/init.lua:66: attempt to call field 'colorize' (a nil value)
2016-12-09 21:33:15: ERROR[Main]: stack traceback:
2016-12-09 21:33:15: ERROR[Main]: /home/USER/.minetest/mods/craftguide/init.lua:66: in function 'get_formspec'
2016-12-09 21:33:15: ERROR[Main]: /home/USER/.minetest/mods/craftguide/init.lua:234: in function </home/USER/.minetest/mods/craftguide/init.lua:228>

Minetest: 0.4.14 (standard deb installation)
OS: Ubuntu 16.04

Error message in empty craftguide in Progressive Mode is misleading

In progressive mode, you currently start out with an empty crafting guide, but if you open the craftguide, the error message is not helpful: “no items to show”.

Please add a hint, something like like: “Collect items to reveal more recipes.”. This hint should only be shown if all of these conditions are true:

  • Progressive Mode is active
  • Search has been reset
  • There exists at least one recipe in the game

Unable to use craftguide after upgrading to minetest 0.4.16

Unable to use craftguide after upgrading to minetest 0.4.16

previous version was 0.4.9 (ubuntu trusty)

any ideas? awesome mod btw

2017-10-09 22:15:22: [Main]: Automatically selecting world at [/home/mike/.minetest/worlds/test]
2017-10-09 22:15:26: WARNING[Main]: NodeDefManager: Ignoring CONTENT_IGNORE redefinition
2017-10-09 22:15:26: ACTION[Main]:         .__               __                   __   
2017-10-09 22:15:26: ACTION[Main]:   _____ |__| ____   _____/  |_  ____   _______/  |_ 
2017-10-09 22:15:26: ACTION[Main]:  /     \|  |/    \_/ __ \   __\/ __ \ /  ___/\   __\
2017-10-09 22:15:26: ACTION[Main]: |  Y Y  \  |   |  \  ___/|  | \  ___/ \___ \  |  |  
2017-10-09 22:15:26: ACTION[Main]: |__|_|  /__|___|  /\___  >__|  \___  >____  > |__|  
2017-10-09 22:15:26: ACTION[Main]:       \/        \/     \/          \/     \/        
2017-10-09 22:15:26: ACTION[Main]: World at [/home/mike/.minetest/worlds/test]
2017-10-09 22:15:26: ACTION[Main]: Server for gameid="minetest" listening on 0.0.0.0:52310.
2017-10-09 22:15:29: ACTION[Server]: singleplayer [127.0.0.1] joins game. 
2017-10-09 22:15:29: ACTION[Server]: singleplayer joins game. List of players: singleplayer
2017-10-09 22:16:15: ERROR[Server]: Item "craftguide:book" not defined
2017-10-09 22:22:24: ERROR[Server]: Item "craftguide:book" not defined
2017-10-09 22:22:34: ERROR[Server]: Item "craftguide:book" not defined

Progressive mode show up not revealed items trough groups

Steps to reproduce

  1. Start new game (Minetest game) => Craftguide is empty
  2. Get any wood in inventory and wait till Craftguide is updated
    => Result: You see all available kind of wood, with the revealed group usages
    => Expected result: You see only the revealed kind of wood with the group usages

Show replacements and repairing recipes

In order to make the wiki table fully green on the craftguide row, this is now possible to show the replacements and repairing recipes. These "recipes" need to be collected manually and registered as custom recipes.

BTW, @Wuzzy2, this wiki page needs an update (sfinv integration, /craft command, custom recipes API).

No crafts for some blocks on the first page

Installed 128413c version of crafting guide along default minetest_game. Running it in creative mode.
On the first page of crafting guide those crafts are not working, no recipe at all:

  • Simple Bed
  • Boat
  • Lava bucket
  • Brake rail
  • Cart
  • Rail
  • Crafting guide
  • Aspen Tree
  • Leaves
  • Apple
  • Aspen Leaves
  • Aspen Sapling

It seems next pages are not affected. Bug appeared in revision f3ce043

Suggestion: Usage

Occasionally I play on servers that use Unified Inventory. The built-in crafting guide also allows users to see what materials are used for. If it is not outside of the scope of this mod, could it be possible for this to be a new feature in this mod? I love craftguide, but I miss being able to view item's usage.

Crafting recipe for written book is not shown

The following shapeless recipe from Minetest Game to craft a “Book With Text” is not shown in the crafting guide:

Book With Text (`default:book_written`) + Book (`default:book`)

This is a spcial recipe to copy the contents of the book with text into the book.
This recipe clearly needs to be shown in the crafting guide.

I also know the reason. In craftguide:get_init_items, the function filters out items with not_in_creative_inventory=1. This is the case for “Book With Text”.

I think this check should be removed, but I can also see the intention here: To reduce possible recipe clutter. However, I think there could be a better way to hide certain recipes.

I suggest to replace the check against not_in_creative_inventory, with not_in_craft_guide. The new group is already being used by zcg and craft_guide and could be defined like this: “Crafting recipes which have this item as a result will not be shown in the crafting guide. The item may still be shown as an ingredient.”

What do you think?

Update list of discovered items after player inventory change

In 5.0.0 it is now possible to detect when a player inventory changed:

minetest.register_on_player_inventory_action

Currently, this mod updates the progressive mode discovered items by polling. I request this behaviour to be optimized accordingly.

nil item crash

2019-06-29 13:12:51: ACTION[Main]: Server: Shutting down
2019-06-29 13:12:52: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'craftguide' in callback on_playerReceiveFields(): /home/mtxanadu/.minetest/mods/craftguide/init.lua:409: attempt to index a nil value
2019-06-29 13:12:52: ERROR[Main]: stack traceback:
2019-06-29 13:12:52: ERROR[Main]: /home/mtxanadu/.minetest/mods/craftguide/init.lua:409: in function 'get_tooltip'
2019-06-29 13:12:52: ERROR[Main]: /home/mtxanadu/.minetest/mods/craftguide/init.lua:500: in function 'get_recipe_fs'
2019-06-29 13:12:52: ERROR[Main]: /home/mtxanadu/.minetest/mods/craftguide/init.lua:674: in function 'make_formspec'
2019-06-29 13:12:52: ERROR[Main]: /home/mtxanadu/.minetest/mods/craftguide/init.lua:695: in function 'show_fs'
2019-06-29 13:12:52: ERROR[Main]: /home/mtxanadu/.minetest/mods/craftguide/init.lua:900: in function 'on_receive_fields'
2019-06-29 13:12:52: ERROR[Main]: /home/mtxanadu/.minetest/mods/craftguide/init.lua:939: in function </home/mtxanadu/.minetest/mods/craftguide/init.lua:937>
2019-06-29 13:12:52: ERROR[Main]: /usr/share/minetest/builtin/game/register.lua:419: in function </usr/share/minetest/builtin/game/register.lua:399>

This points to this line inside get_tooltip() function:

	tooltip = reg_items[item].description

Idea: Button instead of setting for progressive_mode

The craftguide does support currently 2x modes for items selection: "All items" and "Crafteable by items in inventory", managed by game setting "craftguide_progressive_mode".

My proposal is to allow the player to the switch between the modes using a new button/toggle.
Maybe with interface like (pseudocode) craftuide.register_selection("progressive", {recipe_in_inv = function() } to allow to add additional selection views by other mods.

the smart_inventory builtin crafting guide know the next selection modes

  • All items
  • Crafteable by items in inventory (=progressive)
  • Crafteable by already revealed items (using "doc_items" reveal database)
  • Crafting proposals (using "doc_items" reveal database, best reveals)
  • Crafting grid pattern match

I am interested to port some of them to new craftguide-addon mods if possible

Can't reveal fuel items in Progressive Mode

If you're in progressive mode, it seems you cannot reveal items that are only useful as fuels.

Examples in Minetest Game: Leaves, Dry Shrub.

How to repro in MTG:

  • Start game with fresh empty craftguide in Progressive Mode
  • Mine leaves
  • Open craftguide

Compare with “non-Progressive Mode” in which the leaves show up.

Crash on minetest 0.4.17.1: attempt to call field get_translator

Trying to start a world with craftguide 0.4.17 on minetest 0.4.17.1 fails:

ERROR[Main]: ModError: Failed to load and run script from /home/cweiske/.minetest/mods/craftguide-0.4.17/init.lua:
ERROR[Main]: /home/cweiske/.minetest/mods/craftguide-0.4.17/init.lua:24: attempt to call field 'get_translator' (a nil value)
ERROR[Main]: stack traceback:
ERROR[Main]:       /home/cweiske/.minetest/mods/craftguide-0.4.17/init.lua:24: in main chunk
ERROR[Main]: Siehe debug.txt für Details.

minetest was installed from the Debian package repository (0.4.17.1+repack-1).

Probably because translations are only available since 0.5.

API calls to learn recipes in Progressive Mode

For progressive mode, I'd like to suggest a convenience function to “reveal” new recipes to a player by API call (as if the player had collected the item).
I also suggest a callback that fires whenever a new recipe is revealed.

Use case:
So for example, mods and games could reveal some basic but crucial “starter” recipes (like wood, torch). And they could reveal groups of items on certain events.

Some wool recipes display the wrong dye

Green wool, magenta wool, and red wool display the correct tooltip but the wrong dye in their recipes. Green wool shows wool + dark green dye, magenta wool shows wool + purple dye, and red wool show wool + pink dye.

progressive API improvement proposal

The current progressive API can filter recipes. The default implementation does filter the recipes based on inv_items table that contain the "revealed" items. The inv_items table is a part of the default progressive implementation and should be replaceable by custom logic.
Since 92cf230 the inv_items table is used for all progressive implementations that is not always right.

My propoasal is to introduce new API function
to be overriden directly:

craftguide.is_revealed(itemname, player)

or same way as for recipes:

craftguide.set_item_filter(name, function(itemname, player))
craftguide.add_item_filter(name, function(itemname, player))

to wrap around inv_items, and use them in default recipe filter.

For my use-case craftguide_reveal I need only the item filter, the recipe filter is the same but with access to the doc_item revealed table instead of inv_items

Can't use area-tooltips on item buttons

I'd like to use area-tooltips on certain item image buttons, as they show up quicker than the element-tooltips and for another technical reason. Problem: there is no way to override the default tooltips on the item buttons, they show up right after the area-tooltips.

Cc: @rubenwardy @SmallJoker

Misleading message when using /craft on node that you don't know its recipe of yet [Progressive Mode]

If you are in progressive mode, started out with an empty craftguide, then you walk to a stone and type in /craft, the game claims there is no recipe for it.

When you mine the stone (thus reveal its recipes), then use the same command on another stone, it suddenly works.

I think this behaviour is actually correct in principle (you first have to collect the source item to “earn” more recipes), but the message is VERY misleading.

It says “No recipe for this node: X” but this isn't true. There is a recipe, you just don't know it yet. ;-)

I suggest:
In Progressive Mode, the error message should say “You don't know a recipe for this node: X”. This implies there might be a recipe for the stone, you just haven't found it out yet.

Relicense under more permissive license?

Hello. Can you do me a favor?

Can you please relicense this under the MIT License or a similar permissive license? Or if you don't want that: LGPLv2.1 (preferably with the “or later” clause).

There are some subgames (including my own) licenced under the LGPL (mainly because it's the license which Minetest uses) and it would be hard, if not impossible to legally include your mod into subgames, as the GPLv3 is incompatible with any version of the LGPL.

Personally, I think the MIT License makes more sense because it lowers the entry barrier for subgame inclusion the most. But as I said, LPGL would be fine, too.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.