top of page
Search

Would You Like to Continue?

  • Writer: jstndasilva
    jstndasilva
  • Jun 21, 2021
  • 1 min read

This was our final week to add anything new to the game. One thing we tried before but couldn't really figure out at the time was saving the player data throughout a run. The data would be the player's stats/attributes, the weapon they had equipped and any abilities they picked up. The problem that the team had before was saving the weapon which was an Actor meaning it had to be spawned in the level. They would try to save a pointer to that object, but because the Actor was spawned they were saving a reference to the instance of the object in that level which would be destroyed when the player moves to another level, so nothing would be saved.


After giving it some thought I decided to give it a try and I was able to come up with a couple of solutions. I knew we didn't need the specific instance of the players weapon from the previous level because the weapon's properties would never be permanently changed throughout the play session. We just need to save a reference to the default object and the way I know how to do that is with TSubclassOf. I was able to store the players weapon at EndPlay of the previous level and then spawn and set the default object of the same weapon at BeginPlay when the new level loaded. Unfortunately this only worked in the editor and didn't seem to work in the packaged build. It seems to cause the game to crash. This is something we will have to figure out for the final week.

 
 
 

Recent Posts

See All
We learn from Our Mistakes

This was the final week of working on this project. I primarily try to fix the problem we had with saving from last week. Due to time...

 
 
 
Going Code Blind

Finding and fixing bugs is a part of programming, and some bugs are very troublesome to find the root of their cause. Often times I find...

 
 
 
Getting to close

The one main problem that I was mainly facing was having it to where the boss would leap to the player when doing his leap attack. Mainly...

 
 
 

Yorumlar


Post: Blog2_Post
  • Facebook
  • Twitter
  • LinkedIn

©2021 by C monkey. Proudly created with Wix.com

bottom of page