Yanfly Actor Variables show as % ?

Hi!
Can somebody make an addon for yanflys actor variables
( http://yanfly.moe/2015/12/10/yep-41-actor-variables/ )
to show specific variables as % ?
Well basically not show as a % (as in dividing it by 100) but just add a % to the formatting at the end.
At the moment I solved the problem with naming my variables with a (%) - but it would be nice if I could add the
% sign after the number.
34cfcebdc5.png

I need the option to specify which variables should show % because I also have
Strength, Intelligence, Dexterity defined as variables - and these are not % based parameters.

😅~ Benji
Maybe adding one line could help. Simply edit the js file, no need for addons.
Spoiler: old code passage
Window_StatusInfo.prototype.drawActorVarData = function(varId, dx, dy, dw) {
varId = parseInt(varId);
var name = $dataSystem.variables[varId];
var value = $gameVariables.value(varId);
dx += this.textPadding();
dw -= this.textPadding() * 2;
this._bypassResetTextColor = true;
this.changeTextColor(this.systemColor());
name = name.replace(/<<(.*?)>>/i, '');
this.drawTextEx(name, dx, dy);
this._bypassResetTextColor = false;
this.resetTextColor();
if (typeof value === 'number') value = Yanfly.Util.toGroup(value);
this.drawText(value, dx, dy, dw, 'right');
};
Spoiler: new code passage
Window_StatusInfo.prototype.drawActorVarData = function(varId, dx, dy, dw) {
varId = parseInt(varId);
var name = $dataSystem.variables[varId];
var value = $gameVariables.value(varId);
dx += this.textPadding();
dw -= this.textPadding() * 2;
this._bypassResetTextColor = true;
this.changeTextColor(this.systemColor());
name = name.replace(/<<(.*?)>>/i, '');
this.drawTextEx(name, dx, dy);
this._bypassResetTextColor = false;
this.resetTextColor();
if (typeof value === 'number') value = Yanfly.Util.toGroup(value);
this.drawText(value, dx-10, dy-10, dw, 'right');
this.drawText("%", dx, dy, dw, "right").
};
It works, but it still shows the % sign for all of the variables now.
Can I somehow define which variable IDs should get displayed with % ?
Because some of my "custom" stats are not % based.
Edit1:
I fooled abit around with it myself and I kinda could get it to work.
I deleted it already because it actually wasn't working (while it was)
but it was something along the lines of adding:
Code:
if (name.contains("(%)")
this.drawText("%", dx, dy, dw, "right");
I thought, maybe with the option of the plugin to hide parts of the variable with <<DERP>> , I could this way "mark" the variables which get the % sign, but as soon as I hide the (%) with <<(%)>> it doesn't work anymore.
Mabye I can somehow make a parameter in which I can put all variable IDs and then check if one of the variables is in that parameter and then add the % sign?

Edit2:
So, a youtube video explained me how to make a parameter... kind of.
I added
Code:
 * @param Mark with %
 * @desc Marks the variable with a % sign when displayed in status menu.
In the top, and then I added
Code:
Yanfly.Param.AVarPercentage = String(Yanfly.Parameters['Mark with %']); //Benji Edit
At the Parameter Variables section.
Now I am kinda stuck... is it ok to have these IDs in a string or do they need to be an array? How can I even check the parameter now ... :< I feel so close 😀
Here's a small snippet I attached to this post that'll do the trick. Place it as a plugin below the Actor Variables Plugin.

In the variables you want to show a percentage sign, add a {%} sign to its name (this will not be shown in the displayed name).

So your variable 'Lightning Rate' would be written as '{%}Lightning Rate' for it show a percentage sign.


Also on a side note. The code you tried:

Code:
if (name.contains("(%)")
this.drawText("%", dx, dy, dw, "right");

This was almost correct. You missed an end bracket which basically crashed the code.

Code:
if (name.contains("(%)")) this.drawText("%", dx, dy, dw, "right");

Stuff like that tends to happen a lot :kaolivid:. But hey, at least you tried!
Yeah , I am pretty proud of myself for figuring out the if condition 🙂 learning along with my requests.
Thanks so much for helping me out yet again :>
👍 (SideNote: Will only be able to test it when I get on PC - atm on mobile!)

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-actor-variables-show-as.80129/