Blueprints: Enemies, Spawners, and Spawner Managers


I have added quite a bit of stuff that can seem overwhelming at first, but I will try to break it down into very simple terms for others, and even myself, to better understand! Also attached at the beginning here is a video showcasing all of this stuff in action!

ENEMY: Event Graph Blueprint


So in the first image, the code there is stating that, if the enemy is hit by an object, and that object is the player, it will wait one second before dying, while also saying something upon being hit. The second image shows the rest of the code, where it states that, after that one second delay, the enemy will then die and disappear, as well as tell the spawn manager that it is dying and to do an enemy check for the amount of enemies in the level still.

ENEMY SPAWNER: Event Graph Blueprint


The first image shows a code that will spawn enemies on the enemy spawner sphere. It will spawn on the sphere, as well as face in the direction of the invisible arrow that can only be seen in the viewport of the sphere. The second image shows some code that allows the enemies to spawn, and forces them to spawn between 0.5 seconds and 3.0 seconds. After this randomly generated delay, the enemy will then spawn!

ENEMY SPAWN MANAGER: Event Graph Blueprint



There's a lot of code in the spawn manager, so I will break it up a little more than the others. The first two images show an enemy wave check, where the game is trying to tell if there are still enemies in the level. If the amount of enemies is more than 0, the game will do nothing, but if the enemy count is at 0, it will spawn a key on the body of the last enemy that was killed.


This code above very simply states that the spawn manager is active, as well as determines how many enemy spawners are in the level and, therefore, how many enemies will need to be killed before grabbing a key.



This final bit of code is for the respawning of enemies. After all the enemies have been killed, this code activates. It will wait for seconds before trying to respawn all the enemies on their spawners. This is done by using the "for" loop as seen in the first image. How this works is that it loops through the respawn command until all of the spawners have enemies that are newly spawned in, and then it comes out with the "New Wave" message, as well as a message that plays letting the player know that all of the enemy spawners have been activated.

And that is it for this dev log! A lot of stuff going on here, much more intense than the previous door and key codes, but still really fun and interesting. 

Get Coding-One

Leave a comment

Log in with itch.io to leave a comment.