Refactoring Cutscenes: Part 2
After yesterday's debacle, I was wary about going back to work on the project. I wanted to continue where I left off, but it seemed like it was going to be a lot of effort to switch my cutscene from using its own hard-coded data to using the new cutscene definition. Luckily, it really wasn't as bad as I was expecting.
I started out by examining the current structure of everything surrounding my cutscene data. Everything that was hard-coded into the cutscene exists in the new definition, so the data is all there. But the format is different now, and I have to get a specific piece of the cutscene definition to play my cutscene. After examining the current structure, I popped into a chat with Gemini, gave it my files, and asked if my approach seemed correct.
As usual, it made a couple of incorrect assumptions, but I was easily able to get it on the right track. The actual change to the code involved simply removing the previous variable assignment (my hard-coded data). Instead, I start by loading the data from the data manager, into that same variable, during ready().
Of course, it is never as simple as it seems. Somehow, a "ghost space" ended up at the beginning of one of my lines of code, which threw an error. I didn't even notice it and had to ask Gemini to figure out why I was getting an indentation error. Once that was done, it worked! No big deal, surprisingly easy work.
But my translation wasn't showing, and instead I was just seeing the translation key. THIS IS WHY I APPROACHED MY TRANSLATION THE WAY I DID! Because of the way I approached my translation work, I was able to see quite clearly that I hadn't set my cutscene player up to localize. A couple of quick changes to the player script and now everything is peachy!
Of course, the refactor isn't done. There is still one BIG thing to do, and that's removing the need for the cutscene template, and rolling all of that into the actual cutscene player. That's tomorrow's work, because I know it's going to be tough. Anytime I mess with nodes I make mistakes, and then there's all the code I have to change, swapping variables, removing the need to instantiate a new scene, etc. I just hope it goes as smoothly as today!
Xenodochium
The future is what you make of it!
Status | In development |
Author | Munchmo |
Genre | Role Playing |
Tags | 2D, Cozy, Godot, Indie, Life Simulation, Pixel Art, Sci-fi, Singleplayer |
Languages | English |
More posts
- Refactoring: Cutscene Player Finale17 hours ago
- Refactoring: Cutscene Player2 days ago
- Localization: Finished, Terminado, Fertig, Tapos Na!3 days ago
- Localization: Digging Deep4 days ago
- Localization: A Return5 days ago
- Of Dragon Con, Debug Overlay, and Localization9 days ago
- Dragon Con: A Vacation11 days ago
- Dialogue System: Talking Points Go BRRRR13 days ago
- Dialogue System: Talk About It14 days ago
Leave a comment
Log in with itch.io to leave a comment.