I've always wanted to learn how to make my own plugin in RPG Maker, so I decided to finally take the leap and figure out how it all works! This was a side track from a little creature collection game that I was experimenting with for a couple of days.
So to start, I read through the official RPG Maker plugin guide (using Google Translate since it's in Japanese) and learned some of the basics. While I didn't learn how to actually write my own plugin with reading it all the way through, I did take a lot of notes and now have a better understanding of how some of the structure works. It also helped me try and wrap my head around objects and classes, since those are always programming concepts that feel a bit abstract and I haven't fully used in my own projects (outside of the built-in objects from the RPG Maker Database).
I started by just making basic plugin parameters and making it all show up in RPG Maker, even if it wasn't really doing anything yet. Generally, I was just understanding parameters, their types, and basic structure.
Then I started to dive in and just start looking things up as I made my own plugin. I wanted to make a party manager plugin that deals with Windows, because those aren't easily editable through events or scripts. So I started with this forum post to use as a reference point for learning how to make a basic window where I could select options. It was a basic list with functions and handlers.
I was learning about setting window positions and then also figured out how to make fields editable and connected to the Plugin Manager in RPG Maker. So I was able to reference parameters that I set within the code itself. This included loading scenes, specifying images, etc.
From there, I learned about referencing specific RPG Maker events and objects from the database. Because I wanted this to be a party member manager, I had to get the party member data. This led me to working a bit with scoping because I had to make a function with the party member data that I could reference in all of my windows of the scene. So I stored it in an array.
Then I started to work on the window itself. I started with a command list that listed all of the party members by name from the database. Then I played around with some of the box sizes so I could fit face graphics in there. This led down a path of learning about how to show graphics in general. I was having some issues getting them to show up, so I preload them at the start of the game. Then, I also had to figure out how to use the built-in itemHeight(), itemWidth(), and maxCols() functions to change the size of those boxes to how I wanted them to display.
Then I decided to start working on what happens when you hover over a character. I wanted some kind of stats screen on the side so you can view their stats. So I made another window, but this time I called the window functions without the handlers to essentially load the data of the current actor you're selecting. Then I added stats like their name, an image, attack, etc.
The next day, I spent a few hours figuring out how to convert RPG Maker variables (and arrays) to be properly used in a plugin. It involved preloading the data after the scene is loaded, but was a lot more complicated than I was expecting. Then from there, I made the next window: the character window below. The main reason I needed an array is because I need to store all of the characters somewhere that's not the party members because it can exceed the number in the menu. So I wanted somewhere to store those actor IDs. It took me awhile to get that extra window showing up simultaneously, but I eventually got the faces to show up in a separate window. They had to be in a separate window because the size of those differed from the party so it also took some time to figure out getting the player to be able to move from the top window to the bottom one with the arrows.
I'm still working on this plugin and plan to continue adding more functionality so I can use it in my games. This was a fun challenge to start my pathway down creating my own RPG Maker plugin! I'm happy with what I have so far. Though this one isn't finished, I did manage to complete my own full plugin after this that you can read more about here. I'll come back to this plugin in the future, but it's a bit more complicated and has more parts to it, so it's taken more than a day like the other one did. I'm learning a lot and having fun with it!








No comments:
Post a Comment