Hi, I’m working on a Enemy Spawn system for a side scrolling beat em’ up and I’m trying to figure out how to make an actor take a set of actions before the AI controller takes over.
What I think I need is to pass information into a spawned actor from the SpawnActor node or barring that a method of how to infer this when an enemy is spawned into the world.
The main setup is
1.) A Battle Event actor that is a collision box checking for when all players overlap to start the battle event itself. It also holds a data asset reference with information about each “wave” of enemies I want to spawn for the event including
- Number of waves that will spawn
- what the transition between waves in (all enemies defeated or spawn next wave after a timer)
- a list of enemies to spawn in the wave that includes
- Reference to the class
- Where it should spawn (this is the main information I’m trying to get access to when spawning), left, right, top or bottom
2.) A battle event manager actor that listens for the battle event call from the battle event actors in the level
When the battle event sends the trigger event of “Battle Event Started” the battle event manager then handles a few things
1.) Ease the camera to the battle event area and lock it
2.) Set up level bounds so players can’t leave the screen area
3.) Set up information and remember information about the on going battle event (# of waves, current enemies, enemies defeated, etc..)
4.) Begin spawning enemies using said information
What I’m trying to achieve is, when an enemy spawns, it needs to set an animation (based upon position of the screen it’s coming in from, left, right, top or bottom) and then move onto the screen.
The hope here is you have the standard beat em’ up style of the enemy walking in from the sides before the AI controller takes over, but also can drop in from the top (like falling from a ceiling vent) or come in from the bottom (maybe they’re climbing up a cliff face the players are walking past)
I don’t think I can achieve having the “walk on” set of actions in the event manager as then each enemy would have to walk on one by one instead of all at the same time which is what I want.
I’m assuming that the best route here is in the begin play for the enemy to take in the passed in position and then switch upon what animation it should set (walking, falling, climbing) move onto the screen and then have the ai take control.
I’m just not sure how to pass in, upon dynamic spawn, the information for it to make that decision, so I was hoping I could get some help connecting those dots.
(I know I have the spawn default controller in the event manager, but this is left over from testing out solutions)