MV Does Side Battle Status UI from Olivia show multiple states for battlers, too?

Hi all,

Since this is a paid plugin, I have no way to test it to confirm if it has this function. So I'm hoping someone out there has it and knows the answer.

1775696792441.png


It shows that you can modify how many states show, but only shows this feature working for the actors, not the enemy troop. For some baffling reason, many plugins I've found that have this feature ONLY work for the actor party. Of course, a lot of them have compatibility issues with my nightmare web of plugins, so I was curious if this Olivia one might work since I already use other Olivia stuff and I might replace some MOG features with it.
Don't have that plugin but it says "draw on the status windows" so probably doesn't affect enemies. Probably also the reason you saw those other plugins only affecting the actors, since by default the icons are drawn on enemy battlers and actor status window.

But yeah, I think you can try to change the sprite stateicon so that it doesn't use the iconfile for the bitmap, but instead just an empty bitmap (for example 4 icons wide). Then change the update method: remove the setframe update and then in the update where it gets the battler allIcons make it draw (with blt) a max 4 of those (add iconWidth to the x depending on the index). Of course such a method will redraw them in the update cycle (was it 30-40 frames?) even if they weren't changed, but whatever.
Whoops, took me a while to come back to this, heh.

I was able to talk to @ShadowDragon outside the forums and figured out that it does indeed only affect the player party. I continue to be baffled why these plugin makers don't offer the same feature for enemies. On top of that, Olivia's plugin forces sideview which would make me have to redo a bunch of stuff. So that's a no go.

@rpgLord69 I really don't have the savvy to figure out how to implement what you're saying. I mean, I don't think so anyway. I did eventually figure out manipulating how the game uses the Damage.png but what you're describing sounds like making new functions rather than just changing the conditions and parameters of existing ones. I'm not good at coding, heh.

If someone did figure this out they could honestly probably charge money for the plugin because I found at least a few dead ends where other people were asking for the same thing.
Hmmm, I think just something like this would work (currently 4 icons). But I don't know if that blt eats resources. Might be better to make 4 different state sprites and then make each one show their own index.

Sprite_StateIcon.prototype.loadBitmap = function() {
const iconWidth = Sprite_StateIcon._iconWidth;
const iconHeight = Sprite_StateIcon._iconHeight;
this.bitmap = new Bitmap(iconWidth*4, iconHeight);
};

Sprite_StateIcon.prototype.updateFrame = function() {

};

Sprite_StateIcon.prototype.updateIcon = function() {
const iconFile = ImageManager.loadSystem('IconSet');
var icons = [];
if (this._battler && this._battler.isAlive()) {
icons = this._battler.allIcons().slice(0,4);
if (icons.length > 0) {
this.bitmap.clear();
for (let i=0; i<icons.length; i++) {
const pw = Sprite_StateIcon._iconWidth;
const ph = Sprite_StateIcon._iconHeight;
const sx = icons[i] % 16 * pw;
const sy = Math.floor(icons[i] / 16) * ph;
const dx = pw*i;
const dy = 0;
this.bitmap.blt(iconFile, sx, sy, pw, ph, dx, dy);
}
}
} else {
this.bitmap.clear();
}
};
Holy crap, @rpgLord69 , this works super well! Thanks so much! It even seems to have no issues with my danged Olivia State tooltip plugin!

The only problem is that it doesn't have a solution when there is more than 4 states. It seems like changing the length is easy, but would it be possible to add more rows past the first X amount?

1776400033471.png
Cool.

If you want to make it like 8, try changing these lines:

this.bitmap = new Bitmap(iconWidth*4, iconHeight*2);

icons = this._battler.allIcons().slice(0,8);

const dy = (i < 4) ? 0 : Sprite_StateIcon._iconHeight;
For some reason this doesn't change anything. Reading this, I get the size and position changes, but I don't understand what tells it to form a second row. But I'm bad at coding so I'm sure I'm missing something. Did I implement it wrong?

JavaScript:
Sprite_StateIcon.prototype.loadBitmap = function() {
    const iconWidth = Sprite_StateIcon._iconWidth;
    const iconHeight = Sprite_StateIcon._iconHeight;
    this.bitmap = new Bitmap(iconWidth*4, iconHeight*2);
};

Sprite_StateIcon.prototype.updateFrame = function() {

};

Sprite_StateIcon.prototype.updateIcon = function() {
    const iconFile = ImageManager.loadSystem('IconSet');
    var icons = [];
    if (this._battler && this._battler.isAlive()) {
        icons = this._battler.allIcons().slice(0,8);
        if (icons.length > 0) {
        this.bitmap.clear();
        for (let i=0; i<icons.length; i++) {
        const pw = Sprite_StateIcon._iconWidth;
        const ph = Sprite_StateIcon._iconHeight;
        const sx = icons[i] % 16 * pw;
        const sy = Math.floor(icons[i] / 16) * ph;
        const dx = pw*i;
        const dy = (i < 4) ? 0 : Sprite_StateIcon._iconHeight;
        this.bitmap.blt(iconFile, sx, sy, pw, ph, dx, dy);
        }
        }
    } else {
    this.bitmap.clear();
    }
};

//by rpgLord69 on rpgmaker forums
Yeah, I forgot to change the x coordinate in the second row. The idea is that if the index in the loop is higher than the 4th element, the y is not 0 but one icon height. But you need to change the x too. So (assuming I know how to use modulo LOL and am not missing something else too):

const dx = pw * (i % 4);
1776469316949.png


@rpgLord69 This is beautiful! Thanks for the explanation, I can change to 5x5 (or even 6x6) if I find these edge cases happening where I have a stupid number of states up lol

I also discovered this is using the "priority" variable in the state window to determine what gets displayed first to last. Apparently a long time ago I made all my "Diplomacy" states 100, so they display first. I can fiddle around with this to give it a good flow.

This is such a good solution, bravo! You are a godsend! I hope many people find this thread for this UI upgrade!

Spoiler: Final code for anyone too lazy to read the above posts
JavaScript:
Sprite_StateIcon.prototype.loadBitmap = function() {
    const iconWidth = Sprite_StateIcon._iconWidth;
    const iconHeight = Sprite_StateIcon._iconHeight;
    this.bitmap = new Bitmap(iconWidth*4, iconHeight*2); // change 4 to increase/decrease horizontal length
};

Sprite_StateIcon.prototype.updateFrame = function() {

};

Sprite_StateIcon.prototype.updateIcon = function() {
    const iconFile = ImageManager.loadSystem('IconSet');
    var icons = [];
    if (this._battler && this._battler.isAlive()) {
        icons = this._battler.allIcons().slice(0,8); //change 8 to be the total number of icons able to be shown
        if (icons.length > 0) {
        this.bitmap.clear();
        for (let i=0; i<icons.length; i++) {
        const pw = Sprite_StateIcon._iconWidth;
        const ph = Sprite_StateIcon._iconHeight;
        const sx = icons[i] % 16 * pw;
        const sy = Math.floor(icons[i] / 16) * ph;
        const dx = pw * (i % 4); //change 4 if changed above
        const dy = (i < 4) ? 0 : Sprite_StateIcon._iconHeight; //change 4 if changed above
        this.bitmap.blt(iconFile, sx, sy, pw, ph, dx, dy);
        }
        }
    } else {
    this.bitmap.clear();
    }
};

//by rpgLord69 on rpgmaker forums

Original thread: https://forums.rpgmakerweb.com/threads/does-side-battle-status-ui-from-olivia-show-multiple-states-for-battlers-too.183186/