can't call exp in MenuStatus?

I'm trying to draw an exp bar along side the HP/SP for actors in MenuStatus (first view in the menu).

I created "Window_Base.prototype.drawActorEXP" and insert it into "Window_Base.prototype.drawActorSimpleStatus"

It worked for skill menu and equip menu. But somehow when I tried to put it in Window_MenuStatus ( in "Window_MenuStatus.prototype.drawItemStatus"), it gives me Type error. It looks like anything related to EXP is undefined under Window_MenuStatus.

Not sure if there is an easy way around to read EXP in MenuStatus. Any ideas will be appreciated~

also I wish there will be more info added to the manual for the basic data structure so it will be easier for amateur to custom plugins...
I've moved this thread to JS/Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.


Please show us the code you have created, and the exact error message.


Window_MenuStatus should be based on Window_Base, so it SHOULD have the necessary functions.


Actually, what do you mean you "created" Window_Base.prototype.drawActorEXP? Doesn't it already have that?
Consider my previous script here where I show the amount in numbers.
 

Just draw a simple bar there instead of adding text.

http://forums.rpgmakerweb.com/index.php?/topic/48739-show-exp-in-menu/
 

Actually, what do you mean you "created" Window_Base.prototype.drawActorEXP? Doesn't it already have that?
No it dosn't. i wrote somethings too but i cannot call for all actor, only the first works.

Code:
Window_Base.prototype.drawActorExp = function(actor, x, y, width) {	width = width || 186;	// var actor = $gameActors._data[1];	var color1 = this.hpGaugeColor1();	var color2 = this.hpGaugeColor2();	var ratio = actor._exp[1] / actor.nextLevelExp();	this.drawGaugeMenuStatus(x, y, width, ratio, color1, color2);	this.changeTextColor(this.systemColor());	this.drawText('Exp', x, y, 44);}
var actor = $gameActors.actor(actorId);
 

Need clarification I think.
var actor = $dataGameActors.actor(actorId);

Need clarification I think.
ill try asap, thanks. meanwhile if u see code update up there i tryed with the basic actor variable, that works with mp and hp, but still don't work for that.

Edit $dataGameActor dosn't exist 😛

$gameActor.actor(actorId) dosn't work too.
Edited I miss-typed it. 
Window_Base.prototype.drawActorExp = function(actor, x, y, width) {


var color1 = this.hpGaugeColor1();


var color2 = this.hpGaugeColor2();


var actorExp = actor._exp[actor.actorId()];


var actorNextLvlExp = actor.nextLevelExp();


var actorCurLvlExp = actor.currentLevelExp();


var ratio = (((actorExp - actorCurLvlExp) / 100)/ ((actorNextLvlExp - actorCurLvlExp)/100));


this.drawGaugeExpMenuStatus(x, y + 27, width, ratio, color1, color2);


this.changeTextColor(this.systemColor());


this.drawText('Exp', x - 45, y + 27, 44);


}


Window_Status.prototype.drawExpInfo = function(x, y) {


var lineHeight = this.lineHeight();


var expTotal = TextManager.expTotal.format(TextManager.exp);


var expNext = TextManager.expNext.format(TextManager.level);


var value1 = this._actor.currentExp();


var value2 = this._actor.nextRequiredExp();


if (this._actor.isMaxLevel()) {


value1 = '-------';


value2 = '-------';


}


this.changeTextColor(this.systemColor());


this.drawText(expTotal, x, y + lineHeight * 0, 270);


this.drawText(expNext, x, y + lineHeight * 2, 270);


this.resetTextColor();


this.drawText(value1, x, y + lineHeight * 1, 270, 'right');


this.drawText(value2, x, y + lineHeight * 3, 270, 'right');


var actor = this._actor;


var ratio = actor._exp[actor.actorId()] / actor.nextLevelExp();


var width = 300;


var color1 = '#FF0000';


var color2 = '#FF0000';


this.drawGaugeMenu(x, y, width, ratio, color1, color2);


};

Done! ^^

Ok the code work but the ratio formula is kinda weird..need to fix it

Edit: this should work
sorry I did not pay attention to this, it has been solved.

it was a stupid issue.

I copied the drawEXP based on the drawHP, which read values using "this.xxxxx" because the skill menu load actor first

but the Menu_status loads the whole party and I need to read value using "actor.xxxx", otherwise the actor is undefined

Original thread: https://forums.rpgmakerweb.com/threads/cant-call-exp-in-menustatus.48968/