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

Post Reply
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 » Post

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: 1035
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 » Post

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

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

by L22 » Post

Okay, thank you. I'll try those.

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

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

by TenPlus1 » Post

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 » Post

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

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests