Change size with a state

I'm looking for a plugin that will allow me to change the size of the battle sprites with the application of a state, particularly one that is also compatible with Yanfly's Animated Sideview Enemies. This would be useful for a status ailment that shrinks the target, an enemy that swells up like a balloon, etc. Thanks in advance.

Edit: Well, ideally it should be compatible with any Yanfly plugin.
Something like this? https://forums.rpgmakerweb.com/index.php?threads/enlarge-skill-state.111348/ 🙂
(Not sure if it's compatible with SV enemies, haven't tested.)
Something like this? https://forums.rpgmakerweb.com/index.php?threads/enlarge-skill-state.111348/ 🙂
(Not sure if it's compatible with SV enemies, haven't tested.)

This works, but only on the player characters. So I can at least make a shrinking status that enemies can use on players.
Maybe it can still be done, and the enemy sprites just have a different object name than the players?
I wonder if I can tint sprites the same way.
Oh drat, I think it might be being overridden by Yanfly's "breathing sprites" stuff. 😴

Haven't tested, but from looking at the code I think something like this may work? 😤
Spoiler: Notetags
Code:
<Custom Apply Effect>
if (user.isEnemy()) {
  user.enemy().spriteScaleX = 1.2;
  user.enemy().spriteScaleY = 1.2;
}
user.battler().scale.x = 1.2;
user.battler().scale.y = 1.2;
</Custom Apply Effect>

<Custom Remove Effect>
if (user.isEnemy()) {
  user.enemy().spriteScaleX = 1;
  user.enemy().spriteScaleY = 1;
}
user.battler().scale.x = 1;
user.battler().scale.y = 1;
</Custom Remove Effect>
These require Buffs & States Core as before. I've also assumed here that you haven't used any <Scale Sprite: x> or <Scale Sprite Width: x> notetags on your enemies.

Not sure about permanent tinting, since various effects (selection, battle animations, etc) apply temporary tints which I think are programmed to reset to 0 when they end. Maybe someone else can recommend an approach there. 😅
Oh drat, I think it might be being overridden by Yanfly's "breathing sprites" stuff. 😴

Haven't tested, but from looking at the code I think something like this may work? 😤
Spoiler: Notetags
Code:
<Custom Apply Effect>
if (user.isEnemy()) {
user.enemy().spriteScaleX = 1.2;
user.enemy().spriteScaleY = 1.2;
}
user.battler().scale.x = 1.2;
user.battler().scale.y = 1.2;
</Custom Apply Effect>

<Custom Remove Effect>
if (user.isEnemy()) {
user.enemy().spriteScaleX = 1;
user.enemy().spriteScaleY = 1;
}
user.battler().scale.x = 1;
user.battler().scale.y = 1;
</Custom Remove Effect>
These require Buffs & States Core as before. I've also assumed here that you haven't used any <Scale Sprite: x> or <Scale Sprite Width: x> notetags on your enemies.

Not sure about permanent tinting, since various effects (selection, battle animations, etc) apply temporary tints which I think are programmed to reset to 0 when they end. Maybe someone else can recommend an approach there. 😅

You did it! That works wonderfully on both players and enemies. Thank you!
As for tinting specifically, apparently Yanfly's Visual States and a new animation can do that just fine. I was mostly curious about other properties I could access this way. Maybe the RMMV API can give me some clues.
Upon further experimentation, I've found a bit of a problem. Changing the scale this way seems to affect all enemies of the same ID, rather than the enemy instance that is actually afflicted with the state.
Is there a way to change the scale of individual enemy instances?
If not, I might just have to be careful about the numbers of each shrinkable enemy in a troop.
Oh whoops, yes, "this.enemy()" refers to the database Enemy entry, so it'll affect all enemies of that type. I should've noticed that. 😴

I wrote a simple little plugin to use instance-based scaling; seems to work for me! Plugin attached, full code in spoiler below~
Spoiler: Full code
Code:
/*:
 * @plugindesc Enemy scaling compatible with Yanfly's Animated SV Enemies.
 * @author Caethyril
 * @help Set the enemy's "_tempScale" property to a number, e.g.
 *
 * <Custom Apply Effect>
 * user._tempScale = 1.2;
 * </Custom Apply Effect>
 *
 * <Custom Remove Effect>
 * delete user._tempScale;
 * </Custom Remove Effect>
 */

(function() {

'use strict';

	const PROP_NAME = '_tempScale';

	(function(alias) {
		Game_Enemy.prototype.spriteScaleX = function() {
			return this[PROP_NAME] || alias.call(this);
		};
	})(Game_Enemy.prototype.spriteScaleX);

	(function(alias) {
		Game_Enemy.prototype.spriteScaleY = function() {
			return this[PROP_NAME] || alias.call(this);
		};
	})(Game_Enemy.prototype.spriteScaleY);

})();
Note that this is purely for the enemies; to affect actors as well you'll still need to include the "user.battler().scale.x" stuff, e.g.
Code:
<Custom Apply Effect>
if (user.isEnemy()) user._tempScale = 1.2;
user.battler().scale.x = 1.2;
user.battler().scale.y = 1.2;
</Custom Apply Effect>

<Custom Remove Effect>
if (user.isEnemy()) delete user._tempScale;
user.battler().scale.x = 1;
user.battler().scale.y = 1;
</Custom Remove Effect>
I wrote a simple little plugin to use instance-based scaling
This seems to work great! Thank you for your help, caethyril. You are a gem.
Happy to help~ 😂

Original thread: https://forums.rpgmakerweb.com/threads/change-size-with-a-state.112364/