A warm up for the upcoming RPG Maker MV

Not really, this is not valid JSON:

{  'my_callback' : function (x, y) { return x * y;  } }It is done for security reasons, you may know how dangerous are callbacks like this...

It is HTML5 (the web version) there are PC and MAC versions wich may or may not use HTML5 (they may use something like V8 inside a C++ APP)
just try this:

var callbacks = {};

callbacks.callback1 = function (x, y) { };

callbacks.callback2 = function (x, y) { };

Its like the basis for jQuery plugins.

About HTML5 looks like its only export feature... http://www.rpgmakerweb.com/products/programs/rpg-maker-mv

Anyway about prototype: check the code on the immage at the Javscript session.
var callbacks = {};

callbacks.callback1 = function (x, y) { };

callbacks,callback2 = function (x, y) { };
Oh no, this:

var callbacks = {   do_something: function () {   },  do_something_else: function () {  }}is totally valid javascript, it is invalid JSON.

While every piece of JSON is valid Javascript, the inverse is not true.

JSON is not really javascript's true object notation inside javascript, it is a subset to pass information between PCs.

You know, how JSON does not allow also:

{ a_property_unquoted: 23 }you always have to quote:

Code:
{ 'a_property_unquoted': 23 }
Oh no, this:

var callbacks = {   do_something: function () {   },  do_something_else: function () {  }}is totally valid javascript, it is invalid JSON.

While every piece of JSON is valid Javascript, the inverse is not true.

JSON is not really javascript's true object notation inside javascript, it is a subset to pass information between PCs.

You know, how JSON does not allow also:

{ a_property_unquoted: 23 }you always have to quote:

{ 'a_property_unquoted': 23 }
Its valid from my point of view, even thou I understand your point, its meant for data manipulation, in which case function is not data.

But I'm pretty sure you understood mine, there are always turn arounds, like the seccond notation for accessing properties:

myJson = {};

myJson[propertyVariable] = 23;
Yes, just remember than if you try to use JSON.stringify with a function or recursive objects, it will throw an error.

The alternate property access is the main reason why

array[0] is really 

array['0']and 

matrix[1, 2]is not possible in javascript...
Yes, just remember than if you try to use JSON.stringify with a function or recursive objects, it will throw an error.

The alternate property access is the main reason why

array[0] is really 

array['0']and 

matrix[1, 2]is not possible in javascript...
As I told, I agree about function not being data, but its not like we would pass a json to another language in RPM VM, neither saving a function in the database why would I use stringify in this case?

I agree about array[0] being array['0'], said nothing against it.

All I said is that we can still access the property using a value stored in another variable, instead of using the string literal.

About matrix[1, 2] I dont see the relation :/

BTW its getting too offtopic hahaha, better follow with the tips
Well, Imagine this:

var rpg.skills.fireball = {  id: 1,  element: rpg.elements.fire,   damageFormula: function (user, target) {      return user.mat * 3 - target.mdf;  } /* more here...  */}This is really a great way to make skills with some flexibility, adding callbacks and such will provide that you can change it later with another function or or use any type of parameter.

You can do any valid expression inside an alternate property access:

obj[ 2 * 3 + myFuncall() + 'a-b' + id & false || undefined ]is valid.

It is true you will usually use a variable, or a literal string if the name starts with @ or a number..

But the tables you use in RGSS, cannot be used as before, you can't implement operator overload now...

This doesn't mean you cant create a Tileset of course, its more about being expressive and idiomatic in code (wich ruby is great at that)
Well, Imagine this:

var rpg.skills.fireball = {  id: 1,  element: rpg.elements.fire,   damageFormula: function (user, target) {      return user.mat * 3 - target.mdf;  } /* more here...  */}This is really a great way to make skills with some flexibility, adding callbacks and such will provide that you can change it later with another function or or use any type of parameter.

You can do any valid expression inside an alternate property access:

obj[ 2 * 3 + myFuncall() + 'a-b' + id & false || undefined ]is valid.

It is true you will usually use a variable, or a literal string if the name starts with @ or a number..

But the tables you use in RGSS, cannot be used as before, you can't implement operator overload now...

This doesn't mean you cant create a Tileset of course, its more about being expressive and idiomatic in code (wich ruby is great at that)
Sorry, I dont understand.

I didnt argue about overloading, Im just discussing ways to declare a function inside a json object.

Anyway I could not agree more, ruby is such a beautiful thing and I preffer it over JS, its reflective capatibilities are remarcable and will be missed.
I really hope that we can use Coffeescript without much troubles when writing new plugins. If you come from ruby or phyton you would have less trouble with using Coffeescript than JavaScript. Since Coffescript compiles into JavaScript you could also use it as a bridge while you are learning JavaScript. But I am also looking forward to see how they have used Javascript to build the new "Classes" and so on.
Check this:

https://d289qh4hsbjjw7.cloudfront.net/rpgmaker-20130522223546811/files/Script_illust.jpg

From here: http://www.rpgmakerweb.com/products/programs/rpg-maker-mv
I really hope that we can use Coffeescript without much troubles when writing new plugins. If you come from ruby or phyton you would have less trouble with using Coffeescript than JavaScript. Since Coffescript compiles into JavaScript you could also use it as a bridge while you are learning JavaScript. But I am also looking forward to see how they have used Javascript to build the new "Classes" and so on.
I would prefer to use an ES6 to ES5 compiler like traceur insthead.

Coffescript has many little problems on itself, but that is because for of.. and new things will be implemented over time.

Firefox already supports the short expression for functions:

(x) => x * xSo sooner or later CS will not have any 'real' advantage, and try to remember the difference between

(x) -> x * x and

(x) => x * xin coffee script

 

 

That is soooo small I can barely noteice the code.

(people says it has properties like Width and Height, wich seems weird if they start with an uppercase letter)

 

 

 
That is soooo small I can barely noteice the code.

(people says it has properties like Width and Height, wich seems weird if they start with an uppercase letter)
Zoom ftw!

Joking...

yeah its small, but I can understand some parts: I can read "prototype" there hahahaha
Window_TitleCommand.prototype.updatePlacement = function (offsetX, offsetY) { ...After all this years, they STILL insist in using ClassType_ClassName...

At least, they are consistent in something
Window_TitleCommand.prototype.updatePlacement = function (offsetX, offsetY) { ...After all this years, they STILL insist in using ClassType_ClassName...
At least, they are consistent in something
Seems reasonable. Would you prefer something else?
well, you know, maybe a:

Window.TitleCommand is a little more according to javascript standar practices.

Don't take it as the worst thing ever, it is great they still use some things similar to VXA, this should help people to not cry (a lot) in the conversion.

People will still need to learn about prototype anyway...
Seems reasonable. Would you prefer something else?
Well I wish they would use namespace for heaven's sake ;~;

Original thread: https://forums.rpgmakerweb.com/threads/a-warm-up-for-the-upcoming-rpg-maker-mv.43346/