Getter Functions: A New Approach


I'm Back

After taking a lazy Friday and skipping Saturday altogether, I was surprisingly motivated to work on the game again. My small change on Friday really did "fix" my anxiety issue. And it helped to step away for a day to go out with friends. It was a bit of a different experience than our usual. We all met up at one friend's house for a simple homemade brunch. Delicious and fresh made English muffins with bacon, egg, and cheese. I'm salivating just thinking about it again.

Afterwards, we took a small road trip, to a gas station. My first ever time at Buc-ee's! It was all I expected and more. The place was a bit bigger than I imagined, and I really didn't expect quite what was there. I ended up buying a plush as a gift and some fudge for myself. It was one of their samplers, the only one I've tried so far turned out to be key lime and it was heavenly. But enough about that, what about the game?

What I'm Doing

I jumped in early today, haven't even had breakfast yet. I still have leftover, homemade English muffins *squeeee*!! I started out simply and added the first little bit of functionality to the button, gotta clear the text on display before we update it. Then I tried to figure out the best way to get certain pieces of data from my dialogue and quest systems. I had left myself a note, so I dove into that, added a new function to my quest manager.

This new function will accept an NPC ID and return true or false depending on if the specific NPC ID is found as a quest objective in the active quests. Pretty simple, but it will make my validation checks easier. No need to write all that out every time I do this. And that got me to thinking about my issue drilling down into the quests and dialogues. My definitions don't have to be static, I can change and update them. They can have their own internal functions too.

So that's what I did, I created a new function inside my dialogue definition that returns a specific talking point dictionary based on the ID. Why write that code out every time I want to access it, when I can build a function right into the dialogue definition itself to just give me what I'm looking for. And the same goes for quests. I did something similar, I added a function to my definition that returns a string, either the specific quest dialogue I'm asking for, or nothing if it's not valid. 

What's Next?

This is great, now I have my quests and talking points displaying data in my dialogue system. The last real piece of this puzzle is going to be dealing with the completed objectives and quests. As it stands, the quest definition supports multiple objectives per quest. But my quest manager isn't fully prepared to deal with multiple objectives. 

And, as it turns out, my savegame manager doesn't actually save quest data yet. I knew I was going to have to dive into the savegame manager soon, there is a lot to be done there. But, first I gotta get my quest information prepped and ready for saving. Luckily it should be a pretty simple change to my quest manager. I just have to modify the way it handles its data, a simple change to a dictionary or something. I added a couple of comments as reminders for later, committed my edits, and that's it for today!

Edit: 

Just wanted to add another note here about what comes after. I make these dev logs as much for me as I do for you. This is a place I can make notes for later and hopefully come back and take of them. So, I want to finish dealing with the quests next, address the objective completion. Make sure the quest related functionality works, at least to a certain point. Then dive into the player skin issue, add that data to the playerstats manager, and prep it for saving. Then I want to work on implementing a basic save/load system for my city/building states. Then I will finally dive into the changes I need to make to my savegame manager. 

Leave a comment

Log in with itch.io to leave a comment.