#11 - introduction to battle scene

Part 11 is now up!

It wasn't my original plan, but I'm going to devote a couple of videos to battles as battles have been by a large margin the most requested topic to cover. So, in this video I'll introduce you to the core variables inside Scene_Battle.

Required: An IDE (some of the most popular ones are Atom, Sublime text 2, Visual Studio Code (which I use) or Eclipse), some Javascript knowledge, Object oriented programming might be of help.

How would you change an actors battler sprite in battle when a state is applied and change it back once it's removed or when battle ends?
The simplest and laziest way is to change the Game_Battler.prototype.addState function (or perhaps in this case define a new Game_Actor.prototype.addState instead) to do this:

Code:
Game_Actor.prototype.addState = function(stateId) {
    if (this.isStateAddable(stateId)) {
        if (!this.isStateAffected(stateId)) {
            this.addNewState(stateId);
            if (stateId == 15) {
                this._baseBattlerName = this._battlerName;
                this._battlerName = "ChosenBattler";
            }
            this.refresh();
           
        }
        this.resetStateCounts(stateId);
        this._result.pushAddedState(stateId);
    }
};
Then you'd do the same with removeState function, except you'd do just
Code:
this._battlerName = this._baseBattlerName;

Original thread: https://forums.rpgmakerweb.com/threads/11-introduction-to-battle-scene.112932/