Anyone know how to make Skills in Database show target name in the battle log?

Status
Not open for further replies.

marcelox

Painfully Clueless
Veteran
Joined
Oct 25, 2015
Messages
86
Reaction score
14
First Language
English
Hi,

I'm making skills in the Database and I need some help with the Message coding. Normally a cure spell would have this in the Message part:

casts %1!

which says "...casts Cure!" in the battle

But I want to make something like:

casts %1 and (blank) recovers HP!

and I want (blank) to say the name of the character or enemy that the spell is being cast on. I tried using %2 instead of (blank) but that didn't work. Anyone know what %1 or whatever will make the game say the name of the target in the battle log?

Thanks :)
 
Last edited by a moderator:

Rexal

Digital Fuzzball
Veteran
Joined
Oct 27, 2015
Messages
141
Reaction score
262
First Language
C#
Primarily Uses
RMMV
By itself, MV doesn't allow this. but with a little bit of coding...

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');}}; Just use %2 and it'll say the name of all battlers being affected now.
 

marcelox

Painfully Clueless
Veteran
Joined
Oct 25, 2015
Messages
86
Reaction score
14
First Language
English
By itself, MV doesn't allow this. but with a little bit of coding...

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');}}; Just use %2 and it'll say the name of all battlers being affected now.


Hi, thanks for this. I made this into a js and activated it. Then I changed the battle messages to include %2 and then I tried a battle, as soon as I used the spell with %2 in it, it gave me this error: 

TypeError

Cannot read property 'length' of undefined
 

Rexal

Digital Fuzzball
Veteran
Joined
Oct 27, 2015
Messages
141
Reaction score
262
First Language
C#
Primarily Uses
RMMV
...I really need to start testing things with Yanfly's plugins. It works fine without, but with throws the error. Give me a bit, I'll make it compatible.

EDIT- Here. Just add this to the bottom of the plugin you made and it should work:

Code:
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));      }    }};}
 
Last edited by a moderator:

Nomi

Veteran
Veteran
Joined
Dec 16, 2014
Messages
156
Reaction score
48
First Language
German
Hi there... I feel like a grave digger. But I need exactly that! The name of a target enemy. (to implement it as a actor name :x)

I made this into a js and activated it.


Sadly that kicked me out :/ Could u give me that js script? I tried to just copy it in a txt and load...but that didnt work :(


Maybe you could tell me "how" to kame it to a js script - that would possibly be even more worth then the js script.


Thanks a lot!


edit: Nevermind - just had to restart the maker.
 
Last edited by a moderator:

CardWielder

Villager
Member
Joined
Jul 29, 2014
Messages
19
Reaction score
0
First Language
English
Primarily Uses
So I found this plugin and I have to say, thank you very much for making it!

However, I found that it doesn't seem to like skills that target your whole team for say a buff skill, even when I'm not using %2 anywhere in the skill, here is a screen shot of the error file I get. I've had to censor out some of the folder names due to privacy issues, but the error messages should be easy enough read.
Error File.png
I am hoping that someone is able to point me in the right direction to fix this problem, as the only solution I have for now is to never have any skills that target the entire friendly team :(
 

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
2,617
Reaction score
3,790
First Language
English
Primarily Uses
RMMV

@CardWielder , please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.


If you have a particular question you can create a new thread and ask it. Thank you.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Making it a rule that I don't do any world building for my new game before the actual gameplay is concrete and working. I have 16 years of lore to work with anyway.
Cheesy power metal makes everything better. No matter what you do, you'll feel heroic doing it.
Starting to really like the first of my madness areas. I think the eyes looking at them really helps to sell the place. :LZSexcite:
Made idle animation for character. It first had only three frames but looked too different from walking animation and I had to draw five more.
MV and VX Ace both have good qualities.

Forum statistics

Threads
95,694
Messages
931,071
Members
126,032
Latest member
MadAtticGames
Top