New account registration is temporarily disabled.

[RMMV] CUSTOM GAUGES FOR ATB, IS IT POSSIBLE?

Posts

Pages: 1
Though I've fiddled with other battle systems, even going as far to spent $ on Olivia's OTB script as part of her fantastic OctoPack, nothing beats the nostalgic thrill of a good ATB system for me. Potentially Yanfly, even though it's not supported any more, but There Are Options.

Here's the rub tho: To do an ATB with my hand-ripped retro graphics, I need a plugin that replaces the default gauges with a custom image. I have no idea how to do this. Shaz made a plugin that replaces the default gauges with custom images, but it was made for a specific project, and I can't even get it to work for that.

Can this be done, or am I like Icarus pushing my ball of wax too close to the sun?
Overthinking this. Many of the RpgMaker ATB gauges are done with graphics, not plugins. Plugins are only needed if you're doing something strange like a pie chart ATB and having it fill in a circle instead of straight line.

On Rpgmaker 2k3, I just now did this. Took maybe 15 minutes to figure out the vertical and horizontal dimensions.



The first half of the gauge fills up, then it switches to the rotated. Simple.

Stop relying on plugins, and get out the art tools.
Hrm. Definitely something I know how to do with rm2k3, still muddy on where this is on how to do this with the RMMV systems sheet. But 'get out the art tools' is definitely my preferred direction. Oh well, all things yield to pressure.
You need to look at the function "draw_gauge" in Window_Base.
As mentioned in your linked thread, Yanfly core engine overwrites it with their own version. So any plugin of yours to change it needs to go after Yanfly's.

The original version is simpler to understand:
Window_Base.prototype.drawGauge = function(x, y, width, rate, color1, color2) {
    var fillW = Math.floor(width * rate);
    var gaugeY = y + this.lineHeight() - 8;
    this.contents.fillRect(x, gaugeY, width, 6, this.gaugeBackColor());
    this.contents.gradientFillRect(x, gaugeY, fillW, 6, color1, color2);
};


x,y are the screen position of the gauge, and width is the width in pixels
rate is the percentage full (as a number between 0 and 1)
color1 and color2 are the window skin colours used for the gradient.
This default implementation fixes the height as 6 pixels, aligned 8 pixels above the bottom of the line.

But you don't want any of that, so instead of the fillRect and gradientFillRect, you'll be copying from your bitmap. Probably using bitmap.blt()

Or you could draw them procedurally as a few rectangles if you preferred.
author=coelocanth
You need to look at the function "draw_gauge" in Window_Base.
As mentioned in your linked thread, Yanfly core engine overwrites it with their own version. So any plugin of yours to change it needs to go after Yanfly's.

The original version is simpler to understand:
Window_Base.prototype.drawGauge = function(x, y, width, rate, color1, color2) {
    var fillW = Math.floor(width * rate);
    var gaugeY = y + this.lineHeight() - 8;
    this.contents.fillRect(x, gaugeY, width, 6, this.gaugeBackColor());
    this.contents.gradientFillRect(x, gaugeY, fillW, 6, color1, color2);
};


x,y are the screen position of the gauge, and width is the width in pixels
rate is the percentage full (as a number between 0 and 1)
color1 and color2 are the window skin colours used for the gradient.
This default implementation fixes the height as 6 pixels, aligned 8 pixels above the bottom of the line.

But you don't want any of that, so instead of the fillRect and gradientFillRect, you'll be copying from your bitmap. Probably using bitmap.blt()

Or you could draw them procedurally as a few rectangles if you preferred.


Thank you kindly person! Seriously considering naming my first child (or more likely, second dog) Coelacanth right now.

I'm probably going to give every ATB a try by I'm done with this. I'll be honest tho that I don't know the first thing about creating a snippet like that. Leaving the issue of custom bars along for the moment, by editing this in the Windows_Base I would be able to use my own custom graphics for the default gauges? That alone would be useful.
Yes, all the default bars go through this function.
Most of yanfly's plugins do too (but with their re-implementation in YEP_core), just with different colour values.
So the one place would be able to reskin all of them.
If you're adding surrounding graphics like the gold frames in Bulma's post, you'd have to watch out for stacked bars like the barrier script if you're using that.

If you wanted to check if custom gauges are using the same function quickly, do something like changing the 6 to 3 in the gradientFillRect line.

That would give quite ugly half height gauges on a full height background for anything using the standard function to draw a gauge. Anything that doesn't change is using its own code.

Also, Moghunter has made a number of plugins for re-skinning bits of the UI which might help in your quest.
e.g. https://atelierrgss.wordpress.com/rmv-hp-gauge/
https://atelierrgss.wordpress.com/rmv-battle-hud/

(I haven't personally used these plugins, but I've seen a few games that do)
author=coelocanth
Also, Moghunter has made a number of plugins for re-skinning bits of the UI which might help in your quest.
e.g. https://atelierrgss.wordpress.com/rmv-hp-gauge/
https://atelierrgss.wordpress.com/rmv-battle-hud/

(I haven't personally used these plugins, but I've seen a few games that do)


I've played around with these and they're really fantastic, although, like so many top-notch plugins out there, they're designed around the author's vision. That's not a bad thing, in fact it's a great one, but it means you can't use them if they don't sync up with specifically what you're trying to do. Frustrating, because the elements I need are there, but I don't have the expertise to find and replicate them. Oh well, so far I've made everything else work with patience, persistence, and next to no real understand of what I'm doing, so I'll get this. :)
author=nemojbatkastle
Thank you kindly person! Seriously considering naming my first child (or more likely, second dog) Coelacanth right now.


Never name your child Coelacanth. They'll wind up looking like this.

author=bulmabriefs144
author=nemojbatkastle
Thank you kindly person! Seriously considering naming my first child (or more likely, second dog) Coelacanth right now.
Never name your child Coelacanth. They'll wind up looking like this.



That's my uncle in the picture.
Pages: 1