TenPlus1's MobAPI: How do I add more sounds to mobs?

User avatar
L22
Member
 
Posts: 33
Joined: Fri Jan 18, 2019 03:56
In-game: L22

TenPlus1's MobAPI: How do I add more sounds to mobs?

by L22 » Sun Feb 03, 2019 05:32

I have a mob that I want to have make more than one noise, but these lines of code only use the noise "steve_call" and not "steve_sound"

sounds = {
random = "steve_sound",
random = "steve_call",
},

How do you give a mob multiple noises?
 

User avatar
Napiophelios
Member
 
Posts: 982
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: TenPlus1's MobAPI: How do I add more sounds to mobs?

by Napiophelios » Sun Feb 03, 2019 06:10

I think these are the only ones in the API, not sure:

random
war_cry (when mob attacks)
shoot_attack (when mob attacks with projectile)
damage (when mob gets hurt)
death (when mob dies)
jump ???
 

User avatar
L22
Member
 
Posts: 33
Joined: Fri Jan 18, 2019 03:56
In-game: L22
 

User avatar
TenPlus1
Member
 
Posts: 2610
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: TenPlus1's MobAPI: How do I add more sounds to mobs?

by TenPlus1 » Sun Feb 03, 2019 10:30

Code: Select all
'sounds'               this is a table with sounds of the mob
      'distance'          maximum distance sounds can be heard, default is 10.
      'random'            random sound that plays during gameplay.
      'war_cry'           what you hear when mob starts to attack player.
      'attack'            what you hear when being attacked.
      'shoot_attack'      sound played when mob shoots.
      'damage'            sound heard when mob is hurt.
      'death'             played when mob is killed.
      'jump'              played when mob jumps.
      'fuse'              sound played when mob explode timer starts.
      'explode'           sound played when mob explodes.


Note: to play more than one sound for each, name sounds like so: mob_cow.1.ogg mob_cow.2.ogg mob_cow.3.ogg etc. and minetest will choose one at random to play (we do this for chickens).
 

User avatar
L22
Member
 
Posts: 33
Joined: Fri Jan 18, 2019 03:56
In-game: L22

Re: TenPlus1's MobAPI: How do I add more sounds to mobs?

by L22 » Sun Feb 03, 2019 19:57

Okay. Thank you. I added some of your suggestions to the code, and my mob now makes multiple sounds.
 


Return to Modding Discussion



Who is online

Users browsing this forum: FireAlphaT, MSN [Bot] and 2 guests