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.
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
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).
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.