RPG Maker MZ Plugins 101: A Primer on plugin structure
ฝัง
- เผยแพร่เมื่อ 8 พ.ค. 2023
- ---Transcript---
drive.google.com/file/d/15wrS...
---Links---
The UnproPro TH-cam channel: / theunpropro
VS Code: code.visualstudio.com/download
The AUTMOUSE_Learning.js File: drive.google.com/file/d/14MZT...
RPG Maker MZ Documentation: developer.rpgmakerweb.com/rpg...
RPG Maker Coding Reference: tkool-jp.translate.goog/mz/pl...
Welcome to my first coding tutorial focusing on the basic structure of a plugin in RPG Maker MZ. Follow along as we build a plugin that has examples of all the basic features, parameters, arguments, commands, and proper JavaScript doc formatting.
This tutorial will be most useful if you have a rudimentary understanding of JavaScript but little to know idea how to turn that knowledge to plugin making.
Thank you for checking out the channel and happy game making! - เกม
Nice tutorial, i always wanted to create my own rpg maker plugins for some specific functions that i imagined. I hope to learn everything I need to know with the next videos.
Glad I could help! Good luck on your project! :)
you are a saint 🙏
A note: You can replace "args" with anything. For example:
(params){
console.log(params);
}
Remember you must use inside the code, the same word you put between brackets.
True, thanks for giving it a watch.
Excellent tutorial, really breaks down the topic in a workable way.
For anyone who finds that their registered plugin command mysteriously won't run (i.e. fails silently) when called for in the event editor and invoked at runtime, one possible reason is that the plugin name has to match the .js file name it comes in, minus the .js. So the plugin defined in "MyNewPlugin.js" must be named "MyNewPlugin".
I was having that issue lol. I had to delete the event and remake it afterwards. Thanks!
This was incredibly well organised and easy to understand. I might be interested to pick up javascript again if I can extend rpg maker and I'm excited to follow these tutorials. I did watch on 2x speed but I could understand everything perfectly, going through it line by line was incredibly useful.
Thank you! I have been working on my game primarily lately but if you have any questions feel free to post them in the comments and I will try to answer them.
This was so helpful, I was making an item weight system, just a simple one but couldn't get it to work and realized I had quite a bit of structure errors in my code and this video got me to fix it correctly and get it going!
Just found your channel. Hi Penny! Thank you for this tutorial!! ^-^
Thank you for making this video! I've been wanting to get into developing my own plugins for a while, but didn't know where to start. I'm excited to watch more of your videos~
Glad I could help! I am interested in doing more plugin coding videos. Let me know if you run into any specific questions. :)
Really easy to digest and helpful. Thanks Penny!
I'm glad it was helpful!
Please add more plugin Videos! I want to know which plugins are available free or cheap.
This video is good. Most script tutorials on the Internet use RMMV as an example.
I find scripting in MZ to be much more intuitive. The two are relatively similar though.
This may be a bit nitpicky on my part, but ` is usually called a backtick while ~ is a tilde. They're on the same key on a US keyboard, though.
(Thanks for making this! I'll follow along to improve the MZ compatibility of my plugins while I'm not able to test on MZ myself.)
You are absolutely right! Thanks for catching that. 😅
Nice tutorial for those who want to use plugins. Where did you study how to make them?
I learned JavaScript a few years ago while playing with another engine called Phaser. Then I watched some tutorials on TH-cam for coding RPG Maker VX since I already knew Ruby. I also looked at several existing plugins and pieced together how they worked. Lastly, Casper from Casper Gaming gave me some tips on the Reddit. So it is pretty pieced together. :)
@@AutMouseLabs thank you for your reply! For me, I learned C language when I was a student, and have learning JavaScript while making lots of plugins through RPG makers.
I'm not someone who knows how to code. I'd personally benefit from (if it's possible) being able to locate certain configuration parts within the code to alter.
Example being there's a part of a battle system that I'm using that plays the item use pose way too quickly.
How'd I go about locating that part of the code and altering a value.
Hello, that process is the subject of my next coding video. It is called aliasing or overriding. The gist is to open one of the core js files in a code editor and use the finder to search for keywords like battle or to use the reference documentation linked at the bottom of this video. I will have a whole video on it soon though. :)
@@AutMouseLabs Looking forward to it.
How would you go about adding multiple commands? I tried adding a new section for multiple command names, but it the new ones don't work (LineOne still works).
* // First line of text.
* @command LineOne
* @text One Line
* @desc Custom textbox for one line of dialogue.
*
* @arg speaker
* @text Speaker:
* @desc Target speaker.
* @type text
* @default Undefined
*
* @arg textLineOne
* @text Line One Text:
* @desc Text for the first line of dialogue.
* @type text
* @default Undefined
*
* @command LineTwo
* @text Two Lines
* @desc Custom textbox for one line of dialogue.
*
* @arg speaker
* @text Speaker:
* @desc Target speaker.
* @type text
* @default Undefined
*
* @arg textLineOne
* @text Line One Text:
* @desc Text for the first line of dialogue.
* @type text
* @default Undefined
*
* @arg textLineTwo
* @text Line Two Text:
* @desc Text for the second line of dialogue.
* @type text
* @default Undefined
For reference this is what my register commands look like in case the issue is there instead.
// Displays a line of text for each textbox function. Each line can hold roughly 80 characters.
PluginManager.registerCommand(
tennshii_textboxes.pluginName,
"LineOne",
(args) => {
console.log(args);
tennshii_textboxes.textBeingSaidOne = String(args.textLineOne || "Undefined");
tennshii_textboxes.nameOfSpeaker = String(args.speaker || "Undefined");
$gameMessage.setSpeakerName(tennshii_textboxes.nameOfSpeaker);
$gameMessage.add(`${tennshii_textboxes.textBeingSaidOne}`);
},
"LineTwo",
(args) => {
console.log(args);
tennshii_textboxes.textBeingSaidOne = String(args.textLineOne || "Undefined");
tennshii_textboxes.textBeingSaidTwo = String(args.textLineTwo || "Undefined");
tennshii_textboxes.nameOfSpeaker = String(args.speaker || "Undefined");
$gameMessage.setSpeakerName(tennshii_textboxes.nameOfSpeaker);
$gameMessage.add(`${tennshii_textboxes.textBeingSaidOne}`);
$gameMessage.add(`${tennshii_textboxes.textBeingSaidTwo}`);
},
Did you end up figuring it out. As far as I can see that should be valid. Are the commands showing up in the plugin commands menu?