MZ Battle Ressources Gauge As Icons (Custom Gauges)

Hello, SO I use VS SkillsStatesCore and I have something I would like to do but can't with this plugin. Basically I want to use Icons as a Gauge. There are 32 Classes in my game that play wildly differently from one another. Each class has its own mechanic and One Class (Marksman) uses Bullets each time they attack or Use as skill, They have a Pistol that has 5 Ammo(A) as a Ressources and Use A Rifle that has 1 Ammo(😎 has a ressource. SO I want to make a custom gauge That will be Icons for both instead of a gauge. It should look like this:

Gauge Icon.png


Where there would be icons to for when there is Ammo and No Ammo exactly like on the picture. Someone please help me.
You can set custom skill cost types as well as custom gauges using Skills States Core. Do you already have that in place? After that, it would be a matter of tweaking the "JS: Draw Gauge" for the bullets, which is admittedly a bit more involved, but making the costs themselves should be doable (you can use the included example for Potion or Item Cost as starting points).
You can set custom skill cost types as well as custom gauges using Skills States Core. Do you already have that in place? After that, it would be a matter of tweaking the "JS: Draw Gauge" for the bullets, which is admittedly a bit more involved, but making the costs themselves should be doable (you can use the included example for Potion or Item Cost as starting points).
Thanks but the skills cost type have all been done already. The only thing left is the gauge as I said. Also I don't know what JS: Draw Gauge is nor how to modify it. I was on hiatus for 2 years now, So I forgot a lot about RPG Maker.
The only thing left is the gauge as I said.
I’m sure you understand that there was no way for me to tell what stage you were at without seeing how you’ve implemented things. So please share how exactly you’ve implemented the costs. Also, please consider reviewing the support template to refresh your memory as to what is typically needed for effective support!

Also I don't know what JS: Draw Gauge is
It may not have been obvious but I sneakily linked to the wiki in my previous post. It should contain all the basics so perhaps rereading that might be helpful, too.
I’m sure you understand that there was no way for me to tell what stage you were at without seeing how you’ve implemented things. So please share how exactly you’ve implemented the costs. Also, please consider reviewing the support template to refresh your memory as to what is typically needed for effective support!
I am in no way downplaying the support you are giving me. I am even very thankful for taking the time to try to help me.

Here's a skill i've done for better context:

RPG Maker MZ 12_08_2025 12_38_13.png


For JS: Draw Gauge, I don't know what to do. I don't know how to code nor what to tweak to get The result I want.

I saw this in the Plugin:

* @param GaugeDrawJS:func
* @text JS: Draw Gauge
* @parent Gauges
* @type note
* @desc Code to determine how to draw the Skill Cost resource for this gauge type.
* @Default "// Declare Variables\nconst sprite = this;\nconst settings = sprite._costSettings;\nconst bitmap = sprite.bitmap;\nconst user = sprite._battler;\nconst currentValue = sprite.currentDisplayedValue();\n\n// Draw Gauge\nconst color1 = ColorManager.textColor(30);\nconst color2 = ColorManager.textColor(31);\nconst gx = 0;\nconst gy = sprite.bitmapHeight() - sprite.gaugeHeight();\nconst gw = sprite.bitmapWidth() - gx;\nconst gh = sprite.gaugeHeight();\nthis.drawFullGauge(color1, color2, gx, gy, gw, gh);\n\n// Draw Label\nconst label = settings.Name;\nconst lx = 4;\nconst ly = 0;\nconst lw = sprite.bitmapWidth();\nconst lh = sprite.bitmapHeight();\nsprite.setupLabelFont();\nbitmap.paintOpacity = 255;\nbitmap.drawText(label, lx, ly, lw, lh, \"left\");\n\n// Draw Value\nconst vw = sprite.bitmapWidth() - 2;\nconst vh = sprite.bitmapHeight();\nsprite.setupValueFont();\nbitmap.textColor = ColorManager.normalColor();\nbitmap.drawText(currentValue, 0, 0, vw, vh, \"right\");"

But to be honest I don't understand a single Thing.
I am in no way downplaying the support you are giving me. I am even very thankful for taking the time to try to help me.
That may have come of a bit more dramatic than I had intended, sorry. What I was trying to say is, assuming that you try to build something on top of Skills and States Core, there's no going around doing it inside the plugin parameters (at least in so far as I have tried in the past).

In this case, information on whether you have already succeeded in showing the bullets as a normal bar (from your mock-up I take it replacing the TP bar) and if yes how you have implemented it, is pretty important.

From there, I imagine you would need a plugin that patches the Visustella original drawFullGauge function mentioned under //Draw Gauge to draw circles in the place of rectangles, or leave the gauge alone and draw circles or icons on top of the gauge. This part is kind of trial and error because of the unspeakable, but doable I think.
I see. Sadly I have no clue how to code and do that. I'll just put the class on hold for now or delete it completely If I still find nothing. Still thanks a lot for taking time of your day to help me.
I don't understand your response. I was asking for you to show how you have it currently implemented, in order to help you. If you can show that, maybe we can find a solution.
Ah Sorry I didn't understand it that way. So basically For The Bullet Works like An MP Bar. There are Two Gauge One that serve as ressource of the Pistol and Another that serves as ressource for The Rifle. The Pistol Has 5 Bullets and Rifle Has 1 Bullet (Max Bullets can be increased via unlockable passive skill).Whenever a basic attack or a skill is used it consume a bullet some skills consume more than 1 bullet. When there are no more bullet, you can't shoot anymore. But there's a skill that Allow to reload, putting the bullet gauge back to max. Pistol and Rifle have each their reload skill.

I saw that VS SkillsStatesCore offer the possibility to create gauge for items that are used as skill cost:

SkillsStatesSpriteGauges.png


So what I wanted was to have the possibility to change the Item Gauge from how it is on the Picture To this:

Gauge Icon.png

I want to be able to use icons that will show the number of ressource available, when a ressource is empty and when it is full, I thought it would look better that way.
With the possibility to increase the Max bar through a passive skill (That can be optional as it is not my main goal)

I tried to be as decriptive as Possible, If you need further information please let me know
There's already a line of code in the VS Skill Cost Types how they draw an icon in there, like in the 'Potion' one at least. Just copy that and add more icons (increase the x spot (the first 0) by 24 each time) LOL. And remove the stuff where it draws the gauge. Then just make conditionals there that if a property/variable (ammo in chamber) is 5, all the icons are the index for white icon, otherwise start adding black ones at the last spots.

EDIT: I mean like in JS Draw Gauge bitmap.blt(iconBitmap, sx, sy, pw, ph, 0, 0, 24, 24);
Thanks for your help but to be honest I am totally lost. I don't understand anything. Can you do it for me please if it's not too much to ask or guide me step by step?
Yeah, tomorrow probably. But what are you using for the ammo "gauges" current values? Mp, tp, items, variable, custom property? Like when you reload the ammo, what happens?
For Now I am Using Items, Ammo(A) and Ammo( B ). I'll change the names soon, these are placeholders. These items will serve as the main ressource for the class. The reload Ammo skill refill the items back to full. Each Ammo belong to a Weapon Ammo(A)=Pistol, Ammo( B )=Rifle. They each have their reload too.

I'm trying to find a way to limit these items. Ammo(A) Limit should be 5 and Ammo( B ) limit should be 1 but I don't know how to do that so I'm looking
Okay, so there might be some confusion in what you and I mean with "already implemented", so let's just assume that nothing is implemented yet. A couple of things to consider:

By default you have three gauges at your disposal to customize (and I honestly don't know if you can add more within the confines of Visustella). Showing special gauges is essentially replacing HP/MP/TP gauges with one of the customized ones. As the gauge replacement can only be set by class, and as there is no way to change the gauge replacements on the fly through plugin commands, you need to make conscious choices on how to implement this.

Next, you have actually two things to keep track of: number of bullets in inventory, and number of bullets in your firearm. The cost is based off of the latter, and the reload action will replace bullets in your firearm with bullets from your inventory. How you need to implement this can get complicated depending on what you want:
  • Do you have multiple actors that can have this class?
  • Do you have multiple weapons of each type for which you need to keep track of number of bullets in the gun?

It's probably better to focus on implementing this mechanic first, and worry about the esthetics later.

What you need to do:
  1. Have a skill to fire each fire arm
  2. Decide on a note tag to specify the special cost of the skill, for example
    <BULLETA COST: 1> and <BULLETB COST: 1>
  3. Create entries under Skill Cost Types for Bullet A (for Bullet B it's easier to copy Bullet A after we are finished). Just copy the entry for Potion and change the value under Name to Bullet A or something.
If you can tell us the item ID of the bullet items, we can tell you where you need to tweak what.
I assume since you're doing it with items that you have only 1 character using that class.
Here's an example for the JS draw gauge. Max bullets is currently at 5 and there's no label text, because the default area is so small that if you try to add more than 5 icons or add the text, it cuts off. You can check for yourself if you want to increase the area, I'll leave below the codes to add the "Ammo" label and make it reference maxItems.
(There might be some unnecessary lines left, because I didn't have the energy to check everything, but the extra line shouldn't matter.)

// Declare Settings

// Declare Variables
const sprite = this;
const settings = sprite._costSettings;
const bitmap = sprite.bitmap;
const user = sprite._battler;
const item = $dataItems[7];
const currentValue = sprite.currentDisplayedValue();
const bitmapWidth = sprite.bitmapWidth();
const bitmapHeight = sprite.textHeight ? sprite.textHeight() : sprite.bitmapHeight();
const gaugeHeight = sprite.gaugeHeight();

// Draw Gauge

// Draw Value

// Draw Icon
const bullets = $gameParty.numItems(item)
const maxBullets = 5
const emptyChambers = maxBullets - bullets;
const iconIndex = 10;
const iconIndexEmpty = 26;
const iconBitmap = ImageManager.loadSystem("IconSet");
const pw = ImageManager.iconWidth;
const ph = ImageManager.iconHeight;
const sx = (iconIndex % 16) * pw;
const sx2 = (iconIndexEmpty % 16) * pw;
const sy = Math.floor(iconIndex / 16) * ph;
const sy2 = Math.floor(iconIndexEmpty / 16) * ph;
let emptyStart = 0;
for (let i=1; i<=bullets; i++) {
bitmap.blt(iconBitmap, sx, sy, pw, ph, (i-1)*24, 0, 24, 24);
emptyStart += 1;
}
for (let i=1; i<=emptyChambers; i++) {
bitmap.blt(iconBitmap, sx2, sy2, pw, ph, (emptyStart+i-1)*24, 0, 24, 24);
}

///////////////////////////////////

ADD LABEL:

// Draw Label
const label = "Ammo";
const lx = 0;
const ly = 0;
const lw = sprite.bitmapWidth();
const lh = sprite.bitmapHeight();
sprite.setupLabelFont();
bitmap.paintOpacity = 255;
bitmap.drawText(label, lx, ly, lw, lh, "left");

REFERENCE MAX ITEMS (change line above to):

const maxBullets = $gameParty.maxItems(item);


EDIT:
Whoops, removed the 48+ from the x position (put it there when I tested to add the "Ammo" text).
I've done all that You mentionned.
Multiple actors can have this class, I replace MP and TP with Ammo(A) and Ammo( B ) (These are PlaceHolder Names for now)
There are two weapon Type: Pistol and Rifle, PIstol has access to Ammo(A) and Rifle Has Access to Ammo ( B )
I have already made the Skills with the Cost <Item Cost: 1 Ammo(A)> and <Item Cost: 1 Ammo( B )> I also made a reload skill for Ammo(A) for now.
Everything will be shown below:

Here's how it works in Combat:

These are The Ammo Items:
RPGzer0 Class - RPG Maker MZ 13_08_2025 10_27_24.png

RPGzer0 Class - RPG Maker MZ 13_08_2025 10_27_28.png



Shooting Skills with Ammo Cost:
RPGzer0 Class - RPG Maker MZ 13_08_2025 10_29_17.png

RPGzer0 Class - RPG Maker MZ 13_08_2025 10_29_26.png


Reload Skill:
RPGzer0 Class - RPG Maker MZ 13_08_2025 10_29_35.png


Class With The Ammo Gauges:
RPGzer0 Class - RPG Maker MZ 13_08_2025 10_29_43.png
But how will you support multiple characters like that? If your max items is at 5 and actor A fires three times, then actor B can only fire two times. That's why I noted that what I posted above only works with one actor with the class. If you want multiple characters with that class, I think you need to change your system (and also rewrite parts of what I posted).

EDIT:
And did you get it to work (with 1 character)? I tested it and it seemed to work for me.
It looks good so far and from the looks of it you've also filled in the cost processing stuff. So just to be clear you haven't tried @rpgLord69's solution to replace the gauge with icons, right?

Also @rpgLord69 funny how you suggest to do it with icons, I was thinking of keeping the gauge intact and overlaying it with a rectangular graphic with five holes in it.

1755085050591.gif
Ok so I tried a Few things and It worked, It worked exactly like what I had in mind, Thank you rpgLord69 and Canned_Dinosaur.


But how will you support multiple characters like that? If your max items is at 5 and actor A fires three times, then actor B can only fire two times. That's why I noted that what I posted above only works with one actor with the class. If you want multiple characters with that class, I think you need to change your system (and also rewrite parts of what I posted).

EDIT:
And did you get it to work (with 1 character)? I tested it and it seemed to work for me.
I think I will stick to one Character. I'll have to make duplicate items/Skills in the database if I want another character to use the class Too, Tha'ts too much work.
It looks good so far and from the looks of it you've also filled in the cost processing stuff. So just to be clear you haven't tried @rpgLord69's solution to replace the gauge with icons, right?

Also @rpgLord69 funny how you suggest to do it with icons, I was thinking of keeping the gauge intact and overlaying it with a rectangular graphic with five holes in it.

View attachment 347315
I tried it and made some modification in my game system.

Here's how it looks like now:



I'll find a way to make Icons look bigger or change them back Maybe

Edit: Oh God the video Quality is so bad.....

Anyway here are some screenshots.

RPGzer0 Class 13_08_2025 12_58_28.png
RPGzer0 Class 13_08_2025 12_58_43.png


RPGzer0 Class 13_08_2025 12_58_28 - Copy.png


I really hope others who need this will find this post.

Original thread: https://forums.rpgmakerweb.com/threads/battle-ressources-gauge-as-icons-custom-gauges.179520/