Hello, fellow RPG makers! I'm looking for script (or a plugin) that would add an Experience bar to the battle menu that would/could replace the TP bar (I don't use it at all). I'm not picky about color or details like that as I'm good enough at Javascript and css to change that type of thing myself. Thank you in advance!
Edit: Here is the completed RMMV plugin with compatibility with Yanfly plugins (MZ version can be found below):
Edit: Here is the completed RMMV plugin with compatibility with Yanfly plugins (MZ version can be found below):
Code:
/*:
@plugindesc Turns the TP bar into an EXP bar. Only use if you're not going to use the TP system at all.
@author Drakkonis
*/
var Imported = Imported || {};
Imported.Drak_TPX = true;
var TPX = TPX || {};
TPX.Parameters = PluginManager.parameters('Drak_TPX');
TPX.mode = "Percentage";
const battler_refresh = Game_BattlerBase.prototype.refresh;
Game_BattlerBase.prototype.refresh = function() {
battler_refresh.call(this);
if (this.isActor()) {
this._tp = Math.round(((this.currentExp() - this.currentLevelExp()) /
(this.nextLevelExp() - this.currentLevelExp())) * 100);
}
};
Game_Actor.prototype.maxTp = function() {
return 100;
};
Game_BattlerBase.prototype.isPreserveTp = function() {
return true;
};
// Modify Window_BattleStatus to display EXP%
Window_BattleStatus.prototype.drawActorTp = function(actor, x, y, width) {
width = width || 96;
const color1 = this.tpGaugeColor1();
const color2 = this.tpGaugeColor2();
const expRate = (actor.currentExp() - actor.currentLevelExp()) /
(actor.nextLevelExp() - actor.currentLevelExp());
this.drawGauge(x, y, width, expRate, color1, color2);
this.changeTextColor(this.systemColor());
this.drawText(TextManager.tpA, x, y, 44);
this.changeTextColor(this.tpColor(actor));
this.drawText(actor.tp + "%", x + width - 64, y, 64, "right");
};