Objects Extending the Scene_Map Prototype

I'm trying to extend a scene off of Scene_Map: the idea was to set up a different set of menus and available actions to the player while still retaining the ability to move around the map.

Trying to launch the scene automatically after loading the map through a default Transfer Player command results in the map immediately offloading itself.
In attempting to prevent this I've added a case to the Scene_Map.stop function stipulating that it shouldn't offload the map data if the next scene is the one I'm coding, but this apparently doesn't work either, since the result is a cut to black followed by a crash due to event data having also been uploaded.

Thus, the best approach would seem to be to have the transfer occur as a part of starting the scene. However, the Scene_Map definitions only seem to handle fade-in and offload functions; the ones handling loading the map and handling the data seem to be assigned somewhere else.

Thus, my questions are as follows:
1) Am I better off starting my scene before or after the transfer to the new map?
2a) If before, how do I code in loading the appropriate map?
2b) If after, how do I transfer the data from Scene_Map to my new scene so that the game doesn't crash as soon as the scene starts?
Not sure if I understood exactly what you're trying, but instead of extending Scene_Map, you can just add stuff to it. That way you don't need to transfer the player to another scene as your current scene will already have your changes.

Modifying Scene_Map.stop wouldn't work because it's called in the middle of the scene change process (in SceneManager).
The main reason for creating a new Scene instead of tacking the behaviors onto Scene_Map would be that I wanted to map different behaviors to player inputs (like calling up a different set of menus).

The scene is supposed to act as the base for a turn-based strategic battle (a la Final Fantasy Tactics) and so would require a radically different set of operational rules from what Scene_Map usually does; the only thing Scene_Map is providing is... Well, the Map.
Tacking all of the stuff onto Scene_Map and having it only work that way when a particular variable is set would, theoretically, work, but at that point it would potentially start breaking normal functionality - on top of being pretty far away from best practices.

This being the case, I could simply duplicate the processes responsible for loading the map and relevant data... Are these primarily located in SceneManager? I'll have to take a look tomorrow.

EDIT: Having reviewed the methods in the SceneManager class, there doesn't seem to be anything directly related to anything. The closest seem to be the onSceneLoading method, which simply calls Graphics.updateLoading - this method seems to handle actually drawing in the map.

To try to narrow my question down, where/how are the calls to transfer the player and load in a new map made?
Apologies for the double post, but I have an update.

Further tinkering has revealed that the step I was missing was invoking the CreateDisplayObjects method from Scene_Map during the prototype.start method; doing so has allowed the scene to appear as expected.

The problem now is that in spite of being an extension of the Scene_Map class, starting the scene results in all inputs being locked (can't move around the map, can't open the menu).

Below is the code I have written so far; as I haven't been able to get past this initial hurdle the scene doesn't really do anything of its own yet... The Plugin Command being called is 'StrategicBattle debug' so the other two cases haven't come into play yet.
Spoiler: Scene Code
Code:
Game_Interpreter.prototype.pluginCommand = (function (original) {
    "use strict";
    function pluginCommand(command, args) {
        original.call(this, command, args);
        if (command !== "StrategicBattle" || SceneManager._scene.constructor === Scene_StrategicBase) {
            return;
        }
        switch (args[0]) {
            case "start":
                //Set the static variable to the current battle name for ease of use.
                var currentBattle = args[1];
                loadStratData(currentBattle);
               
                //Create the scene.
                break;
            case "end":
                //remove data from DataManager, to be picked up on garbage collection (otherwise long sessions might cause a memory leak)

                break;
            case "debug":
                //Special testing case.
                SceneManager.push(Scene_StrategicBase)
        break;
            default:
                break;
            }
    }
    return pluginCommand;
}(Game_Interpreter.prototype.pluginCommand));

function Scene_StrategicBase() { this.initialize.apply(this, arguments); }
Scene_StrategicBase.prototype = Object.create(Scene_Map.prototype);
Scene_StrategicBase.prototype.constructor = Scene_StrategicBase;

//Duplicates Scene_Map.initialize, but assumes that map has already been loaded.
Scene_StrategicBase.prototype.initialize = function() {
    Scene_Base.prototype.initialize.call(this);
    this._waitCount = 0;
    this._encounterEffectDuration = 0;
    this._mapLoaded = false;
    this._touchCount = 0;
    $gamePlayer.setImage('Cursors', 0);
};

Scene_StrategicBase.prototype.create = function() {
    Scene_Base.prototype.create.call(this);
    this._transfer = $gamePlayer.isTransferring();
    var mapId = this._transfer ? $gamePlayer.newMapId() : $gameMap.mapId();
    this.createDisplayObjects();
};

Scene_StrategicBase.prototype.isReady = function() {
    return Scene_Base.prototype.isReady.call(this);
};

Scene_StrategicBase.prototype.start = function() {
    Scene_Base.prototype.start.call(this);
    SceneManager.clearStack();
    this.menuCalling = false;
};

My question is: why isn't the player able to move once the scene starts? Does something in SceneManager (or somewhere else) need to be poked in order for player movement to stay enabled?
To Avoid Double posting, you can click "edit" and the bottom of the post, that way you can bascially has many updates as you want.


Anyway I can only stipulate that this.isActive is returning false; since if it $gamePlayer needs that to be true in order to call MoveByInput.
Code:
Scene_Map.prototype.updateMain = function() {
   //if this thing return false you will not move, the scene will "lock"
   // oddly enough this bascally is always set to true unless stop is called,
   //or the scene is still being initlaized.
   // you can find it in the Scene_Base class
    var active = this.isActive();

    $gameMap.update(active); //menu call
    $gamePlayer.update(active); //movement
    $gameTimer.update(active);
    $gameScreen.update();
};

Honestly i actually tried your scene code and it worked fine... the transfer was seamless and i could run around and open the menu. i didn't even know it happened until I logged SceneManager._scene.

One more thing, Scene_Map is baically a container for everything inside the map and provides functionailty for thew othe "Game" objects like Events and the Player.. The "TileMap" actually comes from Spriteset_Map(rpg_sprite.js), and it uses ShaderTilemap(rpg_core.js) to draw it. Im not sure what functioanility you need in your Battle Engine but i thought i give you a hint of what actually happens.

Spoiler: Scene Structure
Code:
Scene-(Scene_Map)
    -SpriteSet(Spriteset_Map) //contains all things you see on screen except windows
            -Parralax (Tiling Sprite)
            -Tilemap (ShaderTilemap/Tilemap depending on WebGL avaliability)
                   -Characters(Sprite_Character) //includes events + vehicles
            -Weather (Weather)

    -WindowLayer //contains the windows
I've subsequently managed to fix the issue; a piece of code from another plugin was causing the issue, I've since corrected the problem.

Original thread: https://forums.rpgmakerweb.com/threads/objects-extending-the-scene_map-prototype.83743/