Part 6: Texts and Dexes
While I was implementing the graphics and story, I quickly realized that I needed some sort of text engine in order to have dialogue. On top of this, I needed to have a way to check for conditionals, control sprites, and activate different aspects of my program. After doing some research on game text engines, I learned that they’re often implemented through a linked list of sorts. I ended up implementing it through an array of script objects. Each script object has a dialogue string, a pointer to the next script object, and optional conditionals or commands. This way, I am able to implement everything I need to in an organized and simple way.
My custom script_obj class
The next thing that I wanted to add was a Pokédex that kept track of all the Pokémon the user had transferred using the program. That way, I could reward the player when a new Pokémon was transferred, and eventually add in a reward for collecting all 251 Pokémon! Implementing this was fairly easy, but I needed to find somewhere to store all 251 flags. Fortunately, one of the save data sections, specifically the second section containing Hall of Fame data, has 1936 bytes that go unused. This was the perfect spot for me to store my Pokédex flags! This also meant that each game connected to the program would have its own Pokédex data. Erasing the game’s data also will erase the data for my program, which is exactly how it ‘ought to be.
Fun fact! The Pokéball icon is actually part of my custom font!
This section was a bit smaller than most, but I promise that won’t be true for the next one! It’s Mystery Event time!