Page 1 of 1

Can't get the craft recipe ;_;

PostPosted: Tue Feb 14, 2012 21:45
by Lunarhiro
Edited to fit my new problem...

I fixed all of the problems alone so far, so the mod actually loads! HURRAY ;D!

Now here's the thing...I wanted to make it so you use a jungle grass and a scissors (from animalmaterials mod) to give you the flower...just for practice of course. The debug says it registered the craft recipe, but when I put the junglegrass next to the scissors...nothing appears in the box to the right...I don't know what I'm doing wrong and I'M trying really hard. If anyone could help me, heres what I got:

Note: My image locations for the images are as follows:

RED FLOWER -
Minetest -> data -> mods -> flowers -> textures -> red.png


SCISSORS -
Minetest -> data -> mods -> animalmaterials -> textures -> animalmaterials_scissors.png


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
--[[
****
Flowers
by Lunarhiro
Version 1.0
****
--]]

--Converts Junglegrass to Red Flower

minetest.register_craft({
    output = 'flowers:red 1',
    recipe = {
        {'default:default_junglegrass.png'},
    }
})

--Node

minetest.register_node("flowers:red", {
    description = "Red Flower",
    tile_images = {"red.png"},
    is_ground_content = true,
    material = minetest.digprop_constanttime(0.5),
})

PostPosted: Tue Feb 14, 2012 22:18
by Jordach
Here be the fix.

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 = "flowers:red",
    recipe = "default:junglegrass",
   
})

--Node

minetest.register_node("flowers:red", {
    description = "Red Flower",
    drawtype = "plantlike",
    inventory_image = "flower_red.png",
    tile_images = {"flower_red.png"},
    is_ground_content = true,
    material = minetest.digprop.plantlike(0.1),
    walkable = true,
})


I made sure this works.

PostPosted: Tue Feb 14, 2012 22:20
by kahrl
Another fix:
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
    material = minetest.digprop_plantlike(0.1),

@Jordach I don't think it will work if you remove the {}s from the recipe.

PostPosted: Tue Feb 14, 2012 22:25
by Jordach
It might, I code like that and it seeme to work.

see my colours blocks mod for this.

It converts white to grey, then grey to black.

PostPosted: Tue Feb 14, 2012 22:26
by Lunarhiro
Oh snap, did'nt see you guys replied, well I updated main post, and thanks guys for helping more, but now I ran into a problem...

23:25:05: ERROR[main]: [LUA] ...Minetest4\minetest\bin\..\data\mods\flowers\init.lua:25: attempt to call field 'digprop_plantlike' (a nil value)


when I have it just as you guys do :/

PostPosted: Tue Feb 14, 2012 22:27
by Lunarhiro
Jordach wrote:It might, I code like that and it seeme to work.

see my colours blocks mod for this.

It converts white to grey, then grey to black.


LOL I'm using your mod to help me figure this out :o

but you did do it like :

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 = 'colour_blocks:magenta 16',
    recipe = {
        {'colour_blocks:cyan', 'colour_blocks:red'},
    }
})

PostPosted: Tue Feb 14, 2012 22:27
by Jordach
Look at the code.

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_node("default:junglegrass", {
    description = "Jungle Grass",
    drawtype = "plantlike",
    visual_scale = 1.3,
    tile_images = {"default_junglegrass.png"},
    inventory_image = "default_junglegrass.png",
    wield_image = "default_junglegrass.png",
    paramtype = "light",
    walkable = false,
    material = minetest.digprop_leaveslike(1.0),
})


This isthe jungle grass code, look at it, and see if it helps. (My code looks like this, in this style.)

PostPosted: Tue Feb 14, 2012 22:29
by kahrl
Oops, forgot to look if digprop_plantlike actually exists. You probably want digprop_leaveslike.

PostPosted: Tue Feb 14, 2012 22:36
by Lunarhiro
IT WORKS!!!!!!!! WOOOOOO! Thanks guys! ;D!

Now I can work on this a lil more, then bug you guys again when I have more problems :). Thanks again wow YAY, red flower in mah hand >:D PLACED ON GROUND BABY! BOOYAHH!!

PostPosted: Tue Feb 14, 2012 22:38
by Jordach
One more thing, check other mods for more infos, you can even use mine, and use the init.lua in the default folder. You may learn something. Just like I did.

Oh yeah, doh! >.<

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 = 'colour_blocks:magenta 16',
    recipe = {
        {'colour_blocks:cyan', 'colour_blocks:red'},
    }
})

PostPosted: Tue Feb 14, 2012 22:41
by Lunarhiro
Glad you guys helped...really, Now I can probably try to contribute some help ;D! I'm also a pixel artist if anyone cares...

PostPosted: Tue Feb 14, 2012 22:42
by Jordach
Luna, we could work together you know.

(I am learning C++ and LUA.)

PostPosted: Tue Feb 14, 2012 22:43
by Lunarhiro
Oh that sounds nice, work together as in what? Modding? :o

I tried learning some C#, did'nt get too far in it at all though, had hardly anytime due to school and work xD, now I just go to work... working hard c:

PostPosted: Tue Feb 14, 2012 22:44
by Jordach
I can code, you can do art, (I clearly suck at this.)

EDIT: Yep, you can do art if you wish, and nice pic! ^_^

PostPosted: Tue Feb 14, 2012 22:45
by Lunarhiro
:o sounds fun, when do we start? xD, oh but first you might wanna see some stuff I did O.e

http://lunarhiro.deviantart.com/gallery/?offset=0

PostPosted: Tue Feb 14, 2012 22:46
by Jordach
I've seen the converter, my colours mod does this too. (Mainly the white block. But still.)

EDIT: I'll send you mail when we need to work together.

EDIT2: I have nearly finished my Halo Energy sword, it freaking awesome! It kills DMs in one! ^_^

PostPosted: Tue Feb 14, 2012 22:48
by Lunarhiro
Ah okay, ;D and thanks. I just posted a link on that lil post I made...but meh, Ima post it here too I guess xD

http://lunarhiro.deviantart.com/gallery/?offset=0

even has some pics of a game I been working on... :/

PostPosted: Tue Feb 14, 2012 22:50
by Jordach
Nice pics, lets get to work.

PostPosted: Tue Feb 14, 2012 22:52
by Lunarhiro
I await your request mate ;D , gonna go work on my mod some more ;d WOO

PostPosted: Tue Feb 14, 2012 23:06
by Jordach
Ok, chat to you soon.

- Jordach.

EDIT: Mail will only be sent when I have an idea and need the textures (at first I will use placeholders), this part can come last.