- Joined
- Sep 14, 2016
- Messages
- 392
- Reaction score
- 76
- First Language
- English
- Primarily Uses
UPDATE: I solved the actor notetag issue, but I forgot I needed to check for skill notetags, too.
This is the code I currently have, courtesy of @Kino:
Window_BattleLog.prototype.initialize = function() {
var width = this.windowWidth();
var height = this.windowHeight();
Window_Selectable.prototype.initialize.call(this, 0, 0, width, height);
this.opacity = 0;
this._lines = [];
this._methods = [];
this._waitCount = 0;
this._waitMode = '';
this._baseLineStack = [];
this._actor = null; //Added new this._actor property to the prototype, but you still need to assign what actor is somewhere down the line
this._spriteset = null;
this.createBackBitmap();
this.createBackSprite();
this.refresh();
};
Window_BattleLog.prototype.startAction = function(subject, action, targets) {
var item = action.item();
//Check if subject is actor before assign this._actor
if(subject.isActor())
this._actor = subject;
if (this._actor && this._actor.actor().meta.TestTest) {
this.push('performActionStart', subject, action);
this.push('waitForMovement');
this.push('performAction', subject, action);
this.push('showAnimation', subject, targets.clone(), item.animationId);
this.displayAction(subject, item);
}
};
Window_BattleLog.prototype.endAction = function(subject) {
//Also checking is subject (one who is taking the action) is actor
if(subject.isActor())
this._actor = subject;
if (this._actor && this._actor.actor().meta.TestTest) {
this.push('waitForNewLine');
this.push('clear');
this.push('performActionEnd', subject);
}
};
Now I just need to do something similar, but check for a notetag on the skill being used and no the actor.
---
Previous post:
Pretty simple question. I'm trying to make this code check for a notetag. I got an error message saying "actor" is undefined. What do I need to add to make sure "actor" is defined properly?
I adapted it from this code, which works fine.
This is the code I currently have, courtesy of @Kino:
Window_BattleLog.prototype.initialize = function() {
var width = this.windowWidth();
var height = this.windowHeight();
Window_Selectable.prototype.initialize.call(this, 0, 0, width, height);
this.opacity = 0;
this._lines = [];
this._methods = [];
this._waitCount = 0;
this._waitMode = '';
this._baseLineStack = [];
this._actor = null; //Added new this._actor property to the prototype, but you still need to assign what actor is somewhere down the line
this._spriteset = null;
this.createBackBitmap();
this.createBackSprite();
this.refresh();
};
Window_BattleLog.prototype.startAction = function(subject, action, targets) {
var item = action.item();
//Check if subject is actor before assign this._actor
if(subject.isActor())
this._actor = subject;
if (this._actor && this._actor.actor().meta.TestTest) {
this.push('performActionStart', subject, action);
this.push('waitForMovement');
this.push('performAction', subject, action);
this.push('showAnimation', subject, targets.clone(), item.animationId);
this.displayAction(subject, item);
}
};
Window_BattleLog.prototype.endAction = function(subject) {
//Also checking is subject (one who is taking the action) is actor
if(subject.isActor())
this._actor = subject;
if (this._actor && this._actor.actor().meta.TestTest) {
this.push('waitForNewLine');
this.push('clear');
this.push('performActionEnd', subject);
}
};
Now I just need to do something similar, but check for a notetag on the skill being used and no the actor.
---
Previous post:
Window_BattleLog.prototype.startAction = function(subject, action, targets) {
var item = action.item();
if (this._actor.actor().meta.TestTest) {
this.push('performActionStart', subject, action);
this.push('waitForMovement');
this.push('performAction', subject, action);
this.push('showAnimation', subject, targets.clone(), item.animationId);
this.displayAction(subject, item);
}
};
Window_BattleLog.prototype.endAction = function(subject) {
if (this._actor.actor().meta.TestTest) {
this.push('waitForNewLine');
this.push('clear');
this.push('performActionEnd', subject);
}
};
var item = action.item();
if (this._actor.actor().meta.TestTest) {
this.push('performActionStart', subject, action);
this.push('waitForMovement');
this.push('performAction', subject, action);
this.push('showAnimation', subject, targets.clone(), item.animationId);
this.displayAction(subject, item);
}
};
Window_BattleLog.prototype.endAction = function(subject) {
if (this._actor.actor().meta.TestTest) {
this.push('waitForNewLine');
this.push('clear');
this.push('performActionEnd', subject);
}
};
Code:
Window_ActorCommand.prototype.makeCommandList = function() {
if (this._actor) {
this.addAttackCommand();
if (this._actor.actor().meta.moveGuard) {
this.addGuardCommand();
this.addSkillCommands();
} else {
this.addSkillCommands();
this.addGuardCommand();
}
this.addItemCommand();
}
};
Last edited by a moderator:

