Work Based Learning - 06/02/2019 (7 hours)
Continuing with the tower defence tutorials I finished the tower upgrade blueprint and starting working on auras, I wasn't sure if we were gonna use this but I decided to continue and create them anyway to see what it would do and to see if the group want to use them. Basically it is an effect that can slow, damage etc. overtime whilst the AI runner is in the range of the tower. We will adjust the projectiles, sound effects and the particle effects to suit which level we're on.
I asked Casey another question to explain in more detail and I asked him if there was a way to create three spawn locations with one spawner. Here's what he replied:
He has explained that there is a way, but I couldn't really understand how to set up a handler for a spawner, so I did some research on websites and you tube and I couldn't find a specific one to use for the purpose I needed, the reason we needed three spawn locations is because on the level design map Sam has drawn there are three separate lanes leading into two and then eventually into one reaching to the castle.
After researching and not finding much on what I needed I asked Sasha if she knew a way to set it up, we had a couple attempts before we got it working.
This is the different spawn locations code that is set up in the construction script of the spawner blueprint, this allows there to be three spawn locations by having the spawner attached with three cubes and that is where the enemy will spawn from.
I didn't know what an add unique node was so I searched it up so I could understand the blueprint more. I got an explanation from the unreal engine website. An add unique is an array finding node and if it doesn't find copies of the value it will add it to the end of the array.
The first attempt that went wrong was that it was spawning in three different locations but it wasn't taking the data from the data table it was just spawning 2 each lane when it should have been 5. I asked Sasha if she knew how to fix this because she helped me edit the preview code and got that working. Here is what she said would work, we added a for each loop node, a get spawn points and changed it to an array and got the actor location. This means that its finding the spawn points and looping the AI runner to spawn at the location we placed the cubes.
The next I did was added a slow effect to the tower radius so that the AI runner will get slower as they walk through the range of the tower. For this we made a run speed, slow radius and slow effect variable onto the tower data table. I added a set run speed node onto the wave spawning blueprint.
This is the slow effect blueprint, which allows the player to slow down whilst inside the towers range. I think this is a practical mechanic to include because then it would be easier for the player to kill all the skeletons to then get to the next wave and also because I think it's better than just having the skeletons slow all the way through because the player might get bored if the game is super slow.