Mooshry

BTS has consumed my very existence help.
Veteran
Joined
May 30, 2016
Messages
456
Reaction score
151
First Language
English
Primarily Uses
RMMV
So in my game, i want the windowskin to change depending on the actor's current status. Basically, when an actor less than 50% HP, i want the skin to change to yellow. at 25% it becomes orange, and when one's dead it turns red. Also, the windowskin should be able to change color depending on the states. when one actor is poisoned, the windowskin turns green for example. Is there a plugin that does this?
 

Mooshry

BTS has consumed my very existence help.
Veteran
Joined
May 30, 2016
Messages
456
Reaction score
151
First Language
English
Primarily Uses
RMMV
Anyone? Isn't this easy to make?
 

Ninkoro

Veteran
Veteran
Joined
Mar 7, 2015
Messages
43
Reaction score
4
First Language
English
Primarily Uses
RMMV
Here you go:

/*: @plugindesc Change Battle Status based on party member with lowest HP @author Ninkoro / Crimsontail */ (function() { _Window_BattleStatus_updateTone = Window_Base.prototype.updateTone; Window_BattleStatus.prototype.updateTone = function() { var lowestHpPercent = 1.0; $gameParty.battleMembers().forEach(function(actor) { var percent = actor.hp / actor.mhp; if(lowestHpPercent > percent){ lowestHpPercent = percent; } }); if(lowestHpPercent == 0.0){ this.setTone(255,0,0); } else if(lowestHpPercent <= 0.25){ this.setTone(255,125,0); } else if(lowestHpPercent <= 0.5){ this.setTone(255,255,0); } else{ _Window_BattleStatus_updateTone.call(this); } }; })();

The color codes are in RGB format in the setTone() functions, you can just directly edit the numbers to change the color to your liking, or I can set them up as a bunch of plugin parameters if desired.

If you want a new HP range just add another if statement, or you can edit the float values to modify the current ranges.

Currently the default is to set the window color to the system default, however if you want to specify a color instead just replace
_Window_BattleStatus_updateTone.call(this);
with
this.setTone(R,G,B);
Where R,G,B is your desired color.

Let me know if this helps!
 

Mooshry

BTS has consumed my very existence help.
Veteran
Joined
May 30, 2016
Messages
456
Reaction score
151
First Language
English
Primarily Uses
RMMV
That's amazing, thanks! But the problem is i want the windowskin image to change, not the main background.... I guess i should've specified... But this will still be helpful for another project!
 

Ninkoro

Veteran
Veteran
Joined
Mar 7, 2015
Messages
43
Reaction score
4
First Language
English
Primarily Uses
RMMV
Oh, so you mean like swapping out window.png essentially? Having a list of image files for the various HP levels? That would definitely be a bit more involved.

Edit:
Ok, I guess I somehow missed the last sentence of your post with states and such. Sorry about that. My plugin only changes the status window, and not any others. Also like you noticed just the color of it.

Let me look into this and I'll come back with something better, something that will change the actual window skin to a specified file like you want. I'll throw in some state example section as well that you can customize with your desired state id's
 
Last edited:

Mooshry

BTS has consumed my very existence help.
Veteran
Joined
May 30, 2016
Messages
456
Reaction score
151
First Language
English
Primarily Uses
RMMV
yeah, that
 

Ninkoro

Veteran
Veteran
Joined
Mar 7, 2015
Messages
43
Reaction score
4
First Language
English
Primarily Uses
RMMV
Tada, here is you new window skin changing plugin. Took quite a bit of effort so please put it to good use! Let me know if you have any troubles or if something isn't clear.

Also if for some reason there's performance issues I can add in a type of cache.

Description for plugin:

Using this plugin, you can specify a window skin file for HP ranges
and afflicted states on an actor.

Designate a state to have a skin by putting the following meta tag in
the notes section of that state:
<skin:my_window_skin_file>
Note: Do NOT include the .png extension in the meta tag

Logic:

Afflicted state skins take priority over HP skins.
Ex: If an actor is at 25% HP afflicted by poison, and you have a skin
designated to the poison state, the windowskin will show the poison skin,
not the HP one.

State skins take priority based on their in-editor priority number.
Highest priority afflicted state in party determines the skin.
 

Attachments

  • BattleWindowSkinChanger.js
    3.7 KB · Views: 6

Mooshry

BTS has consumed my very existence help.
Veteran
Joined
May 30, 2016
Messages
456
Reaction score
151
First Language
English
Primarily Uses
RMMV
This is perfect! Thanks! Now if only there was a plugin that overwrote yanfly core engine's text colors because the white text clashes...
 

ScorchedGround

Blizzards most disappointed fan
Veteran
Joined
Apr 12, 2020
Messages
459
Reaction score
668
First Language
German
Primarily Uses
RMMV
Why do you need to overwrite the core engine's text colors?
The plugin lets you change the text colors in the plugin parameters.
 

Mooshry

BTS has consumed my very existence help.
Veteran
Joined
May 30, 2016
Messages
456
Reaction score
151
First Language
English
Primarily Uses
RMMV
But not along with the windowskin.
Why do you need to overwrite the core engine's text colors?
The plugin lets you change the text colors in the plugin parameters.
 

Ninkoro

Veteran
Veteran
Joined
Mar 7, 2015
Messages
43
Reaction score
4
First Language
English
Primarily Uses
RMMV
A non-plugin way could just be to map the desired color to the same area on the skin png’s. That way you set the color ID once, but it changes for each skin since each one has a different color for that ID.
 

Mooshry

BTS has consumed my very existence help.
Veteran
Joined
May 30, 2016
Messages
456
Reaction score
151
First Language
English
Primarily Uses
RMMV
I did that, but all the text is still white anyway.
 

Latest Threads

Latest Posts

Latest Profile Posts

I've decided "Attack on Equestria" should be released first... hence this new ARG channel! https://www.youtube.com/channel/UClKiUI8xOVx9dsF4kRXUmxw
Check it out, and subscribe! The ARG will lead up to the video game. It's not a creepy game, but I just thought it should follow ARG standards.
For anyone interested in my project M - i finally made a gamethread about it :D

Yay. I turned 39 today. Another year older, another year closer to the grave.
I'm sure the latest post/thread in the sidebar used to have 5 posts. Was it always been like this?

Made it to the 10th video doing this! :kaocry:

renderTimingPixel.png

Forum statistics

Threads
110,407
Messages
1,053,064
Members
143,469
Latest member
ClementPanchout
Top