Display All Status Icons

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,634
Reaction score
5,115
First Language
English
Primarily Uses
RMVXA
Display All State Icons


v1.0 by Wavelength


for RPG Maker MV


Just a humble script I wrote for a friend, and figured I'd share with everyone since I was surprised I couldn't find anything that did it already.


By default the player can only see a few state icons in battle or the status menu, leaving them with incomplete information when an actor has several different statuses applied.  This script will automatically shrink the state icons when an actor has too many state icons to display at full size, so that the player can see far more icons for each actor.


This plugin does not use standard "plugin parameters", but you can open the script in a text editor to easily change the amount that you want the icons to scale.


Download the script here or just open the code below. 

Code:
////////////////////////////////////////
//        ICON SCALING SCRIPT         //
//         for RPG Maker MV           //
//           Version 1.0              //
//  by Jason "Wavelength" Commander   //
////////////////////////////////////////

// By default, only a few state icons can be shown at once.  This script will scale down the icons'
// display size by a factor of your choice if there are too many to display at full size, so that
// players can be aware of all of the states that are currently affecting their actors.

// TERMS OF USE
// You may use this script for your commercial or noncommercial RPG Maker games.
// You must credit me in your game or documentation (as Jason Commander or as Wavelength).
// For any other use of this script besides inclusion in an RPG Maker game, contact me.
// Thanks!


// This value can be changed to determine how much to scale down the icons when there are too many to
// display at full size.  For example, a value of 2 will reduce width and height by half.
Game_Party.ICON_SCALE = 2;


/*:
*
* @plugindesc This script sizes status icons down when there are too many to display at full size.
* @author Jason "Wavelength" Commander
* @help By opening the script in a text editor,
you can change the amount that icons will scale.
* 
* By default, they will scale to half size when
* there are too many icons to display at full size.
*
*/



Window_Base.prototype.drawSmallIcon = function(iconIndex, x, y) {
	var scaler = Game_Party.ICON_SCALE;
    var bitmap = ImageManager.loadSystem('IconSet');
    var pw = Window_Base._iconWidth / scaler;
    var ph = Window_Base._iconHeight / scaler;
    var sx = iconIndex % 16 * (pw * scaler);
    var sy = Math.floor(iconIndex / 16) * (ph * scaler);
    this.contents.blt(bitmap, sx, sy, pw * scaler, ph * scaler, x, y,
    		Window_Base._iconWidth / scaler, Window_Base._iconHeight / scaler);
};

Window_Base.prototype.drawActorIcons = function(actor, x, y, width) {
    width = width || 144;
    too_big = false;
    if (actor.allIcons().length > Math.floor(width / Window_Base._iconWidth)) {
    	too_big = true;
    }
    if (too_big === false) {
    	var icons = actor.allIcons().slice(0, Math.floor(width / Window_Base._iconWidth));
	    for (var i = 0; i < icons.length; i++) {
	        this.drawIcon(icons[i], x + Window_Base._iconWidth * i, y + 2);
	    }
	} else {
		var scaler = Game_Party.ICON_SCALE;
		row_size = (Math.floor(width / (Window_Base._iconWidth / scaler)));
		rows_needed = Math.floor((actor.allIcons().length - 1) / row_size) + 1;
		for (j = 0; j < rows_needed; j++) {
			var icons = actor.allIcons().slice(0,
					Math.floor(width / (Window_Base._iconWidth / (scaler * scaler))));
		    for (var i = 0; i < row_size; i++) {
		        this.drawSmallIcon(icons[(j * row_size + i)],
		        		x + ((Window_Base._iconWidth / scaler) * (i % row_size)),
		        		y + (j * (Window_Base._iconHeight / scaler)) + 2);
		        if (((j * row_size) + i + 1) >= actor.allIcons().length) {
		        	break;
		        }
			}
		}
	}
};


Screenshots:

State Icon Screenshot 1.png


State Icon Screenshot 2.png



Terms of Use:


You may use this script for your commercial or noncommercial RPG Maker games.
You must credit me in your game or documentation (as Jason Commander or as Wavelength).
For any other use of this script besides inclusion in an RPG Maker game, contact me.
 
Joined
Mar 9, 2013
Messages
355
Reaction score
89
First Language
Spanish
Primarily Uses
N/A
A better choice would be display each status icons on a single square at a set frame speed, or scroll them like Modern Algebra's RPGVXA script, because on the screenshot, specially on the Battle Status Window, you are making me think that if there's more than 8 status effects, either the icons would be too shrinked, or maybe would display a third row of icons? I don't know, but the point is that shrinking icons is not a good way to display more icons, specially if the game is ported to mobile platforms and played on screens below 5'', and the problem is even worse if you are using also a plugin to display the turn counter of the status effects, it would make the counter unreadable unless you are in a screen above.. maybe 9''?


Anyways, I'm not saying that it is a bad plugin, the contrary, this plugin is good, is a good alternative to display more icons, however, not the best.


Thank you! :rwink:


EDIT: Just fixing typos.
 
Last edited by a moderator:

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,634
Reaction score
5,115
First Language
English
Primarily Uses
RMVXA
@Killuki Zaoldyeck  Thanks for your feedback!  I agree that the "single changing icon" approach would be better for mobile devices; however, I find it very distracting in games with large parties and important status effects so I personally prefer the "shrink icons" approach, at least for big screens.


The icons won't shrink below the level of the ICON_SCALE option, so if it's set to 2, by default it will show up to 8 icons for each actor (whichever 8 have the highest priority) at a time.  This prevents them from ever becoming microscopic.  Of course, if you think there's a good chance your actors will have more than 8 states at a time, you can increase the width of your Icons area and now the script can automatically show more icons using the same icon size - this is something that I think can easily be changed using other scripts, but I could add the functionality directly into this script if people say they need that.
 
Joined
Oct 26, 2012
Messages
31
Reaction score
4
First Language
Indonesia
Primarily Uses
um how do I do to display more icons before they shrink?


Using Yanfly core plugin to change the resolution only give me 3 states to display them. And because of wide resolution, it leave plenty space unused or hp bar being too long. It would be nice if we can control how many states to display horizontally tho.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,634
Reaction score
5,115
First Language
English
Primarily Uses
RMVXA
um how do I do to display more icons before they shrink?


Using Yanfly core plugin to change the resolution only give me 3 states to display them. And because of wide resolution, it leave plenty space unused or hp bar being too long. It would be nice if we can control how many states to display horizontally tho.


Granting the "Icons" area more width would allow you to display more icons before they are forced to shrink.  For example, you can add the following to the end of the script to decrease the Actor Name area by 72 pixels in width (78 instead of 150) and increase the Actor Icons area by 72 pixels in width (rect.width - 84 instead of rect.width - 156), which will increase the number of icons that can be shown at once without shrinking from 2 to 4:

Code:
Window_BattleStatus.prototype.drawBasicArea = function(rect, actor) {
    this.drawActorName(actor, rect.x + 0, rect.y, 78);
    this.drawActorIcons(actor, rect.x + 84, rect.y, rect.width - 84);
};
If you're not using the TP bar, you could reduce the width of the gauges area instead to add a lot of width to the Icons area.  This is something you need to do yourself (and it's not hard to do) - my script will automatically accept the change, but it was not designed to make the change for you.


I simply posted this script since I thought some people might find it helpful as is.  I don't have any plans to expand or enhance it, although I might change my mind if there are a lot of requests for a specific feature.
 
Joined
Oct 26, 2012
Messages
31
Reaction score
4
First Language
Indonesia
Primarily Uses
@Wavelength: Oh don't worry. Although my Javascript knowledge is very minor, you information above is more than enough for me to start.


I can't say thank you enough! :D


(And yes, I've found the part where I should edit the HP bar with quick search and your info).
 
Last edited by a moderator:

Chibi-Alien

Warper
Member
Joined
Mar 21, 2016
Messages
2
Reaction score
1
First Language
English
Primarily Uses
This is exactly what I was looking for and it works exactly as advertised. Thanks for sharing this.
 

BaronVampson

Veteran
Veteran
Joined
Jul 7, 2018
Messages
48
Reaction score
2
First Language
English
Primarily Uses
RMMV
Sorry to somewhat necro this thread but it appears as though this plugin no longer works. Is there a similar one available that does something akin to this?
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,634
Reaction score
5,115
First Language
English
Primarily Uses
RMVXA
Sorry to somewhat necro this thread but it appears as though this plugin no longer works. Is there a similar one available that does something akin to this?
I just created a new, clean project using RPG Make MV 1.6.1, dropped my plugin into it (and turned it ON), and tested - the icons scaled down correctly. It worked.

Perhaps one of your other plugins is causing a conflict? If you create a new project, insert this plugin (and no other plugins), turn it on, and it still doesn't work correctly, please provide a screenshot of the battle screen (and preferably one of the Console Log as well) and describe what is happening, and I'll go ahead and try to investigate what's causing the issue.
 

Tamina

Veteran
Veteran
Joined
Dec 22, 2019
Messages
99
Reaction score
40
First Language
English
Primarily Uses
RMMV
For example, you can add the following to the end of the script to decrease the Actor Name area by 72 pixels in width

Code:
Window_BattleStatus.prototype.drawBasicArea = function(rect, actor) {
    this.drawActorName(actor, rect.x + 0, rect.y, 78);
    this.drawActorIcons(actor, rect.x + 84, rect.y, rect.width - 84);
};
Hello,

If I want to shrink actor HP/MP instead of actor names, which code should I use? Do you have a script for it?
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,634
Reaction score
5,115
First Language
English
Primarily Uses
RMVXA
Hello,

If I want to shrink actor HP/MP instead of actor names, which code should I use? Do you have a script for it?
I THINK in this case all you would need to do is modify the following method (instead of the one you quoted above):
JavaScript:
Window_BattleStatus.prototype.gaugeAreaWidth = function() {
    return 330;
};
Change 330 to a lower number; for example 230 instead should give you 100 extra pixels to draw the icons and 100 less pixels of the gauge area.

If that doesn't work, then I don't know - but what I would do is do thorough searches for methods that lead into or out of the drawItem method for Window_BattleStatus; in particular, drawBasicArea, basicAreaRect, and drawGaugeArea look like good places to start. Play around with numbers or references that you see to "width" in those methods (be sure to copy the original code before you do so!), and see how things change when you do.
 

Tamina

Veteran
Veteran
Joined
Dec 22, 2019
Messages
99
Reaction score
40
First Language
English
Primarily Uses
RMMV
I THINK in this case all you would need to do is modify the following method (instead of the one you quoted above):
JavaScript:
Window_BattleStatus.prototype.gaugeAreaWidth = function() {
    return 330;
};
Change 330 to a lower number; for example 230 instead should give you 100 extra pixels to draw the icons and 100 less pixels of the gauge area.

If that doesn't work, then I don't know - but what I would do is do thorough searches for methods that lead into or out of the drawItem method for Window_BattleStatus; in particular, drawBasicArea, basicAreaRect, and drawGaugeArea look like good places to start. Play around with numbers or references that you see to "width" in those methods (be sure to copy the original code before you do so!), and see how things change when you do.
Doesn't work: With your code I got 3-4 icons showing in the window instead of 2, but the MP bar gets cut off.

If I turn on Yanfly Core Engine only 2 icons show even with extra space in the status window.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,634
Reaction score
5,115
First Language
English
Primarily Uses
RMVXA
Doesn't work: With your code I got 3-4 icons showing in the window instead of 2, but the MP bar gets cut off.

If I turn on Yanfly Core Engine only 2 icons show even with extra space in the status window.
Sounds like it is working! The next step would be to change the width of the HP/MP/TP displays so they don't get cut off by the smaller gauge areas. If you follow the methods you find in drawGaugeArea, you find these two:
Code:
Window_BattleStatus.prototype.drawGaugeAreaWithTp = function(rect, actor) {
    this.drawActorHp(actor, rect.x + 0, rect.y, 108);
    this.drawActorMp(actor, rect.x + 123, rect.y, 96);
    this.drawActorTp(actor, rect.x + 234, rect.y, 96);
};

Window_BattleStatus.prototype.drawGaugeAreaWithoutTp = function(rect, actor) {
    this.drawActorHp(actor, rect.x + 0, rect.y, 201);
    this.drawActorMp(actor, rect.x + 216,  rect.y, 114);
};
Based on whether you use TP or not, you'll want to modify one method or the other. The second field (e.g. rect.x + 123) is the X-position of the display; the fourth field (e.g. 96) is the width. You'll want to modify the widths to compensate for however much you reduced the gauge area by; you'll also want to modify the X-positions appropriately so for example if you reduce the drawActorHp width by 20, you'll also want to reduce the drawActorMp (and Tp) X-position by 20 to shift it to the left.

As far as Yanfly's Core Engine, it's probably a case of the two plugins both overwriting the same method. I'm not really interested in providing a compatibility patch for this very old scriptlet, but the easiest thing you could try is to place this scriptlet (any any other changes you've included from this thread) after all Yanfly plugins (if it's currently before them, as I suspect it is), or to place this scriptlet before the Core Engine (if it's currently after it). If that doesn't work (it may not), it gets much harder - you'd need to examine which methods my scriptlets share in common with Yanfly's plugins and remove unwanted functionality from his. It's possible someone would write that compatibility patch for you if you post on the JS Plugin Requests board.
 

Tamina

Veteran
Veteran
Joined
Dec 22, 2019
Messages
99
Reaction score
40
First Language
English
Primarily Uses
RMMV
Sounds like it is working! The next step would be to change the width of the HP/MP/TP displays so they don't get cut off by the smaller gauge areas. If you follow the methods you find in drawGaugeArea, you find these two:
Code:
Window_BattleStatus.prototype.drawGaugeAreaWithTp = function(rect, actor) {
    this.drawActorHp(actor, rect.x + 0, rect.y, 108);
    this.drawActorMp(actor, rect.x + 123, rect.y, 96);
    this.drawActorTp(actor, rect.x + 234, rect.y, 96);
};

Window_BattleStatus.prototype.drawGaugeAreaWithoutTp = function(rect, actor) {
    this.drawActorHp(actor, rect.x + 0, rect.y, 201);
    this.drawActorMp(actor, rect.x + 216,  rect.y, 114);
};
Based on whether you use TP or not, you'll want to modify one method or the other. The second field (e.g. rect.x + 123) is the X-position of the display; the fourth field (e.g. 96) is the width. You'll want to modify the widths to compensate for however much you reduced the gauge area by; you'll also want to modify the X-positions appropriately so for example if you reduce the drawActorHp width by 20, you'll also want to reduce the drawActorMp (and Tp) X-position by 20 to shift it to the left.

As far as Yanfly's Core Engine, it's probably a case of the two plugins both overwriting the same method. I'm not really interested in providing a compatibility patch for this very old scriptlet, but the easiest thing you could try is to place this scriptlet (any any other changes you've included from this thread) after all Yanfly plugins (if it's currently before them, as I suspect it is), or to place this scriptlet before the Core Engine (if it's currently after it). If that doesn't work (it may not), it gets much harder - you'd need to examine which methods my scriptlets share in common with Yanfly's plugins and remove unwanted functionality from his. It's possible someone would write that compatibility patch for you if you post on the JS Plugin Requests board.
Thanks. I made it work by inserting your code into any other plugin that changes Window_BattleStatus.prototype.
 

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

Latest Threads

Latest Profile Posts

This is relevant so much I can't even!
Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect

Forum statistics

Threads
105,999
Messages
1,018,220
Members
137,778
Latest member
lifehoroscopee
Top