RPG Maker Forums

Ok, so I'm having a lot of trubles traying to create a window that shows the actors gauges.

At first I creates a window and was able to show the gauges there, but the window simply was not working.
After going up and down the code, i've found that the window is not refreshing.

So, my window shows the gauges and Icons, so it behaves like the StatusBattleWindow. It should refresh every time it does, but I cant find how!

upload image

Here goes the full code:

Code:
function Window_ActorState() {
    this.initialize.apply(this, arguments);
}

Window_ActorState.prototype = Object.create(Window_Selectable.prototype);
Window_ActorState.prototype.constructor = Window_ActorState;

Window_ActorState.prototype.initialize = function() {
    var width = 800;
    var height = 200;
    var x = 0;
    var y = 0;
    Window_Selectable.prototype.initialize.call(this, x, y, width, height);
    this.refresh();
    this.openness = 0;
};

Window_ActorState.prototype.windowWidth = function() {
    return Graphics.boxWidth - 192;
};

Window_ActorState.prototype.windowHeight = function() {
    return this.fittingHeight(this.numVisibleRows());
};

Window_ActorState.prototype.numVisibleRows = function() {
    return 4;
};

Window_ActorState.prototype.maxItems = function() {
    return $gameParty.battleMembers().length;
};

Window_ActorState.prototype.refresh = function() {
    this.contents.clear();
    this.drawAllItems();
    console.log("aymama");
  
};

Window_ActorState.prototype.drawItem = function(index) {
    var actor = $gameParty.battleMembers()[index];
    this.drawBasicArea(this.basicAreaRect(index), actor);
    this.drawGaugeArea(this.gaugeAreaRect(index), actor);
};

Window_ActorState.prototype.basicAreaRect = function(index) {
    var rect = this.itemRectForText(index);
    rect.width -= 200;
    return rect;
};

Window_ActorState.prototype.gaugeAreaRect = function(index) {
    var rect = this.itemRectForText(index);
    rect.x += rect.width - this.gaugeAreaWidth();
    rect.width = this.gaugeAreaWidth();
    return rect;
};
Window_ActorState.prototype.gaugeAreaWidth = function() {
    return 330;
};

Window_ActorState.prototype.drawBasicArea = function(rect, actor) {
    this.drawActorIcons(actor, rect.x + 156, rect.y, rect.width - 156);
};

Window_ActorState.prototype.drawGaugeArea = function(rect, actor) {
    if ($dataSystem.optDisplayTp) {
        this.drawGaugeAreaWithTp(rect, actor);
    } else {
        this.drawGaugeAreaWithoutTp(rect, actor);
    }
};

Window_ActorState.prototype.drawGaugeAreaWithTp = function(rect, actor) {
    this.drawActorHp(actor, rect.x + 0, rect.y, 108);
    this.drawActorMp(actor, rect.x + 123, rect.y, 96);
    this.drawActorTp(actor, rect.x + 234, rect.y, 96);
};

Window_ActorState.prototype.drawGaugeAreaWithoutTp = function(rect, actor) {
    this.drawActorHp(actor, rect.x + 0, rect.y, 201);
    this.drawActorMp(actor, rect.x + 216,  rect.y, 114);
};




//=========================================================================

Scene_Battle.prototype.createAllWindows = function() {
    this.createLogWindow();
    this.createStatusWindow();
    this.createPartyCommandWindow();
    this.createActorCommandWindow();
    this.createHelpWindow();
    this.createSkillWindow();
    this.createItemWindow();
    this.createActorWindow();
    this.createEnemyWindow();
    this.createMessageWindow();
    this.createScrollTextWindow();
    this.createActorStateWindow();

};
Scene_Battle.prototype.createActorStateWindow = function() {
    this._actorStateWindow = new Window_ActorState();
    this.addWindow(this._actorStateWindow);
    this._actorStateWindow.open();
//sin esta línea no se abre la ventana
};

Scene_Battle.prototype.refreshStatus = function() {
    this._statusWindow.refresh();
    this._actorStateWindow.refresh();
    console.log("ole");

};



//=======================================================================

Window_BattleStatus.prototype.drawItem = function(index) {
    var actor = $gameParty.battleMembers()[index];
    this.drawBasicArea(this.basicAreaRect(index), actor);
};

Window_BattleStatus.prototype.drawBasicArea = function(rect, actor) {
    this.drawActorIcons(actor, rect.x + 156, rect.y, rect.width - 156);
};

Window_BattleStatus.prototype.refresh = function() {
    this.contents.clear();
    this.drawAllItems();
    console.log("ayprimo");
};
Can somebody help me?
Thanks in advance

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,454
Members
137,821
Latest member
Capterson
Top