Posted March 15, 2024 by PestoRavioli
So over the last few days, I have spent a good chunk of time after work trying to figure out how to get the character's name to carry over from the name entry screen to the game and consequently to the continue/load screen after saving. GB Studio is interesting in that just like low level programming for the game boy, it has a lot of limitations. Primarily using languages like Java / VB / Python in the past, handling text entry here is quite different. In a nutshell, selecting the letters on the screen is picking a location on a predefined gride. Based on the cursor location, I assign the ascii value (here is a handy dandy cheat sheet) to a variable. This variable when called to display on screen has a few behaviors. If you just call the variable itself, it will print the numeric value stored in the variable; however, if you call it in a dialog/menu box using the format "#xx#" where the xx is the reference number of the variable, it will print out the corresponding ascii value. So for instance, I have a variable named "$nameLetter1". That is the 17th variable I've used in the global variable list. So if I populate $nameLetter1 = 65 and then in a dialog box type #17#, it will display the letter A on the screen. It's convoluted as all get out and pretty limited, but it was pretty satisfying finally figuring out how to accomplish this task.