I’m trying to make an AI area spawner, with plans to place down multiple of them in one level, but only one can be active at a time. With each one having set conditions on how to complete them.e.g how many ai are left alive or sub objectives. Then moving on to the next area. When all area’s are completed it loops back to the first one.
How could i achieve this?? I want to learn it, but also tempted to just paying someone to do it.
to learn it you only need basic familiarity with blueprint and general programming logic.
But if you don’t have any of that, it could take you months to get there.
If you have a very clear checklist for what exactly the rules of spawning are, probably any intermediate blueprint coder could complete it in a work day or two.
Though it is simple coding, it is too much to demonstrate in a forum post and there are a lot of questions about your specifics that would need to be answered first.
If you want to learn I’d just search youtube for “spawner unreal” and you’ll find dozens of tutorials showing various techniques. Just whizz through all of them until your own plan starts coming together.
Ok I understand multiple ways to spawn the AI, and it ticks off one of my boxes. But i need to know how to spawn and despawn actors, using a vector array. The reason why i mention vector array is because I want them to be spawned at certain positions
So if you have an array you can do a for each loop, and then for each vector do a Spawn Actor From Class.
On the Spawn Actor From Class node there will be a spawn transform variable exposed to plug the vector into. You can also do a Debug Sphere and use that location as well to make sure it is working correctly.
Got it to work. It destroys the spawner and spawns a new one. Buttt running into a new road block on how to set a condition for the actor on how many ai are left around the actor.
Just got to think of a way to get how many ai are left around an acotor, after ppl have killed a few.
after the spawner spawns a new actor you can store reference to it in an array.
also pass a reference to the spawner to the new spawned character.
when the character dies, have it let the spawner know (using reference to it). Then the spawner can remove the killed character from the array, and you can get the arrays length to know how many are left.
You can think of it like the spawner is squad leader, and each memeber in the squad gets a radio. If something important to them happens, they let squad leader know.