Events disappear when battle starts

Whenever a battle starts, all events briefly vanish from the map before changing to the battle screen. This is a problem, because sometimes the events may be covering up secrets that shouldn't be revealed so suddenly. Is there anything I can do to make them not disappear? Or, maybe transition to battle in a different way to dodge the issue?
It's deliberate, though I don't know why: all events except for ones with a tile image get hidden during the encounter effect. (MZ also exempts object characters, e.g. !Door.png.)

I think this short plugin should skip that (untested):
JavaScript:
/*:
 * @target MV MZ
 * @plugindesc Don't hide any events during encounter effect.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/179939/
 * @help Free to use and/or modify for any project, no credit required.
 */
// Override - don't hide characters.
Spriteset_Map.prototype.hideCharacters = function() {};
I opted to instead do what MZ does and only exempt object characters, by adding this override:

JavaScript:
Sprite_Character.prototype.isTile = function() {
    return this._character.tileId > 0 || this._character.isObjectCharacter();
};

(That function is called from hideCharacters and nowhere else, so I figured it was a good place to alter the logic.)
Mh...I imagine that stands a good chance of not conflicting with other plugins, just because it's an obscure method. But it doesn't fit the method name/purpose. By all means use it, though~

I'd personally prefer a safer approach, e.g. (untested):
Spoiler: plugin code
JavaScript:
/*:
 * @target MV
 * @plugindesc Do not hide object characters during encounter effect.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/179939/
 * @help Free to use and/or modify for any project, no credit required.
 */
;void (function(alias) {
"use strict";
  Spriteset_Map.prototype.hideCharacters = function() {
    alias.apply(this, arguments);  // hide non-tile characters as usual
    for (const sprite of this._characterSprites)
      if (sprite.isObjectCharacter())
        sprite.show();             // re-show object characters
  };
})(Spriteset_Map.prototype.hideCharacters);
The Scene Map method controls this right before battle so you could make the changes here if you want instead:
JavaScript:
Scene_Map.prototype.startEncounterEffect = function() {
    //this._spriteset.hideCharacters();
    this._encounterEffectDuration = this.encounterEffectSpeed();
}

(commented out the line that hides the characters - original code can be found in rmmz_scenes.js)

You could tie it to a switch or something and have more control there as well.
original code can be found in rmmz_scenes.js
I'm actually using MV here! It sounds like I'd be able to just do nothing if using MZ, as it's mainly object characters that were bugging me anyway.
I'm actually using MV here! It sounds like I'd be able to just do nothing if using MZ, as it's mainly object characters that were bugging me anyway.
It should be the same code in MV under rpg_scenes.js.

Using the code above will rewrite the corescript and function the way you intended.
Yeah, I figured it would be the same (and I looked at it myself recently anyway); was just noting the discrepancy.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/events-disappear-when-battle-starts.179939/