All encounter instances in code that points to Scene_Battle?

Mercutio604

Villager
Member
Joined
Dec 24, 2019
Messages
5
Reaction score
1
First Language
Tagalog/English
Primarily Uses
RMMV
So far I got the random encounter to set to my own battle scene....
But its all I could find.
Code:
Scene_Map.prototype.updateEncounter = function() {
// go to my new one.
}
but where are the rest of them located?

For example:
When I do
event editor > Battle Processing....
This makes it go to the original Battle Scene.

Where do I change it so that it goes to my version of the battle scene?


Now I could just override battle scene and be done with it but....
Might as well learn more stuff doing it this way.

Any help would be appreciated.
 

Kaelan

Veteran
Veteran
Joined
May 14, 2012
Messages
767
Reaction score
462
First Language
Portuguese
Primarily Uses
N/A
Just look for every instance of Scene_Battle in all of the rpg_xxxx.js files.

It's called during Scene_Boot.start() for test battles
JavaScript:
Scene_Boot.prototype.start = function() {
    Scene_Base.prototype.start.call(this);
    SoundManager.preloadImportantSounds();
    if (DataManager.isBattleTest()) {
        DataManager.setupBattleTest();
        SceneManager.goto(Scene_Battle);
Inside Game_Interpreter.command301() for battles triggered via events
JavaScript:
// Battle Processing
Game_Interpreter.prototype.command301 = function() {
    if (!$gameParty.inBattle()) {
        var troopId;
        if (this._params[0] === 0) {  // Direct designation
            troopId = this._params[1];
        } else if (this._params[0] === 1) {  // Designation with a variable
            troopId = $gameVariables.value(this._params[1]);
        } else {  // Same as Random Encounter
            troopId = $gamePlayer.makeEncounterTroopId();
        }
        if ($dataTroops[troopId]) {
            BattleManager.setup(troopId, this._params[2], this._params[3]);
            BattleManager.setEventCallback(function(n) {
                this._branch[this._indent] = n;
            }.bind(this));
            $gamePlayer.makeEncounterCount();
            SceneManager.push(Scene_Battle);
        }
    }
    return true;
};
and during Scene_Map.updateEncounter() for random battles
JavaScript:
Scene_Map.prototype.updateEncounter = function() {
   if ($gamePlayer.executeEncounter()) {
       SceneManager.push(Scene_Battle);
   }
};
 

Mercutio604

Villager
Member
Joined
Dec 24, 2019
Messages
5
Reaction score
1
First Language
Tagalog/English
Primarily Uses
RMMV
I thought I searched all the files but I might have selectively chosen files trying to find where I would expect them.... my bad.

But the second one is the one I was looking for thanks!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,482
Reaction score
12,026
First Language
English
Primarily Uses
RMMV
Everything you do with event commands is in the Game_Interpreter class, found at the bottom of rpg_objects.js - a very interesting class to look through to get a feel for "how things work"
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I wonder if there's ever been an art challenge that involves drawing faces from the generator.
I'm sorry about earlier. I have the most hate and the most love for my art at the same time. Felt bad about my thread because I wasn't listening, and because I made it out of a bad mindset to begin with. S'another Thursday for me.

The main character of the book)
Things you can say about your rpg maker project but not your bf/gf: I'm not super committed but it's fun to play around with it.

Forum statistics

Threads
94,368
Messages
920,349
Members
124,134
Latest member
scrollstorm
Top