Way to display more state icons in battle?

Status
Not open for further replies.

SmeeDucks

Warper
Member
Joined
Jan 19, 2020
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
I am currently using Yanfly's BattleStatus Window and the 4 states it displays aren't enough. I am using it in conjunction with Yanfly's BuffsStatesCore in order to show turns remaining on each state.

Is there anyway to both increase the number of states shown, while also keeping the turn counter? I like the Animated Status Icons by DigiDeity (https://www.rpgmakercentral.com/topic/33213-animated-status-icons/#entry226059) but can't find anything similar for MV.

I have tried Display All Status Icons by Wavelength (https://forums.rpgmakerweb.com/index.php?threads/display-all-status-icons.56880) but it doesn't recognize that more states are being displayed when it's over 4 and will only display the first 4 turn counts. I am terrible JS and even if I could fix it I imagine the turn counts would be too small to see anyway.

Sorry for formatting, new here. Had to make a thread after banging my head in the wall for the past 2 days.
 

Wavelength

Pre-Merge Boot
Global Mod
Joined
Jul 22, 2014
Messages
4,623
Reaction score
3,886
First Language
English
Primarily Uses
RMVXA
There's a parameter near the top of my plugin:
Game_Party.ICON_SCALE = 2;
You can change this to a higher value, such as 3, to allow the icons to shrink more when many states have been applied. (You can also use the little snippet I offered later down in the thread to extend the area where icons are drawn.) However, it's possible that there may be a conflict with one of Yanfly's plugins, which tend to overwrite a lot of the engine's default behavior - this might cause my plugin to not work properly when using Yanfly plugins in related areas.

My instinct is that it wouldn't be too hard to directly modify Yanfly's Battle Status Window to display more than 4 icons, but since he requires payment to simply download this plugin, I can't look into it to help you any further.
 

SmeeDucks

Warper
Member
Joined
Jan 19, 2020
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
There's a parameter near the top of my plugin:
Game_Party.ICON_SCALE = 2;
You can change this to a higher value, such as 3, to allow the icons to shrink more when many states have been applied. (You can also use the little snippet I offered later down in the thread to extend the area where icons are drawn.) However, it's possible that there may be a conflict with one of Yanfly's plugins, which tend to overwrite a lot of the engine's default behavior - this might cause my plugin to not work properly when using Yanfly plugins in related areas.

My instinct is that it wouldn't be too hard to directly modify Yanfly's Battle Status Window to display more than 4 icons, but since he requires payment to simply download this plugin, I can't look into it to help you any further.
Thank you for the reply. As long as the plugins are placed in the right order your plugin works correctly with both of Yanfly's, up until they shrink when there are 5 or more. Then Yanfly's BuffStateCore acts as if there are still only 4 states being shown and draws the turn counter as such. I do agree that modifying BuffStateCore to work with the smaller states shouldn't be impossible, however, I tried taking a crack at it and got absolutely nowhere.
 

Wavelength

Pre-Merge Boot
Global Mod
Joined
Jul 22, 2014
Messages
4,623
Reaction score
3,886
First Language
English
Primarily Uses
RMVXA
Ah, I see. Looking through the Buffs & States Core, I think I spot where the logic is for drawing the State Turns remaining on the Actor Icons:
Code:
Window_Base.prototype.drawActorIconsTurns = function(actor, wx, wy, ww) {
  var iw = Window_Base._iconWidth;
  var icons = actor.allIcons().slice(0, Math.floor(ww / iw));
  var max = icons.length;
  var shownMax = Math.floor(ww / iw);
  for (var i = 0; i < actor.states().length; ++i) {
    if (shownMax <= 0) break;
    var state = actor.states()[i];
    if (state.iconIndex <= 0) continue;
    if (state.autoRemovalTiming > 0) {
      this.drawStateTurns(actor, state, wx, wy);
    }
    this.drawStateCounter(actor, state, wx, wy);
    wx += iw;
    --shownMax;
  }
  for (var i = 0; i < 8; ++i) {
    if (shownMax <= 0) break;
    if (actor._buffs[i] === 0) continue;
    this.drawBuffTurns(actor, i, wx, wy);
    if (Yanfly.Param.BSCShowBuffRate) {
      this.drawBuffRate(actor, i, wx, wy);
    }
    wx += iw;
    --shownMax;
  }
  this.resetFontSettings();
  this.resetTextColor();
};

Window_Base.prototype.drawStateTurns = function(actor, state, wx, wy) {
  if (!state.showTurns) return;
  var turns = actor.stateTurns(state.id);
  if (turns !== 0 && !turns) return;
  var turns = Yanfly.Util.toGroup(Math.ceil(turns));
  wx += state.turnBufferX;
  wy += state.turnBufferY;
  this.changePaintOpacity(true);
  this.changeTextColor(this.textColor(state.turnColor));
  this.contents.fontSize = state.turnFontSize;
  this.drawText(turns, wx, wy, Window_Base._iconWidth, state.turnAlign);
  this.resetFontSettings();
  this.resetTextColor();
};

I haven't tried this, but I speculate that if you change shownMax to multiply by the square of my ICON_SCALE option (so if Icon Scale is 2, you multiply by 4, or if it's 3, you multiply by 9), it would draw the timer for every icon, but it would do so as if the icons had not been shrunk - you'd have a line of numbers across your actor panel.

To also draw them in the right place and size, you'd need to change the x, y, and width being passed into this.drawText (in the second method) using the same logic that my own plugin uses (which also means considering how many states are present, and therefore how much everything was shrunk). That's not a quick or easy change, and I don't have the time (or honestly the inclination) to play around with all the modifications that need to be made to make it happen. Hopefully one of the coding geniuses around here does, though! If you want to make a Plugin Request thread to ask for those specific changes, feel free to do so (and if you do, please report this post so we can close this thread).
 

SmeeDucks

Warper
Member
Joined
Jan 19, 2020
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
Ah, I see. Looking through the Buffs & States Core, I think I spot where the logic is for drawing the State Turns remaining on the Actor Icons:
Code:
Window_Base.prototype.drawActorIconsTurns = function(actor, wx, wy, ww) {
  var iw = Window_Base._iconWidth;
  var icons = actor.allIcons().slice(0, Math.floor(ww / iw));
  var max = icons.length;
  var shownMax = Math.floor(ww / iw);
  for (var i = 0; i < actor.states().length; ++i) {
    if (shownMax <= 0) break;
    var state = actor.states()[i];
    if (state.iconIndex <= 0) continue;
    if (state.autoRemovalTiming > 0) {
      this.drawStateTurns(actor, state, wx, wy);
    }
    this.drawStateCounter(actor, state, wx, wy);
    wx += iw;
    --shownMax;
  }
  for (var i = 0; i < 8; ++i) {
    if (shownMax <= 0) break;
    if (actor._buffs[i] === 0) continue;
    this.drawBuffTurns(actor, i, wx, wy);
    if (Yanfly.Param.BSCShowBuffRate) {
      this.drawBuffRate(actor, i, wx, wy);
    }
    wx += iw;
    --shownMax;
  }
  this.resetFontSettings();
  this.resetTextColor();
};

Window_Base.prototype.drawStateTurns = function(actor, state, wx, wy) {
  if (!state.showTurns) return;
  var turns = actor.stateTurns(state.id);
  if (turns !== 0 && !turns) return;
  var turns = Yanfly.Util.toGroup(Math.ceil(turns));
  wx += state.turnBufferX;
  wy += state.turnBufferY;
  this.changePaintOpacity(true);
  this.changeTextColor(this.textColor(state.turnColor));
  this.contents.fontSize = state.turnFontSize;
  this.drawText(turns, wx, wy, Window_Base._iconWidth, state.turnAlign);
  this.resetFontSettings();
  this.resetTextColor();
};

I haven't tried this, but I speculate that if you change shownMax to multiply by the square of my ICON_SCALE option (so if Icon Scale is 2, you multiply by 4, or if it's 3, you multiply by 9), it would draw the timer for every icon, but it would do so as if the icons had not been shrunk - you'd have a line of numbers across your actor panel.

To also draw them in the right place and size, you'd need to change the x, y, and width being passed into this.drawText (in the second method) using the same logic that my own plugin uses (which also means considering how many states are present, and therefore how much everything was shrunk). That's not a quick or easy change, and I don't have the time (or honestly the inclination) to play around with all the modifications that need to be made to make it happen. Hopefully one of the coding geniuses around here does, though! If you want to make a Plugin Request thread to ask for those specific changes, feel free to do so (and if you do, please report this post so we can close this thread).
Thank you! I will tinker around with this tonight and see if I can get anywhere, else I take your suggestion. what I can do
 

SmeeDucks

Warper
Member
Joined
Jan 19, 2020
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
I found something close to what I wanted. Using Yanfly's BattleStatus Window and DreamX's Ext_BattleStatusCore which adds on to Yanfly's plugin, you can create a rolling state state that cycles through all the states an actor has. I will probably try to modify to have multiple rolling states, but for now going to close this thread as that would be a separate issue.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
6,063
Reaction score
4,263
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Been so busy lately that I wonder if I should slowly start preparing the advent calendar resources so I have enough in december.
Man, I wish it was harder for mean d-holes to make me feel like crying.
Made 8 games. Was aiming for 20. Gonna go for 40. Because 20 + 20. /Bed.
Got myself card game plugin, its bit laggy but worth it
Finally made battler stuff for my last character...

Forum statistics

Threads
94,535
Messages
921,700
Members
124,398
Latest member
knightcard02
Top