Page 1 of 1

Developing a simple node

PostPosted: Mon Nov 25, 2013 00:19
by BrunoMine
I'm working on creating my first mod. It will be a simple knot. I want you to help me because I believe it is simple to many, but I'm getting it.

[spoiler=Situation of the mod (atualment)]
information of folder:
|-minetest-0.4.7
|-mods
|-caixa
|-textures
|-caixa_simples.png
|-depends.txt
|-init.lua
__________________________________________________________________________________________
init.lua
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
01|-- mods/caixa/init.lua
02|
03|minetest.register_node("caixa:caixa", {
04|    description = "Caixa",
05|    tiles = {
06|        "caixa_cima.png",
07|        "caixa_baixo.png",
08|        "caixa_direita.png",
09|        "caixa_direita.png",
10|        "caixa_fundo.png",
11|            { name="caixa_ligado.png",
12|              animation={
13|                type="vertical_frames",
14|                aspect_w=1,
15|                aspect_h=1,
16|                length=20.0
17|                  }
18|             }
19|    },
20|    is_ground_content = true,
21|    groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
22|    drop = 'caixa:caixa',
23|    legacy_mineral = true,
24|})

_________________________________________________________________________________________
depends.txt
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
default

[/spoiler]

PostPosted: Mon Nov 25, 2013 00:21
by BrunoMine
At the moment I have the following goal:
The item "caixa:caixa" should be dug as the "default:wood"

PostPosted: Mon Nov 25, 2013 01:06
by VanessaE
in your node def, put: drop="default:wood",

PostPosted: Mon Nov 25, 2013 01:13
by LionsDen
I think he means it should behave the same as if you were trying to dig a default:wood, not dropping a default:wood.

PostPosted: Mon Nov 25, 2013 09:03
by rubenwardy
Do you mean the choppy group?

PostPosted: Mon Nov 25, 2013 20:23
by BrunoMine
LionsDen wrote:I think he means it should behave the same as if you were trying to dig a default:wood, not dropping a default:wood.

Correct!
rubenwardy believe is right too!

PostPosted: Mon Nov 25, 2013 20:29
by BrunoMine
What should I change on line 7?

PostPosted: Tue Nov 26, 2013 06:33
by LionsDen
Well, default:tree has the following line for it's groups.

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
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2}


I would suspect you want it exactly like that or mostly like that.

PostPosted: Tue Nov 26, 2013 08:46
by rubenwardy
The depends says defalt when it should be default.

PostPosted: Tue Nov 26, 2013 15:46
by BrunoMine
LionsDen wrote:Well, default:tree has the following line for it's groups.

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
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2}


I would suspect you want it exactly like that or mostly like that.

Perfect! Thank you!

rubenwardy wrote:The depends says defalt when it should be default.

Concerted. Thank you!

Next mission:
Can I delete the line 9?