Dynamic Text Menu for GB Studio 3
This is a dynamic text menu for GB Studio 3.
It mostly uses GBVM, so you might need some understanding of it to be able to use this. In a nutshell, what it does is:
- Copy the border from the background to the overlay.
- Check the variables Slot1 to Slot6 (which contain the type of item) and copy the appropiate item entries to their correct place in the overlay.
- Write the variables Slot1Amount to Slot6Amount as regular text (there's a font for this that hides the 0 and 1, in order to prevent empty or non-stackable entries from having a number), move the overlay to a visible place and make a menu.
After this, there's another GBVM script to copy the current selected item to the variable CurrentItem, to make handling it easier. Then, there's what the game will do when you select something.
It's pretty customizable as long as you know what to do. The most important commands you need to know are in the Change Entries section of the Battle Item Menu custom script. A Loop For is performed, which includes the VM_OVERLAY_SET_SUBMAP_EX command, that's used for placing parts of the background (the items) on the overlay. This specific command uses arguments stored in stack (pushed by VM_RPN and VM_PUSH_CONST) for parameters, so we can use the loop variable to set the slot and the position of the text.
Another important part is the Finish Menu section, that includes VM_CHOICE, which converts the overlay into a menu. You might want to change the number at the end, which specifies the number of choices, and if you're going to change the number of variables, don't forget to also reflect this in VM_LOAD_TEXT (number of variables), .dw (variables) and .asciz (font, position and variables).
I suggest checking this, exporting data to see what regular events spit out and also the #gbvm-help channel in the official Discord server for more info. It's hard to explain everything with one paragraph and my knowledge.
Also, credit is not needed, but it is appreciated!
Comments
Log in with itch.io to leave a comment.
Assuming Z = B, X = A, Enter = Start and Shift = Select.... no matter what I pick, it just says "This might work" or "This is a bad choice" (even picking Exit says this). Unsure if this is how it's supposed to work in the example :)
Yeah, I fixed it in the .zip, but not in the browser preview. I'll reupload it, thanks :)