Data Manager: String Formatting


Another Day

Today I started working on the game again. I actually spent time working on it mentally while I was walking to and from the grocery store. I decided to actually do more coding work and began the build out of my text substitution wrapper for the translation function. It's very simple, I just replace every instance of the translation function with this new method I've whipped up (with the help of Gemini). It took a few iterations but eventually I got what I wanted (I hope). 

The first issue I had was that I didn't necessarily want to store actual values in the dictionary, but instead references to dynamic data. That posed an issue with using a simple dictionary for this, though that is what I am using. I went with something I learned about previously, when I built my debug overlay, the Expression class. Now I can store a simple string, or store a reference to a callable function somewhere in my game. 

Of course, I haven't actually tested it yet. I built it out, added a single entry, and that's it. Tomorrow (or whenever the next session is) I will put it to use and test it. I'm sure there will need to be some fixing, but it looks good for now. I actually had to tell Gemini about a stupid error because it couldn't even get the "format" method call correct!

Next Time

As I said, I will actually test and implement this new function. After that I'll probably dive into my dialogue system again to make some changes to talking points. I need to add conditional talking points, similar to my conditional greetings. But that's an issue for another day!

Leave a comment

Log in with itch.io to leave a comment.