RMMV How to learn what each piece of "built-in code" in RPG Maker MV files means/does?

A_Higher_Plane

Spiritual person, self-improvement geek, Game Dev
Veteran
Joined
Oct 3, 2015
Messages
575
Reaction score
168
First Language
Russian
Primarily Uses
RMMV
How can I learn exactly what all the "built-in" JS code in the 6 RMMV code files means? I think that this is the biggest issue I have with creating plugins. I need to know what it all means. I wish that someone could make a list. I mean there are lists but I still struggle to understand this. I can even pay someone to make a list, even just a single sentence to explain what each piece of code means. I mean, like, "new GameAction() creates a new action for a battler. This would allow you to input.".
 

A_Higher_Plane

Spiritual person, self-improvement geek, Game Dev
Veteran
Joined
Oct 3, 2015
Messages
575
Reaction score
168
First Language
Russian
Primarily Uses
RMMV
I did mention that I already did look there, but still couldn't understand it.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,783
Reaction score
1,839
First Language
Spanish
Primarily Uses
RMVXA
exactly what all the "built-in" JS code in the 6 RMMV code files means
those are *objects*
*objects* are constructs containing *procedures* and *data structures*
*procedures* are self-contained programs where data from *data structures* is processed by *instructions*

instructions, data structures, procedures, objects, and many other terms are foundation-level terms for any language.
read a book on *programming* before you read the manual for *javascript*
 

ZoeTornado

Villager
Member
Joined
Oct 5, 2021
Messages
7
Reaction score
4
First Language
English
Primarily Uses
RMMZ
I think the easiest way to approach it will be to look at something top-level and work your way down. An example would be the Main Menu screen. Search the code (with VSCode or some other IDE) for the Scene which describes the main menu. Then read it as best you can and try to see which parts get referenced. Usually they are named (somewhat) which can be understood like normal english, but when you encounter a technique or keyword you dont understand jot it down somewhere and then once you've made your way through that scene, google the things you noted as stuff you didnt understand. Specific RMMZ/MV stuff will be scarcer than general javascript stuff, but often once you understand how the Javascript is working, how it is used to do what it does in the RM program is just a matter of figuring out which variable is being referenced where.
Much like spoken languages, most of the words are the same 20 words (called keywords) and the rest are just variables with names (akin to pronouns or real-life names). 90% of figuring this stuff out has to do with figuring out how to get the code to point at the correct location of the information you need. Thank heavens some absolute saint created the google Sheet with the RMMZ/MV references mapped out, as that is tremendously helpful. Its pinned on one of these forums (this one I believe?) and I'd bookmark that as I use it regularly.

You won't need to interact with the low-end stuff very often (how images are made, controls, etc), so I would start with the higher-end, more visible stuff like Scenes and Objects, things which can be more readily seen visually when messing with them. I'd start by looking at how to create a custom Scene (there's tutorials on here) or a custom Window, and from there how to get them to show in a playtest. Once you have access in the game itself to see what happens when you mess with stuff, it will be much easier to learn what things do. Then just work your way down when you encounter issues or bugs by ctrl+F things you don't understand and trying to find where they are written at the lower level.

Also, when messing with the code is it always a good idea to not directly edit the existing base code. There is a way to add/change that code afterwards that basically lets you non-destructively alter those things. That way, if you screw something up, youll still have the original code there as a starting point which you know still boots up. Overwriting methods, namespaces, and aliasing are tools to edit existing code from the engine without ACTUALLY changing the code as written in the literal code files. Plug-ins go in afterwards and can "rewrite" the default code without actually deleting/editing the file itself. Very important.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,814
Reaction score
9,142
First Language
Indonesian
Primarily Uses
RMVXA
Even I don't know the purpose of every single function written in the file. And for some plugins, I don't need to because they are irrelevant.

If you want a list, there's a massive list of it here. Not guaranteed that every single function/parameter is documented/commented

And if you want the list of API, here is one

Learning everything at once is overwhelming. You can try to break down one topic at a time. For example, you can ask a specific topic such as "How the damage is calculated in the default code". Then we can help by bringing the relevant code that does that.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,559
Reaction score
2,912
First Language
English
Primarily Uses
RMMV
It sound like you just need to improve your JavaScript knowledge. If you're saying that you're opening up the .js files and "you don't understand it," that has nothing to do with RPG Maker, it's a matter of understanding the code syntax and commands.

There are many tutorials available if you Google it - I like w3schools, starting with the Statements chapter, but once you understand how classes and functions work, you should be able to follow your way through the written code.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,783
Reaction score
1,839
First Language
Spanish
Primarily Uses
RMVXA
it's a matter of understanding the code syntax and commands.
no language can work without data exchange.
the quasi-universal sign for data assignment, is "=".
even web languages such as CSS or HTML must store their variables somewhere.
it's as easy as tracking = signs and identifying what they're part of.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,559
Reaction score
2,912
First Language
English
Primarily Uses
RMMV
Erm...well, a lot of stuff in the code happens without assigning something to be equal to something else. Especially if you're trying to do something like read RPG Maker's code, if you don't recognize and understand function calls, I think it would be next to impossible to go through the file and say "This function does this and then calls this which then calls this, which makes the character step forward, swing their sword, and play an animation." just from tracking = signs.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,783
Reaction score
1,839
First Language
Spanish
Primarily Uses
RMVXA
@ATT_Turan that is exactly how I learned Ruby: by not-understanding functions, going through the code, and figuring them out.
once you've identified variables, it's easy to understand how they're used if you know the basic structures of programming.
that's why I tell people to learn *programming* not *coding*.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,559
Reaction score
2,912
First Language
English
Primarily Uses
RMMV
once you've identified variables, it's easy to understand how they're used if you know the basic structures of programming.
I mean, that's exactly what I said, only I wouldn't consider the equal sign to be the basic structure of programming :wink:

If you've read through any of the engine for MV (or MZ is even a bit more obscure), you might follow a given task through half a dozen function calls before you see something being assigned to equal something else.
And if you don't know enough to recognize a function call, and understand what variables are being passed into it, I'd say you're wasting your time. It would take less time to do basic tutorials and get to that level of knowledge than it would take to bang your head against the wall until you maybe figure out something in the code.

Anyway, I think we're saying the same thing just at kind of different levels of granularity.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
4,977
Reaction score
4,592
First Language
English
Primarily Uses
RMMZ
I did mention that I already did look there, but still couldn't understand it.
Jump into Javascript is meant to be accessible to complete novices, so if you didn't understand it it's failed in its mission statement. Can you elaborate on what you didn't get?
 

A_Higher_Plane

Spiritual person, self-improvement geek, Game Dev
Veteran
Joined
Oct 3, 2015
Messages
575
Reaction score
168
First Language
Russian
Primarily Uses
RMMV
Jump into Javascript is meant to be accessible to complete novices, so if you didn't understand it it's failed in its mission statement. Can you elaborate on what you didn't get?
Well, like, I need to know things like what Game_Action() does. And like knowledge like how to create someone's turn. I just can't do it with that thing.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
4,977
Reaction score
4,592
First Language
English
Primarily Uses
RMMZ
Well, like, I need to know things like what Game_Action() does. And like knowledge like how to create someone's turn. I just can't do it with that thing.
I explain what every class does at the beginning of the breakdown section for it.

"This is the class that handles battle actions, and is probably one a lot of people will appreciate a breakdown of because this is the meat and potatoes of every item and skill you'll use in your game. It has the standard constructor but since it's been a while, let's go over it for posterity. Before we begin, for the sake of avoiding repetition, any time you see "this" consider it to say "the current instance of the class the function is being written for"."

Then I break down every function within it line by line. What about it is failing to tell you what it does?
 

A_Higher_Plane

Spiritual person, self-improvement geek, Game Dev
Veteran
Joined
Oct 3, 2015
Messages
575
Reaction score
168
First Language
Russian
Primarily Uses
RMMV
@Trihan Okay I took a look again and it does seem to cover the things in quite the detail. So that's good and you're right about that!
But maybe the thing that I get stuck on is being able to know everything needed in order to know in order to create some kind of a functionality. I mean, for example, in order to "force a turn" during battle, you have to "make actions", set the "turn period" to be the "input phase" and I think a few other things. But how am I supposed to know all this?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
4,977
Reaction score
4,592
First Language
English
Primarily Uses
RMMZ
@Trihan Okay I took a look again and it does seem to cover the things in quite the detail. So that's good and you're right about that!
But maybe the thing that I get stuck on is being able to know everything needed in order to know in order to create some kind of a functionality. I mean, for example, in order to "force a turn" during battle, you have to "make actions", set the "turn period" to be the "input phase" and I think a few other things. But how am I supposed to know all this?
You shouldn't need to do any of that to force a turn, you just use the forceAction function.

The real answer though is "trial and error". Nobody can predict the exact uses to which you need to put functions, all they can do is tell you what's available.
 

A_Higher_Plane

Spiritual person, self-improvement geek, Game Dev
Veteran
Joined
Oct 3, 2015
Messages
575
Reaction score
168
First Language
Russian
Primarily Uses
RMMV
You shouldn't need to do any of that to force a turn, you just use the forceAction function.
No. I've created an ATB Battle System plugin with someone and that's how we have forced a turn. That's how you should do it.
 

Latest Threads

Latest Posts

Latest Profile Posts

I'm still undecided weather or not I should add minor swearing to my game. Like I'm going for an all ages demographic... but the idea of a cartoon character saying dammit, hell, or crap in normal conversation is really funny to me.
If we assume an Elf's strong suit is Dexterity (AGI) & Intellect (MAT), I imagine Strength (ATK) & Constitution (DEF) would be among their lowest stats. But I'm having a hard deciding which should be lower, Strength or Constitution?
I'm really sorry to have to do this, but I'm going to have to start blocking those who repeatedly put up sexual content and offer absolutely nothing (that I've seen) related to what this community is supposedly created for.
Don't take it personal. I'm a rape victim with permanent injuries who can never enjoy 'it' ever again, so it's the last thing I want to have put in my face. :(
Check out my side project! It's a survival dungeon crawler! https://voidmoon-studio.itch.io/depths-of-delmora
RushLog wrote on HarlekinLehl's profile.
how do you attach those images to your posts?

Forum statistics

Threads
123,215
Messages
1,154,971
Members
161,596
Latest member
LilCronch
Top