So I am now currently trying to figure out how to make a task that spawns AI at a certain location. This happens when an already existing AI reaches to that point, kinda like how a pawn calls for reinforcements of the same class at a certain location. The issues I’m thinking of are.
How to have the spawned AI pawns at that location change boolean values in order to not run the behavior tree immediately on spawning. In other words, instead of pawn patrolling like normal, on spawning, the pawns are immediately set to attacking the player and thus running a different branch of the behavior tree on spawning.
How to not have the spawning AI pawns crowd at the location at spawning. I need to spawn like 2-3 pawns at that location once some other pawn reaches to that location, so I believe that may lead to some crowding issues.
Below is an image of my progress. Do note that they haven’t been tested but at glance I feel that it wouldn’t behave as intended.
The first foreach loop is a mistake; I left it in while debugging, just imagine it as a for loop for 3 times. The main point is the spawning location, where actors will spawn. On for loop completion, each pawn would have their blackboard boolean value set to true before they get a chance to run the behavior tree branch for patrolling, and instead run the branch for attacking.
I don’t believe this would function as intended because I believe on spawning, the AI pawn would already begin behaving like a patrolling soldier and won’t enter attack mode unless triggered normally, which isn’t what I want.
Please, any help is appreciated. Thanks.