Developing a simple node

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

Developing a simple node

by BrunoMine » Mon Nov 25, 2013 00:19

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]
Last edited by BrunoMine on Wed Nov 27, 2013 12:45, edited 1 time in total.
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

by BrunoMine » Mon Nov 25, 2013 00:21

At the moment I have the following goal:
The item "caixa:caixa" should be dug as the "default:wood"
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
 

User avatar
VanessaE
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

by VanessaE » Mon Nov 25, 2013 01:06

in your node def, put: drop="default:wood",
You might like some of my stuff:
Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

User avatar
LionsDen
Member
 
Posts: 525
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Mon Nov 25, 2013 01:13

I think he means it should behave the same as if you were trying to dig a default:wood, not dropping a default:wood.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Mon Nov 25, 2013 09:03

Do you mean the choppy group?
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

by BrunoMine » Mon Nov 25, 2013 20:23

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!
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

by BrunoMine » Mon Nov 25, 2013 20:29

What should I change on line 7?
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
 

User avatar
LionsDen
Member
 
Posts: 525
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Tue Nov 26, 2013 06:33

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.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Tue Nov 26, 2013 08:46

The depends says defalt when it should be default.
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

by BrunoMine » Tue Nov 26, 2013 15:46

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?
Last edited by BrunoMine on Wed Nov 27, 2013 00:05, edited 1 time in total.
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
 


Return to Minetest-Related

Who is online

Users browsing this forum: No registered users and 19 guests

cron