Target Name in Battle Log?

Hi there!

I'm new to RPG Maker MV, so baby question™ incoming. I've been doing playing around with the program and here is my question: is there no way to define the targeted actor/enemy in the battle log? I saw one or two posts on the forum about it, but there was only one thread that had a solution. However, the bit of code that was posted was a hard for me to understand and I don't know how to implement it.

I want my tank to be at the top of the enmity list, so I want the flavor text to display the name.
Here is what I'm after below:
Example: Harold gestures aggressively at the False Idol.
The False Idol is now solely focused on Harold!

Here is the snippet of code that was posted in the other thread. And just below it is the added secondary note for those who use Yanfly's plugins. I'm very code inept so I have zero knowledge on how to organize it in order to make it work...

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

Could anyone possibly help me with this? It's been stumping me for a few days now.
I would be most grateful! ❤
@crouton I checked out the function that handles this (specifically, .format() under Window_BattleLog.prototype.displayAction()) for a few minutes. It's easy enough to grab the target's name, but based on my quick estimation of how it works, it didn't seem like a very flexible or workable solution to me.

If you want my advice, I wouldn't fight with the editor. Just work directly around it.

I know that you said you aren't good with code, but if you can deal with the "%1 uses whatever" formatting of the editor, you should be more than capable enough to save this as a .js file, install it as a plugin, and then open this in a text editor and configure it to your liking.

I can see this as probably not being as easy of a solution as you were hoping for. But if it helps, you're free to use it.

I forgot to add that this assumes that you only care about custom messages for single target skills. Multi-target skills get trickier, and I'm not sure if I want to throw my hat into that ring at this exact moment.

JavaScript:
//=============================================================================
// CustomSkillMessages.js
//=============================================================================
/*:
* @target MV
* @plugindesc v0.1
* @author Kenen @ RPGMakerWeb
* @help CustomSkillMessages.js
*
* A simple plugin to allow for custom formatting of specific skill messages.
*/
(() => {
// Start plugin
var customText = false;
    _alias_Window_BattleLog_displayAction =  Window_BattleLog.prototype.displayAction
    Window_BattleLog.prototype.displayAction = function(subject, item) {
        // Carrying this over from the default function; not sure what it does!
        var numMethods = this._methods.length;
        // Check if the current action is a skill and if you've configured custom text for it...
        if (DataManager.isSkill(item)) this.checkCustomText(subject, item);
        if (customText) {
            // I don't actually know what this does, but I'll include it to be safe
            if (this._methods.length === numMethods) {
                this.push('wait');
            }
            customText = false;
            return;
        }
        // ...Otherwise, use the default editor text
        _alias_Window_BattleLog_displayAction.call(this, subject, item)
    };
    Window_BattleLog.prototype.checkCustomText = function(subject, item) {
        // The user's name
        var subject = subject.name();
        // The target's name
        var target = BattleManager._targets[0].name();
        // Begin skill config; do not edit above this line
        // Start custom messages for skill id 11
        if (item.id === 11) {
            // This will print as "Harold gestures aggresively at the Slime A"
            var message1 = subject + " gestures aggressively at the " + target;
            // This will print as "The Slime A is now solely focused on Harold!"
            var message2 = "The " + target + " is now solely focused on " + subject + "!";
            customText = true;
        }
        // End custom messages for skill id 11
        // Repeat here for skills as desired, e.g. if (item.id === 12)
        // End skill config; do not edit below this line
        if (message1) this.push('addText', message1);
        if (message2) this.push('addText', message2);
    }
// End plugin
})();

Tested in a blank project:

rmmv.png
Also, just to offer a bit of clarification (because I was confused about what you wanted until I read the whole post) - the skill description would be what you see in your menu when you're selecting the skill. The bit you're talking about during combat is the battle log (as it says in the thread you linked to).
@crouton I checked out the function that handles this (specifically, .format() under Window_BattleLog.prototype.displayAction()) for a few minutes. It's easy enough to grab the target's name, but based on my quick estimation of how it works, it didn't seem like a very flexible or workable solution to me.

If you want my advice, I wouldn't fight with the editor. Just work directly around it.

I know that you said you aren't good with code, but if you can deal with the "%1 uses whatever" formatting of the editor, you should be more than capable enough to save this as a .js file, install it as a plugin, and then open this in a text editor and configure it to your liking.

I can see this as probably not being as easy of a solution as you were hoping for. But if it helps, you're free to use it.

I forgot to add that this assumes that you only care about custom messages for single target skills. Multi-target skills get trickier, and I'm not sure if I want to throw my hat into that ring at this exact moment.

<snip>

Ah, thank you so very much!!
This is exactly what I was looking for! You've been such an immense help, Kenen!

And yeah, it is as you said. I'm generally focused on single target skills so a message featuring multiple targets isn't necessary. I should be competent enough to make any changes needed, yes! I've done a bit more research on how this works, so I won't be needing any help on how to install/edit it in the long run.

Again, thank you!! ❤

Also, just to offer a bit of clarification (because I was confused about what you wanted until I read the whole post) - the skill description would be what you see in your menu when you're selecting the skill. The bit you're talking about during combat is the battle log (as it says in the thread you linked to).

Thank you for the correction. :>
I've edited my title and body with the proper terms, too.

Both of these replies have given me the answer I need.
This thread can be closed and marked as solved now!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/target-name-in-battle-log.138279/