Concept For A Basic Enchanting Table.

Josh
Member
 
Posts: 1146
Joined: Fri Jun 29, 2012 23:11

Concept For A Basic Enchanting Table.

by Josh » Sat Mar 30, 2013 03:27

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.zip
Any bugs testing this? please tell me!

-Josh
 

User avatar
snakevenom
Member
 
Posts: 119
Joined: Sat Sep 22, 2012 12:56

by snakevenom » Sat Mar 30, 2013 13:29

nice +1!
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

by 12Me21 » Sat Mar 30, 2013 14:01

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,
})



This is a signature virus. Add me to your signature so that I can multiply.
Don't ever save anything as a JPEG.
 

User avatar
Likwid H-Craft
Member
 
Posts: 1113
Joined: Sun Jan 06, 2013 14:20

by Likwid H-Craft » Sat Mar 30, 2013 17:44

Should the cooking be replace with enchanting?
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Sat Mar 30, 2013 18:38

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.
 

Josh
Member
 
Posts: 1146
Joined: Fri Jun 29, 2012 23:11

by Josh » Sun Mar 31, 2013 02:00

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 :)
Last edited by Josh on Sun Mar 31, 2013 02:28, edited 1 time in total.
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Sun Mar 31, 2013 02:04

maybe make it a converter that changes cheap items to expensiv. like leaves to green dye or wool and so on
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
Likwid H-Craft
Member
 
Posts: 1113
Joined: Sun Jan 06, 2013 14:20

by Likwid H-Craft » Sun Mar 31, 2013 02:06

^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...
Last edited by Likwid H-Craft on Sun Mar 31, 2013 02:07, edited 1 time in total.
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)
 

User avatar
Linxx
Member
 
Posts: 401
Joined: Wed May 16, 2012 00:37

by Linxx » Sun Mar 31, 2013 04:05

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?
Last edited by Linxx on Sun Mar 31, 2013 14:23, edited 1 time in total.
 

User avatar
Likwid H-Craft
Member
 
Posts: 1113
Joined: Sun Jan 06, 2013 14:20

by Likwid H-Craft » Sun Mar 31, 2013 14:18

Ok I edit the code and, I change the textures but, it not right so how big is this block will be?

Image
I made it black to show you the high and, I made it 128x128 see better.
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

by 12Me21 » Mon Apr 01, 2013 01:22

I couldn't get the enchanting table to work, but the recipes work with the furnace.
This is a signature virus. Add me to your signature so that I can multiply.
Don't ever save anything as a JPEG.
 

Josh
Member
 
Posts: 1146
Joined: Fri Jun 29, 2012 23:11

by Josh » Mon Apr 01, 2013 02:08

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?
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Mon Apr 01, 2013 04:19

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?
 

Josh
Member
 
Posts: 1146
Joined: Fri Jun 29, 2012 23:11

by Josh » Tue Apr 02, 2013 02:04

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.
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

by 12Me21 » Tue Apr 02, 2013 02:15

I can make the table have legs, and not just be a box, but I proabaly won't be done till tomorrow
This is a signature virus. Add me to your signature so that I can multiply.
Don't ever save anything as a JPEG.
 

Josh
Member
 
Posts: 1146
Joined: Fri Jun 29, 2012 23:11

by Josh » Tue Apr 02, 2013 02:19

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

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Tue Apr 02, 2013 02:30

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.
Last edited by prestidigitator on Tue Apr 02, 2013 02:31, edited 1 time in total.
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Tue Apr 02, 2013 02:54

(EDIT: Sorry. Wrong tab.) Working on a sample implementation here.
Last edited by prestidigitator on Tue Apr 02, 2013 02:54, edited 1 time in total.
 

User avatar
Likwid H-Craft
Member
 
Posts: 1113
Joined: Sun Jan 06, 2013 14:20

by Likwid H-Craft » Tue Apr 02, 2013 12:07

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 >.<


Image
Last edited by Likwid H-Craft on Tue Apr 02, 2013 12:13, edited 1 time in total.
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)
 


Return to WIP Mods

Who is online

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

cron