How do I define my own group?

drkwv
Member
 
Posts: 67
Joined: Thu Jun 28, 2012 13:48

How do I define my own group?

by drkwv » Tue Jun 24, 2014 20:46

I need to create a block that:
1. is diggable by bare hands
2. but sounds like a stone upon digging (like a stone that is being digged by axe)
3. and has some custom crack pattern (if that possible)

Probably I need to define my own group for this, but how do I do this? Maybe there is some mods that have custom groups I can look into?
 

User avatar
RHR
Member
 
Posts: 214
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

Re: How do I define my own group?

by RHR » Tue Jun 24, 2014 21:11

You do not need an own group for that:

1. is diggable by bare hands
oddly_breakable_by_hand = 3

2. but sounds like a stone upon digging (like a stone that is being digged by axe)
has nothing to do with tool, just use the stone sound:
sounds = default.node_sound_stone_defaults()

3. and has some custom crack pattern (if that possible)
change the crack_anylength.png texture to your custom crack pattern.

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("YourModName:YourBlockName", {
   tiles = {"YourTexture.png"},
   groups = {oddly_breakable_by_hand = 3}, -- or: groups = {oddly_breakable_by_hand = 3, choppy = 3},
   sounds = default.node_sound_stone_defaults(),
})


Please post your future modding questions here:
viewtopic.php?f=9&t=4668&p=146064#p146064
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

Re: How do I define my own group?

by Calinou » Sun Jun 29, 2014 18:07

Only one crack pattern can be used at a time; it's currently not possible to change the crack texture based on the block being dug.
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 7 guests

cron