Page 1 of 1

Shapeless and replacements

Posted: Sat Jul 07, 2012 02:44
by i_have_four_noses
This comes in two parts:

1.) I am attempting to make a mod, and supposedly I should be capable of setting the type of a craft to shapeless. However, I try to run minetest with the mod and it fails to load (because the recipe is an invalid recipe).

Here's some code:

Code: Select all

minetest.register_craft({
output = '"stone:halite_stone_tool" 1',
type = "shapeless",
recipe = {{'stone:halite_stone','stone:halite_stone'},}
})
I have also changed recipe = {{'"stone:halite_stone" 2'},} but that doesn't work either, nor does it work for other combinations of stones, nor for switching the line position, nor for different outputs.

I have not found a mod so far that uses type = "shapeless". Has anyone had any luck using this? Is it simply unsupported?

2.) Also, I'd like to have one of the stones remain. It seems like I could say

Code: Select all

replacements = stone_that_I_want_to_keep, stone_that_I_want_to_keep
so that any stone with the name stone_that_I_want_to_keep on the crafting grid would stay there. Is this what it is intended to do? Is that supported? I have not found any mods that do this.

Posted: Sat Jul 07, 2012 11:34
by Keriz
i_have_four_noses wrote:This comes in two parts:

1.) I am attempting to make a mod, and supposedly I should be capable of setting the type of a craft to shapeless. However, I try to run minetest with the mod and it fails to load (because the recipe is an invalid recipe).

Here's some code:

Code: Select all

minetest.register_craft({
output = '"stone:halite_stone_tool" 1',
type = "shapeless",
recipe = {{'stone:halite_stone','stone:halite_stone'},}
})
I have also changed recipe = {{'"stone:halite_stone" 2'},} but that doesn't work either, nor does it work for other combinations of stones, nor for switching the line position, nor for different outputs.

I have not found a mod so far that uses type = "shapeless". Has anyone had any luck using this? Is it simply unsupported?

2.) Also, I'd like to have one of the stones remain. It seems like I could say

Code: Select all

replacements = stone_that_I_want_to_keep, stone_that_I_want_to_keep
so that any stone with the name stone_that_I_want_to_keep on the crafting grid would stay there. Is this what it is intended to do? Is that supported? I have not found any mods that do this.
Welcome to te modding section.

Before correcting your code I'd just like to know if it's a tool ? (axe, pick, sword ?)

Posted: Sat Jul 07, 2012 22:45
by i_have_four_noses
Alright, I figured out my problem with shapeless recipes: I had an extra pair of brackets in the recipe parameter.

Anyway, question 2 still stands. When it says item pairs, how do I notate that?