Referencing the name of an actor in "Obtain Skill" message?

Hello everyone!

I have a question I hope someone can help me with. I tried searching on the forum in case someone else had already asked the same question, but I wasn't able to find anything.

I was wondering if there is a way to make the "Obtain Skill" message in the Terms Database tab reference the name of the actor that learned the skill, in addition to the name of the skill itself?
So instead of just a message like "Learned Blizzard!" I would like it to display "[Actor 1] learned Blizzard!"

Other messages do this by using the %1, %2, etc. formating. The "Use Item" message for example provides this possibilty (see reference image below).

Skärmbild 2024-11-25 174316.png


As you can also see in the image above I tried simply adding %2 into the text field, but then the actual message shown in-game became "[Skill name] mastered undefined!", so I realise that this issue isn´t as simple as I had hoped 😅

Skärmbild 2024-11-25 174351.png


If someone knows a way to solve this I would be very grateful. Thanks a lot in advance!
Paste the below into a text editor, save as a *.js file, include as a plugin.

Code:
Game_Actor.prototype.displayLevelUp = function(newSkills) {
    const text = TextManager.levelUp.format(
        this._name,
        TextManager.level,
        this._level
    );
    $gameMessage.newPage();
    $gameMessage.add(text);
    for (const skill of newSkills) {
        $gameMessage.add(TextManager.obtainSkill.format(this.name(), skill.name));
    }
};

That will make %1 refer to the actor and %2 the skill's name.
Thank you for your reply, I really appreciate you taking your time to help me!

The code worked, but unfortunately didn't help me with the reason I wanted to be able reference the actor name to begin with, ha ha. It did make me realise the issue isn't with RPG Maker's messages though.

I'm currently using Blue Coral Game's Equipment Skill System, in combination with New RPG Project's Victory Display Plugin and Level Up Parameter Display Plugin, and I've hade some issues with how the message when an actor learns skills from their equipment is displayed.

The problem is that it shows every "learned" skill in a single list at the last message of the battle. Durin most battles this would be fine, as it is displayed below the battle rewards (such as in the image below).

Skärmbild 2024-11-25 180348.png


However, if any character levels up, the skills learned from equipment will be displayed after that message, making it seem like that character has mastered those skills (even if it was another character).

Skärmbild 2024-11-25 180915.png


My idea was that if the message at least let the player know which character mastered which skill, it wouldn't really matter that much - hence my initial request.

What I found out when I added your code was that skills learned by levelling up worked perfectly (like you can see with the Strong Attack skill in the image above), but skills mastered from equipment doesn't (such as the HP+ skill).

If you have any ideas for a solution I'd be very grateful, but I realise this might require quite a bit more work than what I initially requested. If not, I'll see if I can work around the issue some other way.
Which of those three plugins actually makes the message about the skill that comes from equipment?
I'm pretty sure it's from the Equipment Skill System Plugin, as when I turn off the other two scripts I still get the message at the end of a battle:

Skärmbild 2024-11-25 193547.png
Okay, so open that up and on line 115 make the same change that I did above:
Code:
          $gameMessage.add(TextManager.obtainSkill.format(this.name(), $dataSkills[skillId].name));
That worked!!

Thanks a lot for all your help! I guess this thread can be considered solved then :ahappy:

Original thread: https://forums.rpgmakerweb.com/threads/referencing-the-name-of-an-actor-in-obtain-skill-message.173453/