Degree Project: Checkpoint Systems

 This blog is a walkthrough of how I made a Checkpoint System today, with much help from Jay, which saves the Player's location in a level when they die so they do not have to restart at the beginning each time. The reason why I couldn't really use any online tutorials was because I already had a death screen and most checkpoint systems on Youtube involved destroying the Player Actor and respawning essentially a new one in. My death system which I created depended on the actor being altered into a "death-like" state and not outright destroyed with all the data they were storing so I had to do it a different way.


First I created this pad with a collision box, fairly simple stuff.


When the Player overlapped with the collision box, it would cast information of the location of the Checkpoint to the Player and the Gamemode (Which was not needed as well as the Player but it is there incase something goes wrong)




I then created this function that would be activated upon interacting with a retry button on the ui for the pause screen and death screen menus and essentially it reverses all the aspects that put the player in the death state. It sets the health and stamina to 100%, it removes the IsDead? Boolean Variable, it enables inputs from the keyboard to be registered, it unpauses the game, then removes the UI elements, then removes the mouse cursor and then finally transforms the player to the checkpoint pad.



This is the Functionality for the Pause Screen once again, this time with an added respawn button which moves the player to the previous checkpoint. If the player is yet to touch a checkpoint, they are transported to coordinates 0, 0, 0 which can sometimes brea levels so to fix this the player automatically starts on a checkpoint in every level.



This is the death screen ui widget. The reset button is attatched to the Reset Player function shown above and executes that script upon pressing it.




The HurtTile_BP, which is used for areas that cause damage and the Lava, was somehow broken by these changes too and I do not know why, though I was proud of this Blueprint so it's a little sad to see it go. Thankfully I could just repurpose the HealTile_BP and copy it, while reversing the healing value to apply damage and remove the stamina regenerating effects, making a more efficient version of the hurt tile.






Comments

Popular posts from this blog

Degree Project Digital Media Analysis

Professional Practices 4

Degree Project: Gameplay Test Footage