if (!eval(paramTpHideValues)) {
this.contents.fontSize = eval(paramCurrentValueFontSize);
this.changeTextColor(this.tpColor(actor));
this.drawText(actor.tp+"%", eval(paramTpValuesX), eval(paramTpValuesY), eval(paramTpValuesWidth), paramTpValuesAlignment);
this.contents.fontSize = Yanfly.Param.BSWParamFontSize;
}
Is there any reason you can't use this.contents.fontFace?(MV)
Hey y'all.
I'm using DreamX's extension to the Yanfly battle status window and I have everything *mostly* tuned how I want, but I'm having a little trouble with a specific edit.
Currently I have my TP bar set up like this:
![]()
Essentially all I want to do is manipulate the font for the TP value, by changing the face.
In the plugin, the method used to draw the TP value is as follows:
JavaScript:if (!eval(paramTpHideValues)) { this.contents.fontSize = eval(paramCurrentValueFontSize); this.changeTextColor(this.tpColor(actor)); this.drawText(actor.tp+"%", eval(paramTpValuesX), eval(paramTpValuesY), eval(paramTpValuesWidth), paramTpValuesAlignment); this.contents.fontSize = Yanfly.Param.BSWParamFontSize; }
All I want to do is change the font face before drawText() executes, and then revert it back after drawText() executes (if necessary), but I'm having a little trouble getting that to work. This is built on the Yanfly Core and Yanfly Battle Core plugins, so if there's a function or property within Yanfly MV that can perform this, that'd also work fine.
Any help is appreciated.
The face you're using might size itself differently than the one that was being used before, so you may have to make the size bigger with the new one.View attachment 210359
Good question. That's what I tried initially but it always resulted in this, and I have no idea why.
They're from the same font family so I'd be surprised, but more relevantly, even if I change the font size (this.content.fontSize) right after changing the font, nothing changes.The face you're using might size itself differently than the one that was being used before, so you may have to make the size bigger with the new one.
I'm using Noto Sans Mono Regular as my basic font for values, and I'm trying to change to Noto Sans Mono Black. But the same thing happens even if I try to change to a font such as Arial.What face did you try changing to?
Thank you so much, yeah this worked perfectly!Well, if it is on item 101, then it would be: $dataItems[101].meta.note.split(","). Alternatively $dataItems[101].meta["note"].split(","). If the note name has a space in it, you'll need to use the later version.
I am very sure that "meta" is part of RTP... If it's not get back to me
Holy god, you have a thousand states? Anyhow...Now all I need is to replace the number 500 with a range of 500-1000
if (this.states().some(element => element.id>499 && element.id<1001))
Unfortunately this doesn't seem to work. Although I have very little coding knowledge so maybe I just don't know how to copy your line in properly.Holy god, you have a thousand states? Anyhow...
if (this.states().some(element => element.id>499 && element.id<1001))
should work for your condition.
I missed the part where you wanted to get the actor of the matching ID.Unfortunately this doesn't seem to work. Although I have very little coding knowledge so maybe I just don't know how to copy your line in properly.
if (this.isActor())
{
var index=-1;
if ((index=this.states().find(element => element.id>499 && element.id<1001))>-1)
battler=$dataActors[index];
else
Unfortunately this didn't work either, but I think I made some progress.I missed the part where you wanted to get the actor of the matching ID.
The problem with what you're asking for is that (unless you have some very strict system with these) there is a possibility that the actor will have more than one state in that range. How should this get resolved in those cases?
Aside from that, this will do what you're asking for.
Code:if (this.isActor()) { var index=-1; if ((index=this.states().find(element => element.id>499 && element.id<1001))>-1) battler=$dataActors[index]; else
The code from ATT_Turan did not work, because the find function does not return the index of the object in the array, but the object itself. It does return undefined, if the object cannot be found. The following amended version should work a little better:Unfortunately this didn't work either, but I think I made some progress.
I rewrote the code this way and it works like it used to while I give the index variable any of my rigged state ids.
if (this.isActor()) {
var index=500;
if (this.isStateAffected(index)) {
battler = $dataActors[index];
} else {
I spent a couple of hours trying to put the index variable into a range of 500-1000 with all kinds of brackets, but nothing works.
if( this.isActor() )
{
const firstAffectedStateInRange = this.states().find(element => element.id > 499 && element.id < 1001);
if( firstAffectedStateInRange !== undefined )
{
battler = $dataActors[firstAffectedStateInRange.id];
}
else
{
}
}
Took me a minute to rearrange the brackets, all the while the game kept crashing at battle, but in the end it began to work, all tests passed. And there I though this would be a really simple fix.The code from ATT_Turan did not work, because the find function does not return the index of the object in the array, but the object itself. It does return undefined, if the object cannot be found. The following amended version should work a little better:
JavaScript:if( this.isActor() ) { const firstAffectedStateInRange = this.states().find(element => element.id > 499 && element.id < 1001); if( firstAffectedStateInRange !== undefined ) { battler = $dataActors[firstAffectedStateInRange.id]; } else { } }