I'm using the Enemy Book plugin that comes with MV, but I wanted to modify which monster is selected when opening the book.
I wanted it to always select the last available enemy on the list.
Little explanation: the battle encounters will follow the order of the Enemies database, and before each battle the player can read about the enemy they're about to face, which will be on the bottom of the list once added to it. That's why I need to select the last index available, so the player is taken straight to it.
There's this part in the code:
I guess I could tie "this.select" to a variable, but I'd rather not... if possible. Please... :blush:
I wanted it to always select the last available enemy on the list.
Little explanation: the battle encounters will follow the order of the Enemies database, and before each battle the player can read about the enemy they're about to face, which will be on the bottom of the list once added to it. That's why I need to select the last index available, so the player is taken straight to it.
There's this part in the code:
JavaScript:
function Window_EnemyBookIndex() {
this.initialize.apply(this, arguments);
}
Window_EnemyBookIndex.prototype = Object.create(Window_Selectable.prototype);
Window_EnemyBookIndex.prototype.constructor = Window_EnemyBookIndex;
Window_EnemyBookIndex.lastTopRow = 0;
Window_EnemyBookIndex.lastIndex = 0;
Window_EnemyBookIndex.prototype.initialize = function(x, y) {
var width = Graphics.boxWidth;
var height = this.fittingHeight(1);
Window_Selectable.prototype.initialize.call(this, x, y, width / 2, height / 2);
this.refresh();
this.setTopRow(Window_EnemyBookIndex.lastTopRow);
this.select(Window_EnemyBookIndex.lastIndex);
this.activate();
};
I guess I could tie "this.select" to a variable, but I'd rather not... if possible. Please... :blush: