Display All Status Icons

Wavelength

Edge of Eternity
Global Mod
Joined
Jul 22, 2014
Messages
5,134
Reaction score
4,438
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
224
Reaction score
25
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

Edge of Eternity
Global Mod
Joined
Jul 22, 2014
Messages
5,134
Reaction score
4,438
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

Edge of Eternity
Global Mod
Joined
Jul 22, 2014
Messages
5,134
Reaction score
4,438
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

Edge of Eternity
Global Mod
Joined
Jul 22, 2014
Messages
5,134
Reaction score
4,438
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.
 

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

Latest Threads

Latest Profile Posts

JDgoldvox wrote on Mr. Detective's profile.
hey, could u help me with a problem? basically, How do I delete a character from a map after a cut scene is over? I am really new with RPG maker MV. Please help!
The most rewarding part of making custom body character parts is absolutely not making the masks work. Somebody please put me out of my misery.
Any commercial devs here ever mess with Gamejolt? Been contemplating making my games available there but don't know if it's worth the effort or not.
Social distancing taught me of how much of not a loner I am. Dammit, I miss seeing my friends...
Happy 4th of July all. Anybody have plans? Mine here is staying home away from the virus. Still a nice 3 day weekend.

Forum statistics

Threads
99,262
Messages
963,602
Members
130,856
Latest member
superfluffy
Top