Hi, I'm using a script from this forum to insert the target's name in skill messages.
The problem is that whenever the skill has multiple targets "Type Error: undefined is not a function" shows up.
I tried to get around the issue by not using "%2" in the message for the skill but it still crashes.
I'd be really grateful if someone could code the script so that when there are multiple targets it, at least, doesn't crash. I don't need it to find all the target names and list them out.
Here is the code I'm using (by Rexal):
The problem is that whenever the skill has multiple targets "Type Error: undefined is not a function" shows up.
I tried to get around the issue by not using "%2" in the message for the skill but it still crashes.
I'd be really grateful if someone could code the script so that when there are multiple targets it, at least, doesn't crash. I don't need it to find all the target names and list them out.
Here is the code I'm using (by Rexal):
Code:
Window_BattleLog.prototype.startAction = function(subject, action, targets) {var item = action.item();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,targets);};Window_BattleLog.prototype.displayAction = function(subject, item,targets) {var numMethods = this._methods.length; var target = ""; for(var i = 0; i<targets.length-1; i++){ if(i!=0)target += ', '+ targets.name(); else target += targets.name() + " "; } if(targets.length!=1)target += 'and ' + targets[targets.length-1].name(); else target += targets[0].name(); if (DataManager.isSkill(item)) {if (item.message1) {this.push('addText', subject.name() + item.message1.format(item.name,target));}if (item.message2) {this.push('addText', item.message2.format(item.name,target));}} else {this.push('addText', TextManager.useItem.format(subject.name(), item.name,target));}if (this._methods.length === numMethods) {this.push('wait');}};
if(Imported.YEP_BattleEngineCore){ BattleManager.actionDisplayAction = function() { this._logWindow.displayAction(this._subject, this._action.item(), this._targets); return false;};Window_BattleLog.prototype.startAction = function(subject, action, targets) {};Yanfly.BEC.Window_BattleLog_displayAction = Window_BattleLog.prototype.displayAction;Window_BattleLog.prototype.displayAction = function(subject, item,targets) { if (eval(Yanfly.Param.BECFullActText)) { Yanfly.BEC.Window_BattleLog_displayAction.call(this, subject, item,targets); } else { this._actionIcon = item.iconIndex; this.push('addText', '<SIMPLE>' + item.name); if (item.message2) { this.push('addText', '<CENTER>' + item.message2.format(item.name)); } }};}