RPG Maker Forums

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?

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);
}
};



I adapted it from this code, which works fine.

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();
    }
};

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,049
Messages
1,018,547
Members
137,835
Latest member
yetisteven
Top