- Joined
- Jul 7, 2016
- Messages
- 17
- Reaction score
- 3
- First Language
- English
- Primarily Uses
Hello every one, I've just started learning how to make my own pluguins and I've found a trouble I can't bypass.
What I'm trying to do is to create a window in the Battle Scene that shows the States that the main actor is suffering.
The problem is that I don't know how to create a window in the battle scene, I don't know what I'm doing wrong.
Let's say that this is a the window. Is a clone of the Action Command Window, I've only replaced the name for Actor State.
But the thing is that I don't know how to call the window to be allways present in the screen.
I've tried this:
But nothing works.
Can somebody please help me.
I'm a total noob and maybe I'm comiting all kind of mistakes, please be gentle.
Thank you in advance.
What I'm trying to do is to create a window in the Battle Scene that shows the States that the main actor is suffering.
The problem is that I don't know how to create a window in the battle scene, I don't know what I'm doing wrong.
Code:
function Window_ActorState() {
this.initialize.apply(this, arguments);
}
Window_ActorState.prototype = Object.create(Window_Command.prototype);
Window_ActorState.prototype.constructor = Window_ActorState;
Window_ActorState.prototype.initialize = function() {
var y = Graphics.boxHeight - this.windowHeight();
Window_Command.prototype.initialize.call(this, 0, y);
this.openness = 0;
this.deactivate();
this._actor = null;
};
Window_ActorState.prototype.windowWidth = function() {
return 192;
};
Window_ActorState.prototype.numVisibleRows = function() {
return 4;
};
Window_ActorState.prototype.makeCommandList = function() {
if (this._actor) {
this.addAttackCommand();
this.addSkillCommands();
this.addGuardCommand();
this.addItemCommand();
}
};
Window_ActorState.prototype.addAttackCommand = function() {
this.addCommand(TextManager.attack, 'attack', this._actor.canAttack());
};
Window_ActorState.prototype.addSkillCommands = function() {
var skillTypes = this._actor.addedSkillTypes();
skillTypes.sort(function(a, b) {
return a - b;
});
skillTypes.forEach(function(stypeId) {
var name = $dataSystem.skillTypes[stypeId];
this.addCommand(name, 'skill', true, stypeId);
}, this);
};
Window_ActorState.prototype.addGuardCommand = function() {
this.addCommand(TextManager.guard, 'guard', this._actor.canGuard());
};
Window_ActorState.prototype.addItemCommand = function() {
this.addCommand(TextManager.item, 'item');
};
Window_ActorState.prototype.setup = function(actor) {
this._actor = actor;
this.clearCommandList();
this.makeCommandList();
this.refresh();
this.selectLast();
this.activate();
this.open();
};
Window_ActorState.prototype.processOk = function() {
if (this._actor) {
if (ConfigManager.commandRemember) {
this._actor.setLastCommandSymbol(this.currentSymbol());
} else {
this._actor.setLastCommandSymbol('');
}
}
Window_Command.prototype.processOk.call(this);
};
Window_ActorState.prototype.selectLast = function() {
this.select(0);
if (this._actor && ConfigManager.commandRemember) {
var symbol = this._actor.lastCommandSymbol();
this.selectSymbol(symbol);
if (symbol === 'skill') {
var skill = this._actor.lastBattleSkill();
if (skill) {
this.selectExt(skill.stypeId);
}
}
}
};
But the thing is that I don't know how to call the window to be allways present in the screen.
I've tried this:
Code:
var old_createAllWindows = Scene_Battle.prototype.createAllWindows
Scene_Battle.prototype.createAllWindows = function() {
old_createAllWindows.call(this)
this.createActorStateWindow();
};
Scene_Battle.prototype.createActorStateWindow = function() {
this._actorStateWindow = new Window_ActorState();
this.addWindow(this._actorStateWindow);
};
Scene_Battle.prototype.isAnyInputWindowActive = function() {
return (this._partyCommandWindow.active ||
this._actorCommandWindow.active ||
this._skillWindow.active ||
this._actorStateWindow.active ||
this._itemWindow.active ||
this._actorWindow.active ||
this._enemyWindow.active);
};
Can somebody please help me.
I'm a total noob and maybe I'm comiting all kind of mistakes, please be gentle.
Thank you in advance.
Last edited:

