RMMV YEP_SegmentedGauges and YEP_AbsorbtionBarrier creates false segments for the barrier.

HornsterLG

Veteran
Veteran
Joined
Dec 19, 2021
Messages
88
Reaction score
23
First Language
german
Primarily Uses
RMMV
YepSegmentedGauges and YEPAbsorbtionBarrier visual barrier bug.png
It should draw a segment every 250hp. And it actually works: "William 4" has 18 segments (4500 / 250), just like "William 2". BUT "William 4" also has a barrier of 2500 points. And the barrier should have either no segments, or preferably 10 segments. But it only has 6,5 segments which is completely wrong and misleading. The Plugins don't even recognize the barrier and just draws the segments-width as if the barrier wouldn't exist and as if "William 4" still only had 4500 hp.

The $gameTroop.members()[1] has a barrier of 500 points, which should have 2 segments, but it hasn't.
 

HornsterLG

Veteran
Veteran
Joined
Dec 19, 2021
Messages
88
Reaction score
23
First Language
german
Primarily Uses
RMMV
here is the fix:
YEP_SegmentedGauges line 263:
function(dx, dy, dw, rate, color1, color2, originalWidth) {

YEP_SegmentedGauges line 266:
this.drawGaugeSegments(dx, dy, dw, 0, 1, originalWidth);

YEP_SegmentedGauges line 164:
Window_Base.prototype.drawGauge = function(dx, dy, dw, rate, color1, color2, originalWidth) {

line 166:
this.drawGaugeSegments(dx, dy, dw, 0, 0, originalWidth);

line 169:
Code:
Window_Base.prototype.drawGaugeSegments = function(dx, dy, dw, xB, yB, originalWidth) {                // this is my drawGaugeSegments function
  var segments = this._gaugeSegments;
  if (segments) {
    var originalX = dx;
    var originalW = dw;
    var gaugeH = this.gaugeHeight() - 2;
    var gaugeY = dy + this.lineHeight() - gaugeH - 2 + yB;   
    if (this.isGaugeOutline()) {
      dx += 1;
      dw -= 2;
      gaugeY -= 2;
    }   
    dx += xB;
    var segmentsToUse = segments * (dw / originalWidth || 1);
    var segmentWidth = Math.round(dw / segmentsToUse);                                
    if (segmentWidth > 1) {
      var color = this.gaugeBackColor();
      for (var i = 1; i < segments; ++i) {
        dx += segmentWidth;
        if (dx > originalX + originalW) return;
        this.contents.fillRect(dx, gaugeY, 1, gaugeH, color);
      }
    }
  }
};

line 136:
this.setGaugeSegments((actor.mhp + actor.barrierPoints()) / (Yanfly.Param.SegmentGaugesHp));

YEP_AbsorptionBarrier line 1434:
Code:
Window_Base.prototype.drawBarrierGauge = function(actor, wx, wy, ww) {
    var max = actor.mhp + actor.barrierPoints();
    var rate1 = actor.mhp / max;
    var ww2 = ww * rate1;          
    var wxbarrier = wx + ww2;                          
    var wwbarrier = ww - wxbarrier + 1;//+ 7;                       
    if (actor.isActor()) wwbarrier = ww - wxbarrier + 7;
    var rate2 = (actor.barrierPoints() + actor.mhp) / max;
    var color1 = this.barrierColor1();
    var color2 = this.barrierColor2();
    this.drawGauge(wxbarrier, wy, wwbarrier, rate2, color1, color2, ww);   
    var color1 = this.hpGaugeColor1();
    var color2 = this.hpGaugeColor2();
    this.drawGauge(wx, wy, ww2, actor.hpRate(), color1, color2, ww);
    return ww;
};

at this point Yanfly should hire me as his bug fixer...
 

Latest Threads

Latest Profile Posts

working on an A/V sync system for my game! was NOT expecting the first roadblock to be accessing a variable from a public class!! Computers are so finicky sometimes :kaosigh:
For the first real time since my game's inception I found myself actually having fun playing around with my party's skills while testing out some battles! So much so, that I actually forgot what I was doing for a minute and had to force myself to move on to the next thing! :guffaw:

That's got to be a good sign considering it only has place holder animations, enemy skills, troop comps, etc. right now. Feels good!
Bex
Finally upgraded to RMMZ.
ScreenShot_11_28_2022_7_52_34.png
FINALLY, I figured out how to get the "tail" to appear IN the window and not directly below it lol. now it looks like it's part of the window and not hanging from the bottom of it.
Twitch! Stream is about to go live with some Dark Souls 2! Feel free to drop by!

Forum statistics

Threads
126,925
Messages
1,182,399
Members
166,755
Latest member
Hahah520
Top