Page 1 of 1
Concept For A Basic Enchanting Table.

Posted:
Sat Mar 30, 2013 03:27
by Josh
Hi all,
Early this morning i came up with a basic idea for an enchanting table. It work's like a furnace except the idea is that you place
orange dye in the 1st slot then fuel in the 2nd slot then it will magicly transform the orange dye into lava! if you use blue dye it
will transform it into water! But the problem is that i haven't got to the actual enchanting code yet, so right now it is just a block for
decoration. This mod is untested (and comes with textures) i would appreiciate if someone could test it for me. you can craft it like this: B= Book W=wood
B
W
Download:
https://dl.dropbox.com/u/102401091/enchant.zipAny bugs testing this? please tell me!
-Josh

Posted:
Sat Mar 30, 2013 13:29
by snakevenom
nice +1!

Posted:
Sat Mar 30, 2013 14:01
by 12Me21
I got it to work for the default furnace, you can cook dyes into water/lava, but I can't get it to only work for the enchanting table:
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
minetest.register_craft({
output = 'enchant:enchanting_table',
recipe = {
{'', 'default:book', ''},
{'', 'default:wood', ''},
}
})
minetest.register_craft({
type = "cooking",
output = "default:lava_source",
recipe = "dye:orange",
})
minetest.register_craft({
type = "cooking",
output = "default:water_source",
recipe = "dye:blue",
})
default.furnace_inactive_formspec =
"size[8,9]"..
"image[2,2;1,1;default_furnace_fire_bg.png]"..
"list[current_name;fuel;2,3;1,1;]"..
"list[current_name;src;2,1;1,1;]"..
"list[current_name;dst;5,1;2,2;]"..
"list[current_player;main;0,5;8,4;]"
minetest.register_node("enchant:enchanting_table", {
description = "Enchanting Table",
tiles = {"enchanting_table.png", "enchanting_table_top.png"},
paramtype2 = "facedir",
groups = {cracky=2},
legacy_facedir_simple = true,
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec", default.furnace_inactive_formspec)
meta:set_string("infotext", "Furnace")
local inv = meta:get_inventory()
inv:set_size("fuel", 1)
inv:set_size("src", 1)
inv:set_size("dst", 4)
end,
can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory()
if not inv:is_empty("fuel") then
return false
elseif not inv:is_empty("dst") then
return false
elseif not inv:is_empty("src") then
return false
end
return true
end,
})
minetest.register_node("enchant:enchanting_table_active", {
description = "Enchanting_table",
tiles = {"enchanting_table.png", "enchanting_table_top.png"},
paramtype2 = "facedir",
light_source = 8,
drop = "enchant:enchanting_table",
groups = {cracky=2, not_in_creative_inventory=1},
legacy_facedir_simple = true,
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec", default.furnace_inactive_formspec)
meta:set_string("infotext", "Furnace");
local inv = meta:get_inventory()
inv:set_size("fuel", 1)
inv:set_size("src", 1)
inv:set_size("dst", 4)
end,
can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory()
if not inv:is_empty("fuel") then
return false
elseif not inv:is_empty("dst") then
return false
elseif not inv:is_empty("src") then
return false
end
return true
end,
})

Posted:
Sat Mar 30, 2013 17:44
by Likwid H-Craft
Should the cooking be replace with enchanting?

Posted:
Sat Mar 30, 2013 18:38
by prestidigitator
I think the problem might be that the furnace uses an ABM to switch to active mode, which is really a pretty bad example of how to do this since we (now?) have the *_metadata_inventory_*() callbacks (e.g.
on_metadata_inventory_put(...)). This should probably be changed in the default game so that we can use an event rather than having an extra ABM running all the time which usually does nothing. You probably WILL need an ABM for the "active" mode, unless you use
minetest.after(...) or something. Depends also on whether you want to change the external appearance of the node when it is "active". If not, you could probably just get away with the timer and use one node type instead of two.

Posted:
Sun Mar 31, 2013 02:00
by Josh
Thankyou for all your comments and suggestions! 12Me21: Ah yes, the code for smelting will go well with this mod, thankyou for that peice of code. (do i replace this mods current code with the one you have shown me?)
EDIT: I just tried the code 12Me21 showed me with this mod it did not work, also the code i made didn't work, anyway to fix this?
I would like to get this mod working because people might like it :)

Posted:
Sun Mar 31, 2013 02:04
by jojoa1997
maybe make it a converter that changes cheap items to expensiv. like leaves to green dye or wool and so on

Posted:
Sun Mar 31, 2013 02:06
by Likwid H-Craft
^I got a idea what if what if we make, when you mine something it drops xp, and the item, but how do you make a thing drop 2 things IDK >.<
And We should use xp make stuff.
Well I look on the xp if like so...

Posted:
Sun Mar 31, 2013 04:05
by Linxx
jojoa1997 wrote:maybe make it a converter that changes cheap items to expensiv. like leaves to green dye or wool and so on
wouldn't that be close to alchemy?

Posted:
Sun Mar 31, 2013 14:18
by Likwid H-Craft
Ok I edit the code and, I change the textures but, it not right so how big is this block will be?

I made it black to show you the high and, I made it 128x128 see better.

Posted:
Mon Apr 01, 2013 01:22
by 12Me21
I couldn't get the enchanting table to work, but the recipes work with the furnace.

Posted:
Mon Apr 01, 2013 02:08
by Josh
Likwid H-Craft: The enchanting table should be the size of a normal node, but that would be a good size :)
12Me21: Ah, we still have to find a way to get it to work for the enchanting table, any posssible way you can think of?

Posted:
Mon Apr 01, 2013 04:19
by prestidigitator
Question: do you want the node to have a different external appearance when it is "active", or is the same external appearance sufficient as long as the menu indicates what is happening?

Posted:
Tue Apr 02, 2013 02:04
by Josh
prestidigitator wrote:Question: do you want the node to have a different external appearance when it is "active", or is the same external appearance sufficient as long as the menu indicates what is happening?
Some sparkles rotating around the table when active would be nice.

Posted:
Tue Apr 02, 2013 02:15
by 12Me21
I can make the table have legs, and not just be a box, but I proabaly won't be done till tomorrow

Posted:
Tue Apr 02, 2013 02:19
by Josh
12Me21 wrote:I can make the table have legs, and not just be a box, but I proabaly won't be done till tomorrow
Cool! Tell me when you are finished :)

Posted:
Tue Apr 02, 2013 02:30
by prestidigitator
Josh wrote:prestidigitator wrote:Question: do you want the node to have a different external appearance when it is "active", or is the same external appearance sufficient as long as the menu indicates what is happening?
Some sparkles rotating around the table when active would be nice.
Okay. So that can probably be handled through particles, meaning the node itself doesn't have to change textures or anything. The reason this question is important is that the furnace goes through great pains to show a burning fire on the outside when it is active, and a black hole when it is inactive. It actually replaces the node on the map with an "active" version of itself, which is an ugly thing to do. If all you want to do is change the formspec and possibly rez some particles, switching nodes shouldn't be necessary and the implementation can be a bit cleaner.

Posted:
Tue Apr 02, 2013 02:54
by prestidigitator
(EDIT: Sorry. Wrong tab.) Working on a sample implementation here.

Posted:
Tue Apr 02, 2013 12:07
by Likwid H-Craft
Josh wrote:12Me21 wrote:I can make the table have legs, and not just be a box, but I proabaly won't be done till tomorrow
Cool! Tell me when you are finished :)
Well Check out this :) I made it for, my game The Legend of Zelda but since I am using this mod I be happy for you to use it Josh...
Well what me retexture it first since it needs to be Since it black since I make everything black to start off on, something...
Edit:Opps Forgot add it >.<
