Actual JS code from RPG Maker MV

MV would probably require eval's for certain portions of the engine, such as damage formulas.
evals in js are different than ruby, but probably you have a point there...

Still, there are some formula parsers for JS... but anyway, using strict is good practice for you and it works quite different:

Code:
notEval = eval;function () {   "use strict";   eval("2 + 3"); // this is not allowed   notEval("2 + 3"); // sadly THIS is allowed... security, who needs that huh?}eval("2 + 3"); // but this is
Wait wait... what is notEval o___o
In this case notEval would be a global var equal to the eval function. If I remember my JS lessons correctly. 🙂
In this case notEval would be a global var equal to the eval function. If I remember my JS lessons correctly. 🙂
I think you're correct 😀

This trick of notEval will come in handy 😛
Yup, Usually you will use var notEval; but well, it is the same here, the point is that if you assign eval to another function name, it will work inside strict mode, so after all, strict mode does not prevent you from calling eval...
evals in js are different than ruby, but probably you have a point there...


Still, there are some formula parsers for JS... but anyway, using strict is good practice for you and it works quite different:
What are the differences between Ruby and JS eval?
The context of execution in eval, works... different than ruby.

But this is probably because on how JS uses its scope. Even worse is than if you rename it like I just did, the execution changes because eval evals as different scope if it was stored in another variable.

Eval only works if it's called eval, if it is called other way it has like other binding, also you can use strict inside eval code to make it even more confusing.

http://stackoverflow.com/questions/9781285/specify-scope-for-eval-in-javascript

I woudn't suggest resolving anything but the formulas with eval, and try to use it as the last resource. you can always troll foreign eval forcing strict of course like the stack overflow answer suggest:

eval ( '"use strict";' + evalCode ); // at least they can't troll you easilyRemember too, with is a deprecated statement and is invalid on strict mode.

And to use a custom "this" of course is: 

eval.bind(this)( evalCode );So many "gotchas"...

But here you have an article about why eval is misunderstood, and why it is not used well:

http://www.nczonline.net/blog/2013/06/25/eval-isnt-evil-just-misunderstood/
Is there any idea if MV will be running purely ES5, or if it will have ES6 features implemented? I'm hoping for at least classes from ES6 (not a major concern, since if it supports ES5, I can just use babel). Definitely, after living in io.js for a few months, I'm being pretty spoiled by a lot of ES6 functionality, but end up still using babel to transpile for frontend.
It will run ES5, it will run it because it exports to html5, so all browsers now implement ES5... At least the browser version... But it would be kinda sillu if they don't implement ES5 on the desktpop and mobile versions...

You can use traceour or something if you want ES6 while there is no official support...
To be fair, most browsers support ES5 with functionality from ES6, I'm just curious to what extent that would be the case with MV. Like you said, though, the great thing about JS compared to Ruby, is the all the well developed transpilers, so I could use babel to write JS for MV (or use Opal, and write Ruby code, or use Haxe...etc), that's what I do like about JS. If there are some features out of ES6 that are supported, (like classes) Enterbrain can always provide a shim or polyfill with the generated HTML5 version. Presumably, with the mobile and desktop versions, they can ship it using a RM specific runtime/browser (like Electron) which would provide the functionality natively.

EDIT: That being said, looking at past RM releases, I would be surprised if MV only implemented ES5 features with no functionality from ES6 at all. Presumably, if they're using an existing runtime as a base, then a number of ES6 features will creep in unless they're using a really old version.
Yup they'll probably do something like that, after all, trying to implement an ultra-super-engine from the ground up would be a big cost. More if they are planning to do some cross platform rpg maker (because the application is cross platform too)

So we can guanrantee ES5 support as minimun, even if they started from the ground with duktape

I wonder what they decided to choose as their libraries, good news is, if they actually decided for X library, in the about part of the program we will be able to check what libraries and programs it's using 😛

Still we would need at least to a "lite" version came out first to do that...

The code sure has some similarities with the ruby code, anyway, like:

var sprite = new Sprite();sprite.setBitmap(Cache.loadBattler('battler.png'));Or they decided it's time to load up your resources like this:

ResourceManager.loadImage('image.png', onLoadEvent);function onLoadEvent(bitmap) {  // ...};We may have to implement our "loading screens now" D: hope we don't and the engine can make them easily...
hei guys, since I read about rpgmaker using JS, I decide to buy RPGMaker MV and join this forum.

I have little experience in web development, so I am very excited when I read it uses JS. Can't wait for it's release.

Would love to read more about the source code. 
I've been wondering this for a while, but what Javascript library is the base for RPG Maker MV? It's clearly not NodeJS. Is it just straight browser stuff? If so, what's stopping you from using Browser if you to do NodeJS - like scripts?

I meant Browserify - stupid Spellchecker.
I've been wondering this for a while, but what Javascript library is the base for RPG Maker MV? It's clearly not NodeJS. Is it just straight browser stuff? If so, what's stopping you from using Browser if you to do NodeJS - like scripts?

I meant Browserify - stupid Spellchecker.
What makes you think that it's not NodeJS?
I've been wondering this for a while, but what Javascript library is the base for RPG Maker MV? It's clearly not NodeJS. Is it just straight browser stuff? If so, what's stopping you from using Browser if you to do NodeJS - like scripts?


I meant Browserify - stupid Spellchecker.
PixiJS.
Where'd you find that?
Where'd you find that?
Inspector.


sQA5E0u.jpg
Inspector.

[IMG]http://i.imgur.com/sQA5E0u.jpg[/IMG]
if it is true, pixijs uses intel xdk instead phonegap
if it is true, pixijs uses intel xdk instead phonegap
Is that a good thing?
Is that a good thing?
phonegap is more mainstream, there are many available plugins, including geolocation, barcodes, ads with admob, and so on.

I make mini games with just phonegap and createjs for android/iOS in the past.

I am not sure about intel XDK. 

Original thread: https://forums.rpgmakerweb.com/threads/actual-js-code-from-rpg-maker-mv.44112/