MV Seamlessly making enemies appear

So, I had this notion I might alter some troop events, so that if the characters are above a certain level, or certain switches are on, a more powerful monster will join the encounter. But what I've discovered is that if I set making the monster appear to Don't Run, it doesn't work, probably because the battler hasn't been drawn. If I set it to turn 0, it works mostly as desired, but you can see the monster get drawn.

Any notions for making this seamless?
So you want the stronger enemy appear at the start of the encounter along side the other enemies?

You could event this.

Just use a variable that counts step and after a certain amount, do a conditional if switch on, or char level above then use battle processing for the troop with the stronger enemy If not battle processing with the normal troops.
Yeah, that will work fine for event encounters. What about random encounters?
Add your strong enemies to every encounter accordingly, set to appear later, on turn 0 run your level check > Enemy appear. Or am I missing something?

Edit: Ah you mean the fade-in that it does... Lemme think...

Edit2: Yeah I don't really have an eventing way around that... You could potentially use action sequencing and force and action to get the enemy off the screen>let the fade happen>put it back on the screen, but I'm pretty sure one could write a very simple plugin that checks for a <nofade> enemy notetag and then skips the fade entirely.
The idea I had was like, ok, you have five skeletons. But if you're level 10+, there is also a Skeleton Boss, or maybe a random chance of having the Skeleton Boss. I'm just stuck with this visual issue, trying to do it with eventing.

I'm trying to visualize the plugin. I think maybe I need a plugin that lets enemies appear if you Don't Run. Obviously the normal enemies get drawn when the battle starts; is there a way to load the halfway enemies during Don't Run? I mean, honestly, why doesn't this work by default? The halfway enemies are already present in the troop.
The idea I had was like, ok, you have five skeletons. But if you're level 10+, there is also a Skeleton Boss, or maybe a random chance of having the Skeleton Boss. I'm just stuck with this visual issue, trying to do it with eventing.

I'm trying to visualize the plugin. I think maybe I need a plugin that lets enemies appear if you Don't Run. Obviously the normal enemies get drawn when the battle starts; is there a way to load the halfway enemies during Don't Run? I mean, honestly, why doesn't this work by default? The halfway enemies are already present in the troop.


I mean what you could do.


Is turn 0 show all normal enemies, then do a conditional to show the stronger enemy?

So then they all have the fade effect at the same time?
Since you seem to be misunderstanding it: the phrase "Don't Run", when displayed as a troop event condition, means "do not process". I.e. that troop event will never trigger.

The change would have to happen before battle starts, but troop events only run during battle. So yes, you'll need a plugin.

You could make copies of each troop for low/high level, then use a plugin like this to filter which troops appear:

Alternatively, an enemy replacer plugin with appropriate conditions should work: just replace the boss with either a normal enemy or with nothing. A quick search didn't turn up anything with suitable conditions, but maybe something like this would work (untested):
Spoiler: plugin code
JavaScript:
/*:
 * @target MV MZ
 * @plugindesc Enemy replacement: <replace: eval>
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/posts/1521073/
 * @help Adds notetag for Enemies:
 *        <replace: eval>
 *    • The eval result is the ID of the replacement enemy.
 *      Use -1 to remove them from the troop (replace with nothing).
 *      Use 0 to skip replacement (no change).
 *      Don't use ">" in the eval: that will end the tag early!
 * Examples:
 *        <replace: $gameParty.leader().level < 10 ? -1 : 0>
 *    • If the party leader's level is less than 10, this enemy won't appear.
 *        <replace: Math.random() < 0.4 ? 5 : 0>
 *    • 40% chance to replace this enemy with enemy ID 5.
 *
 * Free to use and/or modify for any project, no credit required.
 */
;void (function() {
"use strict";
  /** Identifier for new Enemy notetag. */
  const TAG_NAME = "replace";
  /** Identifier for new property on `Game_Troop` storing processed troop data. */
  const P = "_replacedTroop";

  // Patch - process and cache result.
  void (function(alias) {
    Game_Troop.prototype.troop = function() {
      if (P in this)
        return this[P];
      const troop = JsonEx.makeDeepCopy(alias.apply(this, arguments));
      for (let n = troop.length; n--;) {  // reverse iteration (removal)
        const enemy = troop[n];
        const tag = enemy.meta[TAG_NAME];
        if (tag && typeof tag === "string") {
          const id = eval(tag) | 0;
          if (id > 0)       // replace
            enemy.enemyId = id;
          else if (id < 0)  // remove
            troop.splice(n, 1);
        }
      };
      return this[P] = troop;
    };
  })(Game_Troop.prototype.troop);

  // Patch - clear cached troop data.
  void (function(alias) {
    Game_Troop.prototype.clear = function() {
      alias.apply(this, arguments);
      delete this[P];
    };
  })(Game_Troop.prototype.clear);

})();
I can just as easily set a troop event to transform an enemy as to make one appear, but it creates the same visual problem.

EDIT: I'm trying to poke through the js files to figure out what code makes an enemy Appear Halfway and so far I'm not even having luck finding it. I can't even find that phrase, which to me suggests that that phrase appears in the UI and is not even part of the code base.

EDIT 2: Okay, found the code in rpg_objects that does the thing:

Code:
// Enemy Appear

Game_Interpreter.prototype.command335 = function() {

this.iterateEnemyIndex(this._params[0], function(enemy) {

enemy.appear();

$gameTroop.makeUniqueNames();

}.bind(this));

return true;

};



// Enemy Transform

Game_Interpreter.prototype.command336 = function() {

this.iterateEnemyIndex(this._params[0], function(enemy) {

enemy.transform(this._params[1]);

$gameTroop.makeUniqueNames();

}.bind(this));

return true;

};

I guess I just need to figure out how to activate this before the draw on Turn 0. I found the code where it counts the members of the troop, and it occurs as soon as the battle scene loads. So I need to figure out how jump in before Turn 0 and do one of these things.

Original thread: https://forums.rpgmakerweb.com/threads/seamlessly-making-enemies-appear.178718/