Hello! :kaohi:How can I make my rmmv game so that when you try to close the game a message pops up and either allows you or not to close it? I don't mean a confirmation window. What I'm asking is: can I disable the player's ability to close the game for a short period of time??
Disable close game
● ARCHIVED · READ-ONLY
-
-
Alt+F4 works every time. I use it, since it's shorter. Other than that it is possible, but requires some code modification.
-
Alt+F4 works every time. I use it, since it's shorter. Other than that it is possible, but requires some code modification.
Hmm I'll try that, but how will that work for everyone? I mean, I want the player to be unable to close the game window, after clicking a specific event. What should the event be? It's ok if it needs coding, I have some basic knowledge of javascript, I think I'll get it . -
I don't think you can, as that would violate how windows works, as in windows you have to be able to ALT-TAB to other windows, and ALT-F4 is emergency close.
Plus, what are you going to do for those players who have to leave RIGHT NOW and can't keep playing?
Edit: And don't forget there is always CTR+ALT+DELETE then kill process. That as far as I know cannot be stopped by any program. -
I don't think you can, as that would violate how windows works, as in windows you have to be able to ALT-TAB to other windows, and ALT-F4 is emergency close.
Plus, what are you going to do for those players who have to leave RIGHT NOW and can't keep playing?
Edit: And don't forget there is always CTR+ALT+DELETE then kill process. That as far as I know cannot be stopped by any program.
I'm not that evil, don't worry:wink:. This is how I was planning to use it:
It's a sci-fi/horror game that breaks the fourth wall quite often. So, the protagonist whould ask the player to close the game, and when the player would try to, the game would not close and the antagonist would state that this is their prison now. But then, immediately after that, another character would autosave and close the game normally, going against the antagonist's plans. That's what I want to do. That's why I need this feature. I just want to scare the players a little bit XD. It will close eventually.
Also, I think that you can program your game to do a certain thing when you try to close it. For example, in oneshot, everytime you closed the game, it would make a window pop up, and it would autosave. -
Also thank you both for replying that quickly!!!:kaocry:
-
Well, the easiest way would be to edit your menu; A command has two compulsory and two obligatory parameters: compulsory are name and handler, obligatory is condition for it to be enabled and the fourth is irrelevant.
So instead of this
Code:you can edit the To title command like this:listWindow.addCommand (name, handler)
Code:which would enable the game close when the switch is on and when the switch is off, it would be disabled. Of course it's not the exact code, since I don't know how the menu window is called, but that shouldn't be a problem. It's in Scene_Menu by default btw.listWindow.addCommand(name, handler, $gameSwitches.value(1) ? true : false);
It's a basic illustration, but you can do pretty much anything you want if you know how.
As for what @bgillisp has said, he's right. Alt+F4 works. It's possible to overwrite it, but only with low level languages. And even if you blocked whole windows from scanning input, which is not that hard, the Ctrl+Alt+Delete would still work, because Ctrl+Alt+Delete is a level 0 function, meaning it runs on the aecurity layer of Windows, where it's only touchable via Assembler language. -
Hmm I see! Thank you very much! I'll try it asap, and I hope that it will work :kaojoy:Well, the easiest way would be to edit your menu; A command has two compulsory and two obligatory parameters: compulsory are name and handler, obligatory is condition for it to be enabled and the fourth is irrelevant.
So instead of this
Code:you can edit the To title command like this:listWindow.addCommand (name, handler)
Code:which would enable the game close when the switch is on and when the switch is off, it would be disabled. Of course it's not the exact code, since I don't know how the menu window is called, but that shouldn't be a problem. It's in Scene_Menu by default btw.listWindow.addCommand(name, handler, $gameSwitches.value(1) ? true : false);
It's a basic illustration, but you can do pretty much anything you want if you know how.
As for what @bgillisp has said, he's right. Alt+F4 works. It's possible to overwrite it, but only with low level languages. And even if you blocked whole windows from scanning input, which is not that hard, the Ctrl+Alt+Delete would still work, because Ctrl+Alt+Delete is a level 0 function, meaning it runs on the aecurity layer of Windows, where it's only touchable via Assembler language. -
Ok I'm terrible at this, I did not make any progress XD. How can I find the scene menu? Is it the rpg_scenes.js?