Shapeless and replacements

Post Reply
User avatar
i_have_four_noses
New member
Posts: 3
Joined: Mon Jun 25, 2012 23:28

Shapeless and replacements

by i_have_four_noses » Post

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.

User avatar
Keriz
Member
Posts: 20
Joined: Mon Jul 02, 2012 16:04

by Keriz » Post

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 ?)

User avatar
i_have_four_noses
New member
Posts: 3
Joined: Mon Jun 25, 2012 23:28

by i_have_four_noses » Post

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?

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 6 guests