Page 1 of 1

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

PostPosted: Sun Feb 03, 2019 05:32
by L22
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?

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

PostPosted: Sun Feb 03, 2019 06:10
by Napiophelios
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 ???

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

PostPosted: Sun Feb 03, 2019 06:27
by L22
Okay, thank you. I'll try those.

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

PostPosted: Sun Feb 03, 2019 10:30
by TenPlus1
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).

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

PostPosted: Sun Feb 03, 2019 19:57
by L22
Okay. Thank you. I added some of your suggestions to the code, and my mob now makes multiple sounds.