Weird crafting recipe notation in minetest_game’s dye mod

Post Reply
User avatar
Wuzzy
Member
Posts: 4804
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Weird crafting recipe notation in minetest_game’s dye mod

by Wuzzy » Post

I ran the craft recipe checker on a fresh world of minetest_game 0.4.10 and it produced, to my surprise, some error messages:

Code: Select all

[DEBUG] checking recipes
[RECIPE ERROR] group:flower,color_grey in recipe for dye:grey
[RECIPE ERROR] group:flower,color_dark_grey in recipe for dye:dark_grey
[RECIPE ERROR] group:flower,color_black in recipe for dye:black
[RECIPE ERROR] group:flower,color_cyan in recipe for dye:cyan
[RECIPE ERROR] group:flower,color_dark_green in recipe for dye:dark_green
[RECIPE ERROR] group:flower,color_green in recipe for dye:green
[RECIPE ERROR] group:flower,color_brown in recipe for dye:brown
[RECIPE ERROR] group:flower,color_magenta in recipe for dye:magenta
[RECIPE ERROR] group:flower,color_pink in recipe for dye:pink
Here’s the code snipped which registers said items:

Code: Select all

-- Define items
for _, row in ipairs(dyelocal.dyes) do
	local name = row[1]
	local description = row[2]
	local groups = row[3]
	local item_name = "dye:"..name
	local item_image = "dye_"..name..".png"
	minetest.register_craftitem(item_name, {
		inventory_image = item_image,
		description = description,
		groups = groups
	})
	minetest.register_craft({
		type = "shapeless",
		output = item_name.." 4",
		recipe = {"group:flower,color_"..name},
	})
end
(Excerpt from /mods/dye/init.lua)


Now here’s my question: Is this notation like “group:flower,color_grey” inside a crafting recipe an error in minetest_game? Is it valid notation? I am not sure if the comma is a valid character in itemstrings.

If it is a valid notation, please enlighten me and explain for what the comma is for. Thanks. :-)

If the notation is valid, then the crafting recipe checker has made false-positive results and needs to be fixed.
If the notation is invalid, then the bug lies in minetest_game and needs to be fixed.

Either way, there is a bug, I just don’t know who is “guilty”. ;-)

Oh, while I’m at it: Which characters are allowed in an itemstring, anyways?
Last edited by Wuzzy on Wed Oct 22, 2014 17:24, edited 1 time in total.

User avatar
rubenwardy
Moderator
Posts: 6978
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: Weird crafting recipe notation in minetest_game’s dye mo

by rubenwardy » Post

The comma is 'and'

For example, group:one,two means that it needs to have both group:one and group:two.

Have you checked whether an item with both the groups in the error exists?

(To new viewers, I am the author of the craft recipe checker)
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Wuzzy
Member
Posts: 4804
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: Weird crafting recipe notation in minetest_game’s dye mo

by Wuzzy » Post

Oh, that’s interesting.

I conclude that the craft recipe checker made a false-positive result. I will report the bug there.

Oh, and the documentation is lacking. Nowhere in lua_api.txt it is stated that a comma is a special symbol which means “logical AND”.

I think the documentation should be a little bit more precise when it comes to crafting groups. It is true there are some examples about this but IMO examples alone do not substitute a proper definition/explanation. They can only serve as supplemental information. And crafting groups are not explained at all, there are just two random examples.

Sokomine
Member
Posts: 4290
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: Weird crafting recipe notation in minetest_game’s dye mo

by Sokomine » Post

Wuzzy wrote: I think the documentation should be a little bit more precise when it comes to crafting groups.
It certainly needs improvement. I wasn't aware of this option of combining groups exist either. The craft receipe examples seem to be split up and be diffrent in both locations in the doc/lua_api.txt They ought to be combined into one section, with a reference to the other place.
A list of my mods can be found here.

Post Reply

Who is online

Users browsing this forum: Gmr_Leon and 14 guests