Learn JS with RPG Maker MV

I believe "powerful enough for a developer" implies an assumption that you already have the skills.

And "simple enough for a child" implies that you can make perfectly good games without having to program.

I don't believe it's RPG Maker's responsibility to teach people how to program. There are plenty of other places you can go to learn that.
The biggest thing though is that to make a resource like this, 'teaching js with rmmv' it can't be done by one person, its too big a task. It would have to be a team working together, as one mind is going to gloss over topics, while more minds will catch things and the like. It would be great if the top minds of our community pooled together to create something like this, it wouldn't even have to be an all at once thing, a "Monthly JS & MV Lesson" Idea would be pretty cool. With a preface mini JS specific lesson going over the functions/classes of JS that are going to be used in the lesson, what they do on their own, and how they can be used, and then segway into MV, and how we can use them in MV, to modify existing features, and later on down the line as the lessons progress, shift the focus from modifying existing MV systems and behavior, to adding new behavior and systems.

I think this kind of approach would be most beneficial, as teaching the JS itself and how it works, and then teaching how to apply it in this case afterwards would leave the JS knowledge a little more pure. As opposed to just teaching how to code MV stuff. I'm thinking like this because I know how to code in lua.... but specifically, I know how to code in lua, specifically to develop applications in the 'Open Computers' mod for Minecraft. While theoretically I could still make some simple applications that just run in lua on their own... The functions and syntax that I know how to work with is tailored to working in a pseudo OS, and while it's a 'useful' skill when I play minecraft, It's useless information anywhere else, and the only benefit I get from it is that since I know how to use one programming language, learning another will be easier than if I had no programming language skills at all. Suffice it to say, If I had learned Lua in a more pure environment and then later learned to apply it in open computers for minecraft, I would have a better understanding of the language as a whole.

But that's just my two cents on the whole topic. In the end it's our responsibility to learn the skills we need to do more in the engine. But I agree it would be nice to have more resources that focus on MV and programming together. And my vote would be for a Lesson style more akin to the 'for dummies' series, that assumes you know nothing, but is still useful if you at least know JS, but don't know how to use it with MV. :3
IMO I find JS hard to begin with, because this language has to many Design misstakes plus the Prototype-Based System is strange in some places (at least for beginners). They should grab a "good" language with static types to learn about Datatypes too. So they can avoid many misstakes later in JS if they want to learn it.

I dont know why the RPG-Maker MV has to use JS, but I buy it, because I can't code ruby but JavaScript because I'm a Webdev and there is (sadly) no way arround this in WebDev =/ But if you want to learn Code grab a good language try C++/Java for example, you can make much more with them than in JS.

This language is very inconsistend, these dynamic type coercion is the worst, in JS you can mix everything together and sometimes you get funny results like: (Free like, Apples are Bannanas)
Spoiler
false == "0"
> true

0 == "0"
> true

0 == ""
> true

[] + []
> ""

[] + {}
> "[object Object]"

{} + []
> 0 // You just flip the operants and get a different result? WTF (Aside that it makes no sence to combine an array with an object)

{} + {}
> NaN

// Fun with "NaN" (Not a Number)
NaN === NaN
> false

NaN == NaN
> false // Oo

typeof NaN
> "number" // >.<

"1" + 1
> "11"

"1" - 1
> 0

"2" - "2"
> 0

// But:
"2" + "-2"
> "2-2" // awesome

"2" + - "-2"
> "22"

// They are cool
10000000000000000 == 9999999999999999
> true
// Also works with:
10000000000000000 === 9999999999999999
> true

And then as some other guys said here, knowing JavaScript is not the only part; you have to know how to use it with the RPG-Maker MV because its very different than for example in Webdev.
I don't think MV should be responsible for teaching JS as others have already mentioned. While other engines like Unity do have some C# tutorials, they only cover very basic things and their documentation acts more like an API reference more than anything and a rather good one at that as MV lacks in good API documentation.

That said if you write a book or a web tutorial on JS or even JS with MV, how far do you go with it? We assume the reader would be a beginner as ones who are not would be ok with picking up JS through resources scattered across the web (like W3 and Stack).

Would you cover basic syntax? Sure.
What about basic programming paradigms like object-oriented programming?
Or the general software development cycle and good software development practices?
Code standards and code quality and avoiding common pitfalls?
Proper debugging techniques and general troubleshooting (maybe with popular IDE tips and tricks)?
Writing proper test cases and going through them (tools that can help this possibly)?
Perhaps learning about source control while you are at it?

All very important topics that anyone who is writing code should learn about, but way too big of a task for one resource to really cover and even more difficult to help apply this to MV specifically.
I dont know why the RPG-Maker MV has to use JS,
It's because RPG Maker MV is an HTML5 game engine to cover multiple platforms.
@Isaac The Red I like the ideas mentioned here and they could fundamentally be covered in a course for MV.

For those who never programmed before a book might be useful covering what they need to know for MV, and the basic classes.

But most would prefer video information as a course. I think if we wanted to make this a reality, multiple people like you said should be involved.

If anything I think a good structure would be.
JS primitives
JS Objects
JS functions
JS Understanding prototypes
MV Managers
MV Globals/Game Objects
MV Interpreter
MV Scenes
MV Windows
MV Battle Scenes

My question is though, would anyone want a series of Blog Posts on these topics? Is it okay to discuss engine code?
Is it alright to document the engine code and share it with others on a website?
I would agree with what Celianna and others have said in that teaching JavaScript coding is beyond the scope of RMMV as a game creation tool. That said, having related resources to teach JS within the context of RMMV would certainly be valuable.

I've been developing web applications professionally for a little over 5 years, and although the help file JS Library documentation leaves a bit to be desired, I found the code itself to be fairly well organized and easy enough to follow given my experience with the language. In my opinion of the engine so far, they deliver sufficiently on their motto. RMMV is "powerful enough for a developer", not "powerful enough to turn a novice into a developer".

While JS certainly has its oddities, I personally think it has recently evolved into a great scripting platform, due in no small part to the investments of Google, Mozilla, Microsoft, and the W3C (among others) into the language standard. So many software companies are developing toward the web now because of the benefits of near universal access and minimal platform dependence. I think they were wise to adopt the web as their platform with RMMV.
Well after opening the plugins after so many updates still feel everything is in an utter mess, I'm not really confused but an explanation as to where everything is and what classes do what would be nice.

I would like to know what handles movement think it's GameCharacterObject but not sure, I pretty much live in Unity and proto in GMS2 and everything is vary straightforward in those engines...not so much in MV.
I want to learn!!!
I have to say, I agree with @Kino's structure. It covers pretty much all there needs to be covered from the codical side. However, it would also be great if someone who knows PIXI shared a thing or two...
Because unfortunately, tutorials covering PIXI are scarce and outdated, since PIXI changes so dramatically with every update. I have found some tutorials by soulpour, but since they are on pixi v2, they aren't showing too much relevant information.
Sounds like a good chance to make a blogging E-Book. ~ Also, if that's the case might as well go all in on everything you can do with MV. I think a lot of the coding stuff will be short but it will definitely teach people JavaScript.

If you have anymore ideas, I'm up for it. Could build on this slowly.
RPG Maker MV motto is "Simple enough for a child; powerful enough for a developer", but we are missing a very important step in there, how do we go from "child" to "developer"? As of right now, it would require the child to go learn coding elsewhere and then come back, what will happen probably is they either never learn coding or never come back when they do.
Agreed!

I personally consider the move to JS the first chance RM has ever had to rise above it's toy status into actual tool territory, and Degica is seemingly doing a good job moving RM forward at a decent pace for the first time in over a decade, adding a staircase to help people go from "child" to "developer" can only do good for the engine in the long run as people won't have to leave the community in order to grow as devs.
I very strongly agree with the points TomatoKing is making, and would both like to help in this regard & also need help in this regard.

The biggest thing though is that to make a resource like this, 'teaching js with rmmv' it can't be done by one person, its too big a task. It would have to be a team working together ... It would be great if the top minds of our community pooled together to create something like this
And I also strongly agree it has to be a team.

So let's see if we can get the ball rolling ....

First, to introduce myself

I've been a programmer for 40+ years; and have written over 1,000,000 lines of code. Each time I've written 100,000+ lines of code it has been a commercial success of at least $500,000+.

I've been involved in 4 startups (2 successful, 2 failure) & am starting on my fifth startup: Games 🙂​

Second, Preparing to write a game

My major strength is programming & my major weakness is graphics. So I've been recruiting people to help write a game -- many of which have no idea how to program.​

Third, Picking RMMV as the first game engine

Due to the non-programmers involved in the project, I need a really simple UI they can design a game in -- RMMV currently looks like the best choice.

I've spent the last two days picking a game engine & have read two books on RMMV (As TomatoKing mentioned they covered "how to make generic RM game #124675" -- not very useful).

I then did a ton of research on how much the RMMV engine can be modified (which is very important for the games I want to write) ... and found way too few resources on this. I did however find it is as extensible as HTML5 / JavaScript, *IF* you know these (which I do quite extensively from 5+ years of programing in HTML & JavaScript).
  • However, the major problem is the JavaScript API is seriously under documented. 😠
Fourth, Getting the community involved to document the JavaScript API

So, this is my first post to see if the community wants to get involved in documenting & extending the JavaScript API.
​
Fifth, The best way to learn & document the JavaScript API is to extend it

So there are ton's of extensions I need to make to the JavaScript API to make it usable in the game I want to write. A few quick thoughts on what is needed:
  1. Debugger inside the game
  2. Unit Testing
  3. Ability to run the game in a separate window, while editing it & click reload inside the game (this is essential for fast software development);
  4. Hover over an item, and get a popup window.
  5. Ability to click on an item (or a popup window) WITHOUT your characters running there (i.e.: take over mouse handling).
  6. Since I want to write a CCG (Collectible Card Game), I need to take over half the screen very frequently with a good UI that lets users organize their cards & see their abilities (while also letting them run around on the screen)
  7. Change the battle system to add an option for a CCG 🙄
Sixth, Start this off with a google document

So I think the best way to get this going is to start a google document, for API documentation
Link to First Google Document: RMMV Javascript API to start the ball rolling & see if the community is interested in this ...😉​
@Joy Diamond https://kinoar.github.io/rmmv-doc-web/index.html RMMV Javascript API documented by @Kino.
1. Debugger inside the game is unnecessary, we have js console (f8).
2. Unit testing is possible through battle test.
3. Ability to run the game in a separate window while editing is possible, MV is the only PC RPG maker engine that allows it. Reloading is possible through f5.
4. In the engine there are popup windows. In the game feel free to make them.
5. The way the mouse is handled is inside core scripts.
6. Feel free.
7. Feel free.

The RPG maker MV games are 100% (I'm not kidding, 100%) moddable, because every default in game function is saved in rpg core javascripts which you can edit to your liking. So you technically don't even need API documentation, you can access the scripts - easier orientation.
2. Unit testing is possible through battle test.
Depends on what you're testing, but in many cases yes 😉.

I haven't tried it, but I can't imagine it would be hard to setup and utilize modern web testing tools (karma, mocha, jasmine, chai, etc.)
Chiming into the conversation, namely to the original post--

One thing is that RPG Maker is mostly marketed as an easy tool to make a game with zero knowledge of programming. The scripting feature seems to be there for the already experienced to make their game great, or as an option for people to make cool plugins for the "child" developers to help make their game run better. However, this doesn't mean these "child" dev will not want to take the next step further into making a great game. I feel however that the community could play a huge part in making one want to learn scripting by being the ones to offer the tools needed and encourage people to learn how to Java with RMMV by maybe providing basic tricks and things they could try and modify.

Lemme give you an example...

I primarily make visual novels. There is a particular engine I LOVE which is not a drag and drop interface (recently an optional visual interface was added you can call up, but still writing things seem to be essential). This engine has its own basic script AND uses Python. One thing I love about this engine is it encouraged me TO SCRIPT. Its tutorial is a game project that comes with the engine that you can open in jEdit and analyze to figure out what stuff does. Its script and even Python is a pretty straight-forward language. Even using basic script commands can accomplish really cool things, and if you really know what you're doing, you can take these codes and make it do even more cool things.

What has really helped (aside from the engine's dev who seems to explain things quite clearly already) is the engine's community. On the main forums, there's what we call the cookbook board where people can post tutorials or codes that accomplish certain things. One person showed how to accomplish an easy, but tedious, yet very highly customizable Event CG Gallery using basic script functions. Through that, I was able to learn how to make an entire EXTRAS MENU which I was never able to do before. Through other tutorials and my own knowledge of working with the software and learning its script and tiny bits of Python, I even got to write MY VERY FIRST TUTORIAL on how to easily accomplish custon Yes/No prompts which, from another method of code I studied, was too hard and confusing...but I understood it enough to simplify it and achieve the same results (like using image buttons instead of imagemaps). But this is all to a really awesome community that shares these little tips and tricks. What also helps is the documentation typically has code examples for how to accomplish stuff, so you're not totally blind. To me, this VN engine is like "an easy software where you have to script but it's in NO WAY intimidating and fun to learn!"

Anyway, to the point...
I think what would help get people interested in learning Javascript for RMMV is a community sharing tutorials and code. Maybe share some simple code examples of small customization you can achieve with a little code. Make it appear fun and not intimidating. One turn off of scripts and codes is that it often looks waaay too intimidating, but that's 'caus people run into the complex stuff first and never the simple but fun baby tuff to get them hooked to the power of script, no matter what language. I am interested in learning how to assemble coede in RMMV since the language it uses is a language I've wanted to learn and I feel is very organised and pretty (which helps, C++ is... not a gorgeous looking language by far....) I certainly think it'd be a neat idea to have a "cookbook" type board on the forum. Something welcoming to beginners and experts alike, 'cause RPG Maker admittedly has a huge gap of "child" and "developer". But again, remember it is marketed as a tool for people wanting to make games with little to no programming knowledge, but that doesn't mean we can't be enticed to learn the more complex parts with the right people! I certainly would feel more apt to learn the language if I there were some examples of where to get started in RMMV with scripts.

My 2 cents, I hope they made sense xD
Greetings @Kokoro Hane,

First, you write very eloquently:
  • You describe exactly the project I have been working on since I joined this community 10 days ago.
In fact, my first posting on these forums was to this same thread:
I very strongly agree with the points TomatoKing is making, and would both like to help in this regard & also need help in this regard.
You wrote:
One thing I love about this engine is it encouraged me TO SCRIPT. Its tutorial is a game project that comes with the engine that you can open in jEdit and analyze to figure out what stuff does.
Again, this precisely describes what I want to do! Here is a link that describes this:
Spoiler: A peek inside the Crystal project proposal: using the game engine that the user can edit & modify
upload_2017-11-21_22-51-55.png

Moving on:
One turn off of scripts and codes is that it often looks waaay too intimidating, but that's 'caus people run into the complex stuff first and never the simple but fun baby tuff to get them hooked to the power of script, no matter what language.
Here are two things I wrote to do what you wrote about:
Spoiler: A peek inside the console.log tutorial -- how to encourage first time learners
upload_2017-11-21_22-49-45.png

Next:
I am interested in learning how to assemble coede in RMMV since the language it uses is a language I've wanted to learn and I feel is very organised and pretty (which helps, C++ is... not a gorgeous looking language by far....)
I love to teach, from my post introducing myself on the forums:
I'm Joy Diamond. I have been a programmer for 40+ years, and have a passion for teaching others to program.
  • I believe programming games can teach useful skills to assist in getting a job (certainly it has helped me that way many times over the last 35 years).
I believe modifying a game is the best way to learn the joy of programming (since that is how I started 40 years ago & fell in love with programming).​
And finally:
I certainly think it'd be a neat idea to have a "cookbook" type board on the forum. Something welcoming to beginners and experts alike, 'cause RPG Maker admittedly has a huge gap of "child" and "developer"
This is what my real life friend @Ulysses Wanderer told me two weeks ago!! He has been a bit with his real time job, but will hopefully become active on the forums soon. He & I together hope exactly to bridge that 'huge gap of "child" and "developer"'.

I will follow up with a private message & hopefully we can work together,​

Looking forward to working with you!

Joy Diamond
@Joy Diamond I love your enthusiasm and find it cool you want to start a project that is a game but it teaches you script as you provide tools to modify it! Always the best way to learn code is to look at working code and see how it ticks! (Because while scripting from scratch is fun, you can't learn from a blundered code, so always best to stare at working code). So I totally support this idea! From what you have so far, you're pretty good at laying out everything step by step (and wow...EVERY step) and the enthusiasm shows in the writing, which makes it feel fun and exciting despite how simple it is. It's good to stress the baby stuff and make sure the "student" is feeling like they are accomplishing something, even if it is low level~
1. Debugger inside the game is unnecessary, we have js console (f8).
I think a debugger is WAY more helpfull than just the console. But you can do an Workaround. These Games also starting with a normal Webbrowser, so just start the game with a Webbrowser and use the debugger of the Webbrowser like usually^^
@petschko Find five differences:
Spoiler: Browser's console
Screenshot_402.png
Spoiler: MV game's console
Screenshot_403.png

Neither of these is called debugger, but developer's tools. Debuggers aren't used anymore, because for debugging we use console.
Developer tools is a debugger among other tools to help debug and design websites and applications. While the only differences between the browser and mv nwjs is the version, the dark theme and the timeline and profiles suck. I use browser to debug because I set it up so all changes made to my code refreshes the page automatically. Aside from that nwjs for MV is really outdated and a lot slower than the latest chrome browser, like a lot slower. Nonetheless developer tools is extremely powerful and the console is really just the first stepping stone, timelines, code stepping and profiles is where the magic can happen.

Original thread: https://forums.rpgmakerweb.com/threads/learn-js-with-rpg-maker-mv.77165/