Universal Temporary Enemy Transformation

So, basically, I've been looking to make a sort of polymorph skill that changes the enemy it's used on into something else.

There's two problems I've realized with this though.

The first, is that I want the polymorph to be temporary, which would mean having some way to remember what the enemy it's used on was pre-polymorph so as to be able to turn it back, and also not override that memory when polymorphing something else.

The second, is that I would need a way for the effect to not work on bosses and other major enemies.


Ideally, the best way to do this would be to change only their battler sprite, and have all the other changes be caused through a state, but I don't know how one would go about changing an enemies battler graphic without transforming the enemy.
you'll probably have to mix troop events and skill effects, with the troop event for each enemy checking the time and transforming back.

the skill should probably set a state "transformed" on the enemy that does nothing, having the troop event check for that state and then handle the transformation
To transform an enemy's sprite, you would need to change the following properties:
  • battler_name (I know this sounds weird, but it's the battler's graphic file name)
  • battler_hue
For example, $game_troop.members[2].battler_name = ((whatever)) would change the battler's sprite to ((whatever)) you specify but would keep the same hue that the original battler had.
  • Note that you need to add attribute accessors for both battler_name and battler_hue, which should be done for the Game_Battler class - for example, attr_accessor :battler_name
  • I am honestly not sure whether you would also need to refresh the battler's sprite after changing it. If that's the case, simply doing the above will do nothing visually for the player, even though on the back end it will recognize the new sprite. I'm not 100% sure what the code would be to refresh the sprite.
If you also want to change the enemy's name, you will need to change the battler's original_name property, much like you do with battler_name and battler_hue above. This is a property of enemies only rather than all battlers, so be sure to add the attr_accessor inside the Game_Enemy class, not the Game_Battler class, this time.
  • Due to "plurals" like Slime A, Slime B, Slime C, etc., you might get some strange behavior with the polymorphed enemy's name once you do this. If that's the case, look at the "def transform(enemy_id)" method within Game_Enemy for some guidance on how you can get rid of weird plurals.
WITH ALL THAT SAID, I can't think of any way to actually track what sprite you should change each enemy back to once the polymorph ends, and apply that reversion back to their original sprite (and name), without a literally insane amount of troop eventing in every single troop. If this were for one enemy troop, it wouldn't be too hard, but to apply it as a skill, which could be used against almost any enemy in almost any troop, I think you're talking at least weeks, maybe months, of evening to make this work.

I think you would need a Script to make this feasible. I personally don't know of any existing scripts that would be able to pull this off in VX Ace. You could use Yanfly's Buffs and States Core in RPG Maker MV, and I'm currently working on something that would make it very easy in RPG Maker MZ.

I'm going to leave this thread on the normal support board as @Andar seems to believe this is feasible without scripts, so I may be missing something. However, if you want this moved to the RGSS3 (Ace) Script Requests section, where people are more likely to be able to point you to a script that would be helpful or even create a new one for you, please Report this post and say as your reason that you would like it moved to Script Requests.
I mean, I actually know how you would do the reversion back part, I was just hoping someone else would know a simpler way. Instead it seems that not only is that the best way, but we're better off just using transform enemy then doing all this extra script work to change only the battler graphic.

That being; one variable for every possible enemy index in a troop(I think there's 8 of them? Not sure)
When using the polymorph skill, have it call a common event that gets the position number of the actors last target(the move is specific to one character), then detects what actual enemy type it is, and sets the corresponding variable for its position to that. Then applies an(empty) state, and transforms the enemy.

Then, using a script that is already being made use of in the game, have it call a common event when the transformed enemies state runs out, which reads the variable to tell what enemy to change them back into.

Of course, I'd need to know the script calls for stuff like detecting enemy type and transforming enemies. Meanwhile I don't even know how to make a conditional branch work in scripts(I do know how to get the position of an actors last target though)


Edit: Nevermind, I've realized a critical flaw in my plan. Yeah, I'm going to need a script for this.

I'm thinking like, Himeworks State Faces could possibly be modified to apply to battlers instead, but I wouldn't know how to go about making it do so.
without a literally insane amount of troop eventing in every single troop.
depends on how you do this.
you'll need one troop event for every enemy in every troop, yes, because that is where the original of the enemy is remembered.
However that event can be relatively simple in itself as long as you don't care what the enemy is transformed into and leave that to a common event.

Moved this to RGSS3 Script Requests.

So, now that it's been moved, what I'm asking for is pretty much Tsukihime's State Faces script, but modified to affect battlers instead of faces.

Original thread: https://forums.rpgmakerweb.com/threads/universal-temporary-enemy-transformation.129809/