How to change the enemy's sprite color when you select it in battle?

Status
Not open for further replies.

HyenamanDev

Villager
Member
Joined
Jul 17, 2022
Messages
12
Reaction score
7
First Language
Spanish
Primarily Uses
RMMV
Hey there, I need some help regarding enemy selection. The game I'm working on has plenty of white battlebacks, which doesn't match well with the default RPGMV white 'blink' effect when you select a target. Is there any way to change the select color to something like yellow, blue, etc? Here's some pics / gif to explain myself better.

This is the current behavior... the enemy flashes white when selected. Hard to see due to the white background:

gif.gif


This is what enemies should look like when you select them:

ezgif.com-gif-maker (6).gif


I'd be really grateful for any suggestions to achieve this latter look. If there's a way to control whether it 'blinks' or not that would be great too, but being able to change the color would be enough.

Here's my plugin list too in case it helps.

plugin list.png
 
Last edited:

HyenamanDev

Villager
Member
Joined
Jul 17, 2022
Messages
12
Reaction score
7
First Language
Spanish
Primarily Uses
RMMV
Nevermind, I found a way.

The default RPGMV function that determines the visual effect for selecting enemies is found in rpg_sprites.js, line 558, but modifying it didn't work as intended due to the plugin YEP_X_AnimatedSVEnemies overriding this function whenever a battler using an animated spritesheet is selected. So I modified the "updateSelectionEffect" function located in YEP_X_AnimatedSVEnemies:

Code:
Sprite_Enemy.prototype.updateSelectionEffect = function() {
    if (!this._svBattlerEnabled) {
      return Sprite_Battler.prototype.updateSelectionEffect.call(this);
    }
    var target = this._mainSprite;
    if (this._battler.isSelected()) {
        this._selectionEffectCount++;
        if (this._selectionEffectCount % 15 < 15) {
            target.setBlendColor([255, 255, 0, 64]); // this line has been changed to achieve a yellow highlight effect; the original RGBA value was 255, 255, 255, 64
        } else {
            target.setBlendColor([0, 0, 0, 0]);
        }
    } else if (this._selectionEffectCount > 0) {
        this._selectionEffectCount = 0;
        target.setBlendColor([0, 0, 0, 0]);
    }

In short words: with the above modification, whenever you select an enemy that uses a custom spritesheet from Yanfly's animated SV battlers plugin, it'll flash yellow instead of white. Leaving this here in case anyone else finds some use for it.
 
Last edited:
Joined
Feb 18, 2023
Messages
1
Reaction score
0
First Language
English
Primarily Uses
RMMZ
Nevermind, I found a way.

The default RPGMV function that determines the visual effect for selecting enemies is found in rpg_sprites.js, line 558, but modifying it didn't work as intended due to the plugin YEP_X_AnimatedSVEnemies overriding this function whenever a battler using an animated spritesheet is selected. So I modified the "updateSelectionEffect" function located in YEP_X_AnimatedSVEnemies:

Code:
Sprite_Enemy.prototype.updateSelectionEffect = function() {
    if (!this._svBattlerEnabled) {
      return Sprite_Battler.prototype.updateSelectionEffect.call(this);
    }
    var target = this._mainSprite;
    if (this._battler.isSelected()) {
        this._selectionEffectCount++;
        if (this._selectionEffectCount % 15 < 15) {
            target.setBlendColor([255, 255, 0, 64]); // this line has been changed to achieve a yellow highlight effect; the original RGBA value was 255, 255, 255, 64
        } else {
            target.setBlendColor([0, 0, 0, 0]);
        }
    } else if (this._selectionEffectCount > 0) {
        this._selectionEffectCount = 0;
        target.setBlendColor([0, 0, 0, 0]);
    }

In short words: with the above modification, whenever you select an enemy that uses a custom spritesheet from Yanfly's animated SV battlers plugin, it'll flash yellow instead of white. Leaving this here in case anyone else finds some use for it.
Will definitely try it out in MZ. And I loved your animations. They are very expressive for 3 frames. Well done!
 

Shaz

Keeper of the Nuts
Global Mod
Joined
Mar 2, 2012
Messages
46,006
Reaction score
16,821
First Language
English
Primarily Uses
RMMV

@Captain_Shawler , please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

I just posted the first devlog for The Hidden Art of Innkeeping: https://seaphoenix.itch.io/hiddenart!

BeachLogo.png
Might start playing some rpg maker games and uploading the games on youtube. Realistically they're not going to be for views. Just to give anyone some feedback on any games they're working on. So if you'd like me to play and review your game just reply them down here. And I'll upload them on Rpg4MGames.
Ah, so THIS is what it feels like to sleep till I naturally wake up, and not be woken up by an alarm or other unwanted stimuli... holy crap I feel like I can lift a house! XD (Or work on my game)
I'm graduating in two weeks. I have been away for a long time, the things that I want to make just kept going farther and farther away from me. But not anymore. My time is unbound and I am free.

Forum statistics

Threads
131,614
Messages
1,221,599
Members
173,338
Latest member
ZMG
Top