Edit: Someone on Discord helped me and it now works correctly.
First off, I apologize if this is the wrong board. I was not sure if it would better fit in JS support or requests.
I've been trying to modify MogHunter's SceneMenu plugin for MV. And although I've got half of what I want to work, I'm still having some issues that elude me.
I am considering a game that makes full use of TP and replaces MP. No MP whatsoever. However with MogHunter's menu plugin, it only displays HP and MP. It is not possible to simply swap the gauges with plugin parameters or other plugins as the displayed gauges are hard-coded into the plugin code. This has forced me to go into SceneMenu's code itself and change all instances of MP to TP.
I got it to half work. The menu now displays the actor's current amount of TP. But it does not display the TP gauge or even the max TP number, and I'm puzzled what could be the cause of that. Right now it looks like this. (Ignore the MP label, that's part of the default background image.)
Since this plugin is image-reliant, I did save separate images for "TPNumber" and "TPMeter" in the appropriate folder. And looking over the code, it should be calling those images without issue. But they're still not actually displaying.
These are some snippets of the code where I think could have issues, but I am not one-hundred percent certain. If need be, I can copy-paste the code in a Google Doc and send it over a private conversation if the whole thing needs to be looked over.
I am wondering if part of the problem is if I'm using the wrong code for TP or had looked over a particular string of code. As far as I'm aware, TP values are denoted with ".tp" and ".mtp" for max TP. I've unfortunately had some trouble verifying this as there isn't a lot documented on TP online since very few people seem to care for it.
Thank you very much.
First off, I apologize if this is the wrong board. I was not sure if it would better fit in JS support or requests.
I've been trying to modify MogHunter's SceneMenu plugin for MV. And although I've got half of what I want to work, I'm still having some issues that elude me.
I am considering a game that makes full use of TP and replaces MP. No MP whatsoever. However with MogHunter's menu plugin, it only displays HP and MP. It is not possible to simply swap the gauges with plugin parameters or other plugins as the displayed gauges are hard-coded into the plugin code. This has forced me to go into SceneMenu's code itself and change all instances of MP to TP.
I got it to half work. The menu now displays the actor's current amount of TP. But it does not display the TP gauge or even the max TP number, and I'm puzzled what could be the cause of that. Right now it looks like this. (Ignore the MP label, that's part of the default background image.)
Since this plugin is image-reliant, I did save separate images for "TPNumber" and "TPMeter" in the appropriate folder. And looking over the code, it should be calling those images without issue. But they're still not actually displaying.
These are some snippets of the code where I think could have issues, but I am not one-hundred percent certain. If need be, I can copy-paste the code in a Google Doc and send it over a private conversation if the whole thing needs to be looked over.
JavaScript:
//==============================
// * create TP Meter
//==============================
MCharStatus.prototype.createTPMeter = function() {
this._tpMeter = new Sprite(this._TPMeterImg);
this._tpMeterData = [this._TPMeterImg.width / 3,this._TPMeterImg.height,0,0];
this._tpMeterData[2] = this._tpMeterData[0] * 2;
this._tpMeterData[3] = Math.randomInt(this._tpMeterData[2])
this._tpMeter.x = this._layout.x + Moghunter.scMenu_TPMeterX;
this._tpMeter.y = this._layout.y + Moghunter.scMenu_TPMeterY;
this.updateMeter(this._tpMeter,this._tpMeterData,this._actor.tp,this._actor.mtp);
this.addChild(this._tpMeter);
};
//==============================
// * update Meter
//==============================
MCharStatus.prototype.updateMeter = function(sprite,data,v1,v2) {
var cw = data[0] * v1 / v2;
sprite.setFrame(data[3],0,cw,data[1]);
data[3] += 4;
if (data[3] > data[2]) {data[3] = 0};
};
//==============================
// * create TP Number
//==============================
MCharStatus.prototype.createTPNumber = function() {
this._tp_number = [];
this._NumberData2 = [this._numberImg2.width / 10,this._numberImg2.height]
var x = this._layout.x + Moghunter.scMenu_TPNumberX;
var y = this._layout.y + Moghunter.scMenu_TPNumberY;
for (var i = 0; i < 5; i++) {
this._tp_number[i] = new Sprite(this._numberImg2);
this._tp_number[i].visible = false;
this._tp_number[i].opacity = 255;
this._tp_number[i].x = x ;
this._tp_number[i].y = y ;
this.addChild(this._tp_number[i]);
};
this.refresh_number(this._tp_number,this._actor.tp,this._NumberData2,x)
};
//==============================
// * create TP Number2
//==============================
MCharStatus.prototype.createTPNumber2 = function() {
this._tp_number2 = [];
var x = this._layout.x + Moghunter.scMenu_TPNumber2X;
var y = this._layout.y + Moghunter.scMenu_TPNumber2Y;
for (var i = 0; i < 5; i++) {
this._tp_number2[i] = new Sprite(this._numberImg2);
this._tp_number2[i].visible = false;
this._tp_number2[i].opacity = 255;
this._tp_number2[i].x = x ;
this._tp_number2[i].y = y ;
this.addChild(this._tp_number2[i]);
};
this.refresh_number(this._tp_number2,this._actor.mtp,this._NumberData2,x)
};
/==============================
// * Update
//==============================
MCharStatus.prototype.update = function() {
Sprite.prototype.update.call(this);
if (!this._actor) {return}
if (!this._hp_number) {
if (this._numberImg.isReady()) {this.createSprites();
} else {
return
};
};
if (this._hpMeter) {this.updateMeter(this._hpMeter,this._hpMeterData,this._actor.hp,this._actor.mhp)};
if (this._tpMeter) {this.updateMeter(this._tpMeter,this._tpMeterData,this._actor.tp,this._actor.mtp)};
if (this._state_icon) {this.update_states()};
if (this._wait > 0) {this._wait--;return}
this.opacity += 10;
if (this.x > 0) {this.x -= 2;
if (this.x < 0) {this.x = 0};
}
};
//==============================
// * drawItemStatus
//==============================
Window_MenuStatusM.prototype.drawItemStatus = function(index) {
var actor = $gameParty.members()[index];
var rect = this.itemRect(index);
var x = rect.x + 162;
var y = rect.y + rect.height / 2 - this.lineHeight() * 1.5;
var width = rect.width - x - this.textPadding();
this.changeTextColor(this.systemColor());
this.drawText("LV",x,y + 32 * 1,64,"left")
this.drawText("HP",x,y + 32 * 2,64,"left")
this.drawText("TP",x,y + 32 * 3,80)
this.drawText("Atk",x + 130,y + 32 * 1,64,"left")
this.drawText("Def",x + 130,y + 32 * 2,64,"left")
this.drawText("Mat",x + 130,y + 32 * 3,80)
this.drawText("Mdf",x + 260,y + 32 * 1,64,"left")
this.drawText("Agi",x + 260,y + 32 * 2,64,"left")
this.drawText("Luk",x + 260,y + 32 * 3,80)
this.changeTextColor(this.normalColor());
this.drawText(actor.name(),x,y)
this.drawText(actor.level,x,y + 32 * 1,80,"right")
this.drawText(actor.mhp,x,y + 32 * 2,80,"right")
this.drawText(actor.mtp,x,y + 32 * 3,80,"right")
this.drawText(actor.atk ,x + 130,y + 32 * 1,80,"right")
this.drawText(actor.def,x+ 130,y + 32 * 2,80,"right")
this.drawText(actor.mat,x + 130,y + 32 * 3,80,"right")
this.drawText(actor.mdf ,x + 260,y + 32 * 1,80,"right")
this.drawText(actor.agi,x+ 260,y + 32 * 2,80,"right")
this.drawText(actor.luk,x + 260,y + 32 * 3,80,"right")
};
I am wondering if part of the problem is if I'm using the wrong code for TP or had looked over a particular string of code. As far as I'm aware, TP values are denoted with ".tp" and ".mtp" for max TP. I've unfortunately had some trouble verifying this as there isn't a lot documented on TP online since very few people seem to care for it.
Thank you very much.