States icons display change

MiD

Veteran
Veteran
Joined
Oct 22, 2018
Messages
76
Reaction score
30
First Language
Greek
Primarily Uses
RMMV
Hi all,

So I made this little plugin for my game and decided to share it with you. I don't consider it as "official" or anything, since it will probably have some compatibility issues, and I only made it for my game anyway. However, you may edit it to work for yours too.

So in this case I will not upload it to my GitHub, instead I will just upload it here.

WHAT IT DOES:

By default, state icons are displayed in a single line below the character's name and level. In my case i'm not using a face for my actor, so I wanted them to be displayed there.

Also, instead of using the 1 line, I wanted them to be displayed in 2 (if it's below the name) or 4 (if it's at the space where the face would be). So, basically, if you use the "face"'s space, you can have up to 16 states' icons displayed at the same time!

HOW TO USE:

1. Copy the raw code and paste it in a JS file
2. Name the file "Makai_States_Display.js"
3. Put that file in your plugin folder.
4. Turn it on from your plugins manager (duh)

EDIT: Discussing it with people with far more JS experience than me, I was informed that not everything is saved in the game files. This means that my initial script calls to alter the game windows would (probably) have to be re-run each time. So I removed them. Now the plugin takes effect immediately, while the original version of the game window is stored in maka.states.default



There may be bugs since i'm still learning, but, again, feel free to edit and use and, of course, correct me :)

Here it is:

Code:
/*:
*@plugindesc Change how many states' icons are displayed and where v1
*@author Makai Rosi
*
*@param States Position Face
*@type boolean
*@on YES
*@off NO
*@desc If you aren't using a face for your actors, we can make use of that space.
*YES - true     NO - false
*@default true
*
*@param Lines
*@desc The max lines of the states
*@default 4
*
*@help
*This humble little plugin REPLACES how state icons are drawn on the status page.
*If you have no face for your actor, you can use that space.
*Also, put how many lines you want to be displayed at once.
*Note that there is space for 4 lines where the face is, and space for 2 lines
*if you use the default space.
*
*
*I have no idea what other plugins this is compatible with. I made it for my
*game, but share it in case it helps you too.
*
*
*As always, feel free to edit it, just credit me in your plugin's help file.
*
*/
//plugin starts here

var maka = maka || {};
maka.states = maka.states || {};

(function(){

  maka.parameters = PluginManager.parameters('Makai_States_Display');
  maka.param = maka.param || {};

  maka.param.statesFacePos = eval(String(maka.parameters['States Position Face']));
  maka.param.lines = maka.parameters['Lines'];

//======================================FUNCTIONS=====================================================//

maka.states.default = Window_Base.prototype.drawActorIcons;

 

    Window_Base.prototype.drawActorIcons = function(actor, x, y, width) {
      width = width || 144*maka.param.lines;
      var icons = actor.allIcons().slice(0, Math.floor(width / Window_Base._iconWidth));
      var new_i = 0;
      var new_posy = 0;
      var new_posx = 0;
      var iconLine = 0;

      if(maka.param.statesFacePos==true){
      new_posy = 70;
      new_posx = 150;
    };
 
      for (var i = 0; i < icons.length; i++) {

          if(new_i==4){
              iconLine++;
              new_i=0;
          };

          this.drawIcon(icons[i], x - new_posx + Window_Base._iconWidth * new_i, y + 2 + iconLine*34 - new_posy);
 
      new_i++;
      };
  };

 

})(maka.states);


I hope you find some use for it!

EDIT: The changed state of the plugin might not be saved when you save your game. I will edit it soon so that it works immediately, rather than with a script call. <-DONE!

License:
Use freely as commercial, non-commercial, whatever. Edit it as you wish but if you do i'd like to be credited as the original author inside the plugin description. If you want to be extra nice, you can include this page's link as well.
 
Last edited:

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,157
Reaction score
8,426
First Language
English
Primarily Uses
RMMV
@MiD Can you please add terms of use and credits to your original post? Thanks.
 
  • Like
Reactions: MiD

MiD

Veteran
Veteran
Joined
Oct 22, 2018
Messages
76
Reaction score
30
First Language
Greek
Primarily Uses
RMMV
@MiD Can you please add terms of use and credits to your original post? Thanks.
Hello mlogan. I added a "license" is that ok? I'm sorry, I didn't expect it to need a license since it's a really simple piece of code - that's why I didn't even add it to my GitHub. It's mostly meant to be custom-edited rather than used "as is", since it might have compatibility issues. I just made it for my game but shared it anyway.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

The Ace attorney series are so great games... But at the same time such a travesty.
Made a video showcasing a plugin (by Lanza) that adds 5 more weather effects to our MV games. :LZYsmile: Namely:
Ash-dust,
bloodrain,
Cherry Blossom Petals,
Hail,
and bubbles.

I just like this website:
lol

Forum statistics

Threads
103,238
Messages
998,294
Members
134,728
Latest member
ripleydx
Top