How to pair 2+ of the same AI pawns together?

I have a stationary AI Pawn behavior tree set up and it works as I expect. However, I want to see if I can pair 2 or more of these pawns together. Not necessarily in the form of “pairing” them to move together and stuff, but pairing them as in getting them to perform the actions and behavior of a stationary guard AI pawn while sometimes look like they are talking to each other.

In this project I’m helping on, I want to see if I can use the same soldier blueprint and behavior for both single and paired up guard soldiers, with the single ones performing the behavior normally while the pairs do the same thing while sometimes look like they are talking to each other. Don’t worry about how the talking or behavior happens; I just want to know if this is possible to get paired up soldiers to do something unique compared to single soldiers of the same class and behavior. Thanks.

So personally I would suggest just having a behavior in all soldiers that triggered them talking to each other sometimes based on proximity.

However, to do what you’re asking - the simplest solution would be to have a branch of logic in the soldiers behavior tree that deals with the conversation behavior you describe. Then, place a simple Blackboard decorator node on the root of that branch that is set to look up a bool value in the blackboard. What we are doing is ONLY allowing that behavior to run if you’ve set this bool to true.

43768-capture.png

What you would then most likely want to do is set this variable on initialization from the character blueprint, that way you can expose a value there that can be set from the editor.

Note that Flow Control is set to abort the sub-tree when the value changes. This isn’t strictly necessary, but it does mean that you can change the value at runtime to stop the agents from talking - which you will probably want to do if the player attacks them.