How do I make multiple ai play a sound cue? (Problem)

Say a group of 4 AI are following each other. One man dies, Only one guy should say something, but instead for me, all of them say something. And for bonus cookies, maybe one other guy should reply, but again, they all say the same thing. (How do you make AI reply to each other?) It sounds kinda dumb, but I like having these kind of AI. (Yeah I know, the question title doesn’t really follow along with this)

Oh, okay. So it was actuall real simple, but i setted up (this is not the die sound) in the behavior tree, so when the ai is in its attacking state it would play a sound (yeah that simple), however what I need assist on, is how to stop making all the ai (using the same behavior tree) play the sound, but instead only wanting one ai to play it. I am quite new to the behavior tree thing.

as for the reply thing I have no clue. :smiley:

How are you executing the sequence which makes them play the die sound? You could make bots reply to each other a few different ways. I would like to understand how you are currently setup so that I can better assist you.

Peace

oh my bad

![)

this should be it

I need you to show me exactly how you are doing it. Show me some screenshots of the steps it goes through in-order to commit this action. Thanks!

I think you can give each AI like index number 0 to 3, when 1 die for example 0, you random number index 1 to 3 who will talk first, say 1 will talk, then the next one say will be random between 2 or 3. You can keep track who just talk then skip him for next conversation.

Thanks for all replies, I’ll try this now!

oh, one more thing, what do you mean index numbers? Like, is it in blueprinte scripting, behavior trees, because I haven’t doen any kind of indexing in unreal, or atleast haven’t seen it

Sorry, yeah I know its too much to ask but, how do I make ai follow other ai?

yeah I said that, but it does it too both, I DID have a dying sound, but then I deleted it for no reason, but either way, I had the same problem with both.

This seems to play the sound when they attack. I thought you were saying they all played a sound when one died?

Thanks for teh help !

Also, about the death thing, I forgot how I made the AI play the sound when thier “friend” is dead. I searched a hole bunch of fucntions in blueprint, but nothing I remember, could you possibly help me on that ( I understand if you don’t have time or don’t want to, and please, if you do decide to, do it on your free time please, don’t like rushing people…)
edit I just remembered, you said something about AI replying to each other, maybe you could tell ME YOUR SECRETS :smiley:

If your AI finds an enemy, it continues playing the sound you put within the behavior sub tree. To have them play at different times they would theoretically have to start attacking the enemy at separate times. If they’re next to each other, they’ll likely find the enemy at the same thus play the sound at the same time. Now even though they all use the same behavior tree, they all use separate instances of the information. Its not possible for one to manipulate the other by default.

The solution is creating some randomness. A simple way is to add more Random Deviation to the service that controls your A.I. Another is to create a task similar to wait with variables that will randomly delay a sequence.