Final Year Development Blog 11 - Final Day 1 and Day 4 Script, Simulation Maze Level and Making a To
- Jay Patel
- Apr 8, 2018
- 4 min read
First I will link you to the final script I have cut out Days 2 and 3. I have added bits to Day 1 and changed some sequences in Day 4 to better reflect what I took away from testing. Here it is
Here is the design Sketch for the simulation maze


This is the finished maze in game. I decided to have the middle as a square because this would be the point of return for the player after every subsystem has been fixed. This is the place where the End Level Portal will spawn. I have also made the floor all one mesh this is so I don't have any collision issues.
I will begin to show you how I made the top down shooter. I started with 1 thing. I made an Actor called BaseCharacter this will house the Health variables that Chrissy and the 2 enemies will use.

This is the Calculate Health Function in the base character. Here we are simple adding the current health to the Health variable and setting it as such.

This is the Calculate Dead Function in the Base Character. This is simple if health drops to 0 or below then it will set is dead to true otherwise it will remain false.

Now we will set up Chrissy, we will choose the Base Character as an actor when choosing your blueprint. You will then put in the mesh you want on the right hand side and the second thing you want to do is in the componant area you want to put an arrow where you want the player to shoot you want to put a capsule collider so that enemies can hit you. Finally you want to put Camera boom and then attach a camera to it.

In the event graph the first thing we are going to do is to set up what happens when the player dies. First we check Isdead, if true then we unload both levels, the 8SubsystemsLevel and the Subsystem Maze Level. Then we load the 8SubsystemLevel because that's where we've started the level we then teleport the player to the coordinates you want and finally set the health to full. the wonderful thing about using Level Streaming is that all the progress you have made has been saved.

The Next thing we are going to is set it up so that when you move the mouse around the player will rotate with it. what we are doing in the above is every tick of the game there is a line trace happening under your cursor as soon as the cursor hits something the character pawn which in this case is the player will rotate towards the cursor.

This is simply so that the can move using the WAS and D keys

We are now going to set up the Enemies. We are first going to set up one enemy then duplicate it for the 2nd. So first you create the blueprint same way as the player except this time you will put in the enemy mesh on the right hand side. In the component tab you need to bring in 2 things. a capsule collider so that bullets can hit the enemy and the final thing you want to put in is the Pawn Sensing Component. this will allow the enemy to sense the player and attack it.

To make it so the Enemy damages Chrissy on collision we first make a custom event thats says affect health on Chrissy and connect the Damage Variable and put in the damage how you want.
Then we create a actor begin overlap cast it to Chrissy so that she is the only one that will be effected then we set the timer to looping final on actor end overlap we simply clear the timer.

Here similar to Chrissy when the Enemy dies we change the material to a green version to show that the enemy has been "fixed" we then destroy it.

Finally we have to sort of the AI we first create a custom event called TrackPlayer int his custom event we simply tell the enemy to move to Chrissy. Then on the Pawn sensing and hearing we simply play the custom event. Everytime Chrissy gets in range the enemy will start chasing.
We will now create a Bullet to kill the Enemy0 we will call this Bullet1 because 1 kills 0 and vice versa.

I created a simple 1 in 3ds max and made blue emissive material and added a point light to make the 1 glow.

In the event graph we first make sure the colliding object has an Enemy Tag if this is true then we test if we are colliding with a friendly if not then apply damage then destroy the object.
Finally I will duplicate the 1 and change the mesh to a 0


The final 2 things we have to do is to set the firing of the 2 bullets. First we create a custom Event that will spawn the bullet actor at the fire spawn point and play a sound. We then create another 2 custom events called Pull Trigger and Release Trigger in Pull Trigger we do a do once so that it only fires once per button press then we play the custom event in the release trigger we clear the custom event.

We simply do it again but for the other bullet.
And there we have it top down shooter done.
Comments