Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

1.6.0 is not broken, please share ES6 knowledge.

trapless

Villager
Xy$
0.00
JavaScript:
class Tools {
  constructor() {
  }
  axe(handle, head) {
    class axe {
      constructor(handle, head) {
        this._handle = handle;
        this._head = head;
      }
      get parts() {
        return [this._handle, this._head];
      }
      get handle() {
        return this._handle;
      }
      set handle(value) {
        this._handle = value;
      }
      get head() {
        return this._head;
      }
      set head(value) {
        this._head = value;
      }
    };
    return new axe(handle, head);
  }
  handSaw(handle, blade) {
    class handSaw{
      constructor(handle, blade) {
        this._handle = handle;
        this._blade = blade;
      }
      get parts() {
        return [this._handle, this._blade];
      }
      get handle() {
        return this._handle;
      }
      set handle(value) {
        this._handle = value;
      }
      get blade() {
        return this._blade;
      }
      set blade(value) {
        this._blade = value;
      }
    };
    return new handSaw(handle, blade);
  }
}

class Scene_Example {
  constructor() {
    this.tools = new Tools();
  }
  newAxe(handle, head) {
    return this.tools.axe(handle, head);
  }
  newHandSaw(handle, blade) {
    return this.tools.handSaw(handle, blade);
  }

  create() {
    this.axe = this.newAxe('wood', 'stone');
    this.saw = this.newHandSaw('wood', 'metal');
  }
}

this._scene = new Scene_Example();
this._scene.create();
console.log(this._scene.axe);         // axe { _handle: 'wood', _head: 'stone' }
console.log(this._scene.saw);         // handSaw { _handle: 'wood', _blade: 'metal' }
console.log(this._scene.saw.parts);   // [ 'wood', 'metal' ]
console.log(this._scene.saw.blade);   // metal

'The google' is flooded with people talking about the awful 1.6.0 update. So many people complained that
KADOKAWA opted for regression and released a 1.5.2 update. They backstepped NW.js and QT. Were all of the other problems resolved by changing those two things? I don't know. Everything looks fine to me in 1.6.0. There was a little issue of the plugin "show_console_on_boot " not working for a few hours. I read about the new version of NW.js and ended up with an improved plugin.

I did notice that KADOKAWA said noting about 'pixi-tilemap.js'. Here is a quote from pixi.js's github:
"Canvas fallback is 5x slower than vanilla rpgmaker. Webgl version is faster and doesnt use extra textures."
I image thats because web technology is moving in an awesome direction and turning away from Webgl would be digital suicide. Removing a newer version of NW.js is just the same. Turning away from from ES6 is CRAZY.

PLEASE MAINTAIN YOUR PLUGINS. Don't be like Internet Explorer.. Don't be like Apple.. The internet is for everyone.
Allowing RPG Maker to use current tech will benifit so~~~~ many people. please.. please.. help us tell stories to our children with RPG Maker MV. They wont put down the phones...

so, anyways..ES6 is here. I'd love to see more about its use in MV on the forums.
Feel free to post some tip below. It's a new day, gotta wake up somewhere.
 
Last edited:

LTN Games

Master Mind
Resource Team
Xy$
0.01
1.6.0, it 's in perfect shape for me and I've been using it since its been in Beta and all my plugins were updated right away, the only thing I had to change was the console actually :D Aside from that though there are a few bugs in the editor itself but not bad enough for me to want to use 1.5.2

I've been working on a large project to introduce ES6 with MV so more developers are interested in using it heavily. This project is designed so newbies can quickly and easily design their own plugins or at least get their feet wet. It's a large project and most of the work is me writing documentation and rewriting and fine tuning all my older plugins, which were written in ES6 more than a year ago.

The point is, ES6 should be used by all developers from here on out and something tells me you'll still see a bunch of 1 files plugins stacked with 1500+ lines using .prototype lol Anyways, my plan is to provide incentives and a very easy workflow so even well-known plugin developers who think there way is the only way will actually take a look and be like damn, I think I'll give this a try instead. It's all open source too.

If you feel like taking a look, check out the blog for my most recent updates and a Visual Studio Code extension for MV integration.
http://fenixenginemv.gitlab.io/


P.S I don't use classes if I need static methods or a module. A class has no private members and while a weakmap can fix that, I'd prefer this factory function. Unfortunately, the constructor function is heavily used in MV so classes are still used by me to keep consistency, I can't stand classes/constructor functions but they have their moments I guess.

Factory Function
JavaScript:
  const Factory = function () {
    const _private = 'Truly private'

    return {
      get private () {
        return _private
      },
     
      otherMethod () {}
    }
  }
 

trapless

Villager
Xy$
0.00
added this to SceneManager to allow es6 classes:
JavaScript:
    var _SceneManager_new_isNextScene_traplessDebug_27022018 = SceneManager.isNextScene;
    SceneManager.isNextScene = function (sceneClass) {
      if (typeof sceneClass === "string") {
        sceneClass = eval(sceneClass);
      }
      _SceneManager_new_isNextScene_traplessDebug_27022018.call(this, sceneClass);
    };

    var _SceneManager_new_isPreviousScene_traplessDebug_27022018 = SceneManager.isPreviousScene;
    SceneManager.isPreviousScene = function (sceneClass) {
      if (typeof sceneClass === "string") {
        sceneClass = eval(sceneClass);
      }
      _SceneManager_new_isPreviousScene_traplessDebug_27022018.call(this, sceneClass);
    };

    var _SceneManager_new_goto_traplessDebug_27022018 = SceneManager.goto;
    SceneManager.goto = function (sceneClass) {
      if (typeof sceneClass === "string") {
        sceneClass = eval("new " + sceneClass + "()");
        if (this._scene) {
            this._scene.stop();
        }
        return;
      }
      _SceneManager_new_goto_traplessDebug_27022018.call(this, sceneClass);
    };

    var _SceneManager_new_push_traplessDebug_27022018 = SceneManager.push;
    SceneManager.push = function (sceneClass) {
      if (typeof sceneClass === "string") {
        sceneClass = eval(sceneClass);
      }
      _SceneManager_new_push_traplessDebug_27022018.call(this, sceneClass);
    };
I would rather not use eval to load scenes but I hadn't figured it out before writting that plugin. I'll definitly look at your work.

Twentny million thumbs up for vscode btw. with cursor one line above a function type "/**" and hit enter to create a documentation template... amazing.. it thows all the parameters in there and everythigng.. so usefull.
 
Top