MV Exit to title scene help

Hey guys

I just started trying to learn a little scripting in RMMV, and ive hit a bit of a wall. Im trying to make a simple end game screen like this

menu.png



this almost works, it goes to title correctly if thats chosen but if i hit cancel this screen pops up

menuafter.png




I have no idea where this came from. If you hit yes it goes to the title, and no takes you back to the first image and itll just loop if you keep hitting cancel.

function Scene_Exit() {
this.initialize.apply(this, arguments);
}

Scene_Exit.prototype = Object.create(Scene_MenuBase.prototype);
Scene_Exit.prototype.constructor = Scene_Exit;

Scene_Exit.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
};


Scene_Exit.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this._exitWindow = new Window_Exit(259, 45, 282, 150);
this.createCommandWindow();
this.addWindow(this._exitWindow);
};

function Window_Exit () {
this.initialize.apply(this, arguments);
}


Scene_Exit.prototype.createCommandWindow = function() {
this._commandWindow = new Window_GameEnd();
this._commandWindow.setHandler('toTitle', this.commandToTitle.bind(this));
this._commandWindow.setHandler('cancel', this.popScene.bind(this));
this.addWindow(this._commandWindow);
};

Scene_Exit.prototype.commandToTitle = function() {
this.fadeOutAll();
SceneManager.goto(Scene_Title);
};

//text window
Window_Exit.prototype = Object.create(Window_Base.prototype);
Window_Exit.prototype.constructor = Window_Exit;

Window_Exit.prototype.initialize = function (x, y, width, height) {
Window_Base.prototype.initialize.call(this, x, y, width, height);
this.drawAllItems();
}

Window_Exit.prototype.drawAllItems = function (){
let Exit = "Exit to Title Screen?"
this.drawText(Exit, 35, 30, 200,);
};

Heres the code I have. I mostly tried to just copy it from the existing files but im not too sure what im doing yet and where it could have come from. If anyone could help id super apprecate it!
How do you enter Scene_Exit?
How do you enter Scene_Exit?
Well that part I got figured out now thanks for reminding me I put a box in the common event menu XD
Screenshot 2024-08-18 16191.png


BUT now that I took that out if i hit cancel it just stays on that first picture instead of exiting the scene

Screenshot 2024-07-01 175923.png


theres how its made to leave the scene. I used the picture menu tutorial here
im guessing i have to have canceled be pressed somehow? but i have no idea how to go about that
I maybe wrong but the script runs in the map scene.
So when it changes to another scene maybe the script stops working?

Also I don't think you need to write a plugin for that. Maybe you can just use dialogue + choices ?
Why are you making a plugin to do something that's built into MV by default?

Even if you want to pull up the quit option from someplace other than the menu, all you have to do is push Scene_GameEnd and all the code is already written for you.

(Personal opinion: I hate those confirmation dialogues. In 30-some years of playing video games, I have tried to quit by accident zero times. There's no reason to ask me again. How often do you accidentally quit, that you think it's a good idea? 😉 )
Well when they make you a habit to click confirm for everything, a confirm dialogue won't prevent your from making mistakes.:LZScheeze: But I don't think people usually bother to quit the game via the menu, so if someone see the dialogue there is a higher chance they click it by mistake.
As for me, I just press F5 or Alt+F4 or click the X button.
Well when they make you a habit to click confirm for everything, a confirm dialogue won't prevent your from making mistakes.
Yes, I think that supports my point.

But I don't think people usually bother to quit the game via the menu...As for me, I just press F5 or Alt+F4 or click the X button.
Unless you and these people are primarily playing RPG Maker games, many-to-most professional games have disabled Alt+F4 and you have to quit via the menu (or pulling up the task manager for some reason). I suspect a significant portion of the gaming populace isn't even knowledgeable about that Windows shortcut.

Not to mention it would bypass and screw with the "save and quit" that most games do.
I maybe wrong but the script runs in the map scene.
So when it changes to another scene maybe the script stops working?

Also I don't think you need to write a plugin for that. Maybe you can just use dialogue + choices ?

I tried doing that first but i didn't want the dialogue window so huge so i started with making the text box. I want everything to fit inside the screen part of the picture. I'm sure there is an easier way to do that with script calls maybe I'll look into that it would have saved me a lot of trouble 😛
Why are you making a plugin to do something that's built into MV by default?

Even if you want to pull up the quit option from someplace other than the menu, all you have to do is push Scene_GameEnd and all the code is already written for you.

(Personal opinion: I hate those confirmation dialogues. In 30-some years of playing video games, I have tried to quit by accident zero times. There's no reason to ask me again. How often do you accidentally quit, that you think it's a good idea? 😉 )

I grabbed what i thought were the important bits from that scene and changed it cause it didnt come with the box on top for text. I made that part first and just renamed the scene_GameEnd code to exit cause I thought you had to keep it all in like one scene. Ive been trying to figure out what things in the code are from trial and error, I started messing with things like 2 days ago I still have no clue what Im doing really 😛

Also I wanted to fill the phone menu up with more apps so i did an exit screen to try and make it a little more cluttered, it looked weird so empty XD

Edit: I just tried calling scene_GameEnd instead of what i used and it still loops on that screen if i hit cancel :c
I grabbed what i thought were the important bits from that scene and changed it cause it didnt come with the box on top for text. I made that part first and just renamed the scene_GameEnd code to exit cause I thought you had to keep it all in like one scene. Ive been trying to figure out what things in the code are from trial and error, I started messing with things like 2 days ago I still have no clue what Im doing really 😛
My advice as a coder and teacher - it's going to be very difficult to progress that way. I strongly suggest you take some time to do a JavaScript tutorial/course. It won't have anything strictly to do with RPG Maker in the beginning, but you'll learn and understand what you're doing in a structured fashion with a logical progression of knowledge.

When you're done, everything you read in the code should mean something, such that you can look at MV's code and follow the flow of function calls to know what's happening.

There are lots of options if you Google it, I like the w3schools tutorial, starting with the Statements chapter.

Edit: I just tried calling scene_GameEnd instead of what i used and it still loops on that screen if i hit cancel :c
I can't duplicate your bug. I opened a project and, while standing on the map, called SceneManager.push(Scene_GameEnd)

When I select Cancel, the window closes and I'm back on the map. There must be a logical error in some other part of how you're getting there.
My advice as a coder and teacher - it's going to be very difficult to progress that way. I strongly suggest you take some time to do a JavaScript tutorial/course. It won't have anything strictly to do with RPG Maker in the beginning, but you'll learn and understand what you're doing in a structured fashion with a logical progression of knowledge.

When you're done, everything you read in the code should mean something, such that you can look at MV's code and follow the flow of function calls to know what's happening.

There are lots of options if you Google it, I like the w3schools tutorial, starting with the Statements chapter.


I can't duplicate your bug. I opened a project and, while standing on the map, called SceneManager.push(Scene_GameEnd)

When I select Cancel, the window closes and I'm back on the map. There must be a logical error in some other part of how you're getting there.
I may just have to take your advice and actually do some learning. 😛 I'm sure I did something somewhere but yeah I just would have no clue
Thanks anyway for trying to help c:

Original thread: https://forums.rpgmakerweb.com/threads/exit-to-title-scene-help.171187/