Jump to content

The First Step to Progression


Oafkad

Recommended Posts

  I had a bit of great fortune today. I spent most of the day playing BG3, only to find out that Minthara bugged on my run and isn't actually available at Moonrise Towers. I'm debating if I want to go back and see if I can get her to actually be there. But I digress, I played for much of the day and realized I still wanted to keep my momentum with my work.

  So I set out to make the inventory save and load. This initial hit a hurdle because I had included my inventory artifact within the player info class. This is a problem because our serialization strategy does not like when we save a scriptable object. I realized that a simple solution for this was moving the actual artifacts to my player handler, where it can assign them all (currently) on awake. Then the player info remains a very simple object that contains only other classes.

  It is treated as something of a network to access anything related to the proper healthy function of the player. I made those few changes, picked up a debug cube, and saved. It generated my bytes file and then I reloaded the game from scratch. With a bit of trepidation I pressed the load button hoping that I'd see that 0 turn into a 1.

    What you don't actually see is the player also moves to their last known position when I load. This was another bit of work I've tested out. The good news is that this saving and loading will scale to however many items we create going forward. Now that it works with one item it'll work with 100 different kinds of items.

  The initial foundational work of any project is not glamorous. But it is pivotal for being able to do the fun part of everything. I believe one of the upcoming projects I'll need to tackle is the dialogue system. This will be a rather large undertaking and I'm not sure if I want to do it now or, knowing that I know it is doable at any time, start doing other fun things and come back to it.

  I'll sleep on the problem and I suppose we'll see what my decision was with tomorrow's update.

 

Link to comment
Share on other sites

×
×
  • Create New...