MZ Help with custom skill names. [Solved]

Hey there,
I'm trying to make a simple system where players can name skills they come across in the world.
I do this by prompting them to type in a name for their skill and then set the skill as that name.

My problem comes from trying to use a variable in the name of a skill. When I see it in the database to use the call function for the skill, it force sets it as a string and ignores the call. Ending up with this funny bug where it shows the call for the variable without calling it.

Is it possible to set a skill name as a variable without forcing it into a string?
I am doing this with VisuMZ but I don't think this is the source of my problem since a clean project also has this same bug.


Another solution would be to change the name of the skill itself like:

$gameSkill(1).setName(variable here);

But unfortunately I don't see anything like this in the SC bible.

I tried looking for a plugin/script for this, but I've come up empty handed.

Any help is much appreciated.

Yes, I tried \v[201] as well, It didn't work either.
\V[201] will work if we switch the text drawing function used by Skill from drawText to drawTextEx.

JavaScript:
Window_SkillList.prototype.drawItemName = function(item, x, y, width) {
    if (item) {
        const iconY = y + (this.lineHeight() - ImageManager.iconHeight) / 2;
        const delta = ImageManager.standardIconWidth - ImageManager.iconWidth;
        const textMargin = ImageManager.standardIconWidth + 4;
        const itemWidth = Math.max(0, width - textMargin);
        this.resetTextColor();
        this.drawIcon(item.iconIndex, x + delta / 2, iconY);
        this.drawTextEx(item.name, x + textMargin, y, itemWidth);
    }
};

The above code just overrides the default functionality and changes one line. Save the above code as a .js file and install it as a plugin.
1765098016579.png

1765097974335.png

1765097999279.png


I have not tested compatibility with Visustella but it works on a blank project
\V[201] will work if we switch the text drawing function used by Skill from drawText to drawTextEx.

JavaScript:
Window_SkillList.prototype.drawItemName = function(item, x, y, width) {
    if (item) {
        const iconY = y + (this.lineHeight() - ImageManager.iconHeight) / 2;
        const delta = ImageManager.standardIconWidth - ImageManager.iconWidth;
        const textMargin = ImageManager.standardIconWidth + 4;
        const itemWidth = Math.max(0, width - textMargin);
        this.resetTextColor();
        this.drawIcon(item.iconIndex, x + delta / 2, iconY);
        this.drawTextEx(item.name, x + textMargin, y, itemWidth);
    }
};

The above code just overrides the default functionality and changes one line. Save the above code as a .js file and install it as a plugin.
View attachment 354500
View attachment 354498
View attachment 354499

I have not tested compatibility with Visustella but it works on a blank project
It works flawlessly! This should be a base feature and not require a plugin.

Thankyou so much. This solves my problem.
This should be a base feature and not require a plugin.
The reason why drawTextEx is used mostly for messages is because the computer has to do extra work to make all the text effects work. Something as basic as text align or being able to squish text to force it to fit inside a space isn't possible without the computer drawing the text with drawTextEx, measuring its dimensions, then drawing it again. More features = your game runs slower. If it goes past a critical threshold, you start seeing lag.

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/help-with-custom-skill-names-solved.181329/