Well Alt-F4 can be used if you going to developed a Online game that always upload and download data when you play and may cause problem if you interrupt the process like if someone pressed Alt-F4 while the Upload process begun the data may be corrupted when sent to the server thus causing problem both the user and the developer of a certain game.
RGSS300 Player - An Alternative to Ace's Game.exe
RGSSx Scripts In DevelopmentMany programs will capture alt+F4 and then trigger their own "Do you wish to quit?" choice for the user for example.
However with RM we don't exactly have a nice way to do it.
If you can provide an API for it to easily define our own behavior on the script side then it's easy.
That's not a matter of capturing Alt+F4, then, that's a matter of capturing the WM_QUIT signal (which is the signal sent by pressing Alt+F4 or by any number of other means the program provides, such as that nice, red X in the corner). It's basically a kill signal with "please" added at the end, whereas closing the program by killing the process in Task Manager just doesn't ask as nicely.
And for the record, I still fundamentally disagree with modifying expected behaviors.
Exactly, you said everything.
But I see no problems on modifying such behaviour in one or other software. Just to intercept the message and put a friendly message box asking if the user wants to exit, definitively would not kill no one. Disabling one (of many) ways of closing the software too.
OK, it would be padronized for the sake of simplicity for the final user, but sadly it doesn't happens as expected in every software. The softwares are different after all.
As a example, the Brazilian edition of Microsoft Office has lots of basic keyboard shortcuts completely swapped... And it made me mad all these years...
And remember it is only a pattern created by one or more persons, one of the infinite possibilities of creation, you can create your own concepts of UI, instead using an antiquated pattern.
that's why we have options don't we? as rafael suggested.
you don't like it? don't use it. 😀 .
it's a matter of personal taste. if you like to make food using textbook recipe. go ahead. if you like to experiment and let you tongue decide how many salt to use, how many pepper to use. it's okay too. the result of not following recipe is like schrodinger's cat. it could be better or it could be worse than using textbook recipe. but you don't know until you try it.
in case you don't know the schrodinger's cat theory. in his experiment of quantum mechanics. schrodinger put a cat inside a locked box with a vial of poison that will be opened at random time. while we don't open the box. the cat could treated both alive and dead. and after we open the box we will know the cat alive or dead. it's famous because of big bang theory tv series LOL. sorry if out of topic.
Well, leave the cat and the box for the quantum theories...
I'll mess a little with the code now. Regarding the Alt+F4 question, I have some alternatives, or things that I can implement together:
- Disable the Alt+F4 behaviour;
- Ask the user with a message box if he wants to exit;
- Disable the close button from the Main window (I already did it to the Console, to prevent some errors);
- Set some global variable/function on RGSS to allow the user create your own alternative;
For the Alt+Enter, I think we can optionally disable it and create other alternatives to put the game Window in fullscreen. Double click, and F4 are the ideias I have on mind and already implemented. I'll create a command line that change the registry key and launch the game fullscreen automatically too. Any ideas?
Oh, and more as thing, my first release will delay a bit, I haven't much time to write it these days. But if someone is needing a preliminary version, I can release it. With few features, it's obvious, but yet 100% functional. I hope this will help me to debug the code and I could see it working (or not) in different systems (I'm on Windows XP 32 Bits right now).
I'll mess a little with the code now. Regarding the Alt+F4 question, I have some alternatives, or things that I can implement together:
- Disable the Alt+F4 behaviour;
- Ask the user with a message box if he wants to exit;
- Disable the close button from the Main window (I already did it to the Console, to prevent some errors);
- Set some global variable/function on RGSS to allow the user create your own alternative;
For the Alt+Enter, I think we can optionally disable it and create other alternatives to put the game Window in fullscreen. Double click, and F4 are the ideias I have on mind and already implemented. I'll create a command line that change the registry key and launch the game fullscreen automatically too. Any ideas?
Oh, and more as thing, my first release will delay a bit, I haven't much time to write it these days. But if someone is needing a preliminary version, I can release it. With few features, it's obvious, but yet 100% functional. I hope this will help me to debug the code and I could see it working (or not) in different systems (I'm on Windows XP 32 Bits right now).
sorry about the cat 😛
and instead of capturing alt + f4 how if capturing WM_QUIT signal like solistra suggested. by doing that you actually doesn't have to disable the x button. since it also run the WM_QUIT signal. just a suggestion though.
If you develop an online game and don't write in the code to handle such a common occurence - it can happen for any number of reasons, many of which have nothing to do with the user - then worrying about things like Alt-F4 is the least of your problems.
I go back to my original question: Why would you even want to do this?
1) Alt-F4 is a failsafe for a runaway process.
2) If someone wants to quit playing, why make it harder for them - they're going to stop playing anyway.
3) OMG they might skip my autosave and go back to a previous save and avoid the Bad Thing that just happened - ctrl-alt-del will do the same thing through the task manager killing the game.exe process. Again, if they want to end the game, there's no way to really stop them.
And again, why? It's their game. "Cheaters", which most of them won't think of themselves as, since going back to a previous save is such a standard, are going to do it. It's not an online game where this gives them an advantage over other players, it's just them playing their game their way.
I hate it when people develop games on an engine that maps the "ESC" key to exit application and doesn't provide any confirmation for it. And it's always fun when someone's enjoying their game and bam you jump in and alt+f4 them.
A Snap Shot Screen feature would be great!
(It would be impossible but it be nice to play VX and or XP too)
(It would be impossible but it be nice to play VX and or XP too)
Great idea! And it's not hard to do!Well, lemme examine the code and prepare something to be launched here.
I'll see what is possible and what NOT is at this moment. I'm having some difficulties to work with some signals (aka "messages"), but I'll try to find some workarounds...
edit -----
Oh, and about the messages, I'm having troubles at blocking F12. Such a strange thing.
As a side note: I already tried a DLL exactly for this (NoF12.dll) but without success. Well, this one wasn't exacly made for VXA, I suspect that the F12 behaviour was totally rewritten in RMAce.
Any help in this question is more than appreciated.
News!
Well, I couldn't solve the F12 problem yet, but...
The screenshot function already works fine!
Need some adjusts yet, like if the console window is above, or if part of the game is offscreen, or if game is fullscreen, and other minor things. It's saving the screenshots in a .BMP, I'll see if I can do a conversion to .PNG. The naming pattern of the files is a thing I need to decide how it will be.
Again, thanks for the suggestion, ShinGamix. A good thing is that my Game Player can easily be adapted to XP or VX games.
Well, I couldn't solve the F12 problem yet, but...
The screenshot function already works fine!
Need some adjusts yet, like if the console window is above, or if part of the game is offscreen, or if game is fullscreen, and other minor things. It's saving the screenshots in a .BMP, I'll see if I can do a conversion to .PNG. The naming pattern of the files is a thing I need to decide how it will be.
Again, thanks for the suggestion, ShinGamix. A good thing is that my Game Player can easily be adapted to XP or VX games.
Honestly, if you can remove the F12 functionality, I would absolutely use this (despite your insistence on the ability to remove Alt+F4). Right now, I'm using a rather ugly hack to terminate the game in case F12 is triggered, but if I could disable processing of the key press in general, that would be greatly preferred. Removing Alt+F1 would be fantastic as well, considering the project I'm working on doesn't use any part of the standard Input module, meaning all of those input settings are absolutely useless -- and I'd rather not mislead players into thinking that they can modify input settings from the Alt+F1 dialog when I'm providing methods of modifying input settings in-game.
I wasn't able to intercept F12 at this moment... Yet!Alt+F4 (or click the X button) removing can be done, but I prefered to put a friendly message box asking if the user wants to exit. Let's say it's for the case someone press "accidentally".
The signal can be ignored, but it will work to both (keyboard shortcut and close button), and to make it to work only in one or other exclusively will need more work. I'll do this if someone wants, but not now.
Hey... Didn't you intended to say F1 instead Alt+F1. I tried it here and not worked. I'm sure you said about F1 dialog, am I wrong?
Yes, that's what I meant -- all of this talking about Alt+F4 has me thinking that function keys need to have Alt pressed in order to work, apparently. 😛
^_^ No problemo, Solistra.
Well, I'm decided to release a version in next days. Alt+Enter & F12 disabler won't will be on this. I'm planning to add them later. For Alt+F4, I'll make available the command-line "AskExit", to prevent, hmm, "accidental" closing of the game. (Imagine if you're playing hard by hours, and accidentally click the close button... Argh!).
What I can say about this first version, well, this will be for testing purposes, and don't have all features implemented due my lack of time or knowledge. All the special features will be accessed via command-line arguments. I'm preparing the list. The interactive console will have only 3 "special" commands: cls (clear the console screen), hide (hides the console), and exit (terminates the game). I planned to put the help command, to show how to use the other commands, but it's unnecessary at this point.
Anything (except the commands I said) you put in the interactive console it will try to interpret as a Ruby command with RGSS internal eval. This is pretty limited, there are some things that aren't be possible to do (deliberately, I guess), and it doesn't return any value. You can use it to set or check some variables, it's more than sufficient for a debbuger. Anyway, the commands won't work with scripts with more than a line (I'll add this feature later, easy one).
I'm having problems with output commands like puts, p, print, msgbox and msgbox_p. Here msgbox worked, but closes everything after I pressed OK =( . Fix some of these commands is a priority (if possible). P.S.: These commands will work normally in in-game scripts, the problems only appears when trying to run these in the interactive console.
More info later. See ya, guys.
Well, I'm decided to release a version in next days. Alt+Enter & F12 disabler won't will be on this. I'm planning to add them later. For Alt+F4, I'll make available the command-line "AskExit", to prevent, hmm, "accidental" closing of the game. (Imagine if you're playing hard by hours, and accidentally click the close button... Argh!).
What I can say about this first version, well, this will be for testing purposes, and don't have all features implemented due my lack of time or knowledge. All the special features will be accessed via command-line arguments. I'm preparing the list. The interactive console will have only 3 "special" commands: cls (clear the console screen), hide (hides the console), and exit (terminates the game). I planned to put the help command, to show how to use the other commands, but it's unnecessary at this point.
Anything (except the commands I said) you put in the interactive console it will try to interpret as a Ruby command with RGSS internal eval. This is pretty limited, there are some things that aren't be possible to do (deliberately, I guess), and it doesn't return any value. You can use it to set or check some variables, it's more than sufficient for a debbuger. Anyway, the commands won't work with scripts with more than a line (I'll add this feature later, easy one).
I'm having problems with output commands like puts, p, print, msgbox and msgbox_p. Here msgbox worked, but closes everything after I pressed OK =( . Fix some of these commands is a priority (if possible). P.S.: These commands will work normally in in-game scripts, the problems only appears when trying to run these in the interactive console.
More info later. See ya, guys.
New Suggestion:
Would there be any way to add a video capture feature too?
That would make demo and tutorial videos so much easier to do also.
and a quick follow up question:
But is there any way to make it an all in one RGSSX player?
additionally:
If you can not remove the esc and F12 shortcuts could you at least add a confirmation protocol to it before it would reset or exit?
This would stop the major issue of accidental and unconfirmed trigger events of unwanted closing or resets.
Would there be any way to add a video capture feature too?
That would make demo and tutorial videos so much easier to do also.
and a quick follow up question:
But is there any way to make it an all in one RGSSX player?
additionally:
If you can not remove the esc and F12 shortcuts could you at least add a confirmation protocol to it before it would reset or exit?
This would stop the major issue of accidental and unconfirmed trigger events of unwanted closing or resets.
Ops, it can be done, but it would demand lotta work. First I'll focus on the important features and bugfixes, I can see this suggestion later, in future.
Yes, it's perfectly possible to do, and very easy, I suppose. Almost every piece of code is the same, only need to add some line here and there, and check some files. I'll work on this idea as soon the first version is ready, okay?
I managed to remove F1 (in two ways) and F2 perfectly, Alt+F4 can be controlled/ignored as well, I already put the option to ask the user. I only need to work on Alt+Enter (it would be easy) and the problematic F12. This is a matter of time, IMO.Now I'm working with enabling/disabling the buttons in caption bar, that's a funny part. After this, a "critic" part need to be made. I need to invest some time to create a generic exception hadler, I'm having problems with the build in "Release" mode. It crashes when I try to get the WndProc. Everything worked fine in "Debug" mode settings here, that's so strange...
Intentional double post. I'm not dead (yet)!
Well, I had some problems with viruses on my Dropbox and I had to format the PC here last week. I need to install VC++ 2010 again... Anyway, my source-code is secure, I haven't lost anything important.
But I need to study to the final exams, and the project will delay a bit. The project will need some work before a decent release.
Anyway, if someone wants to test a preliminary version, download it [here]. Warning: This is a preliminay version I've compiled, and isn't even ready for a demo/beta and has lots of bugs, so be careful as I'm not responsible for anything may happen.
Please test and then delete the files. Just put the files in a game folder and run. To run the "release version" you may need to download and install [Microsoft Visual C++ 2010 Redistributable]. The "debug version" only will work if you have VS installed or the necessary DLLs.
You may try the 3 new hotkeys I added to the player:
F4: Toggle Fullscreen;
F10: Take a screenshot;
F11: Show/hide the Interactive Console.
The command-line available are the following. Please note it's a partial list, and most of the don't work properly yet. Some features were 'permanently activated' in this build and the equivalent command would be unnecessary or unfunctional.
And, the most important: Don't distribute any game containing these files! Test and delete them all! They're for testing purposes and redistribution is prohibited.
Thanks for the support! Soon I hope it will be ready for its first release.
Well, I had some problems with viruses on my Dropbox and I had to format the PC here last week. I need to install VC++ 2010 again... Anyway, my source-code is secure, I haven't lost anything important.
But I need to study to the final exams, and the project will delay a bit. The project will need some work before a decent release.
Anyway, if someone wants to test a preliminary version, download it [here]. Warning: This is a preliminay version I've compiled, and isn't even ready for a demo/beta and has lots of bugs, so be careful as I'm not responsible for anything may happen.
Please test and then delete the files. Just put the files in a game folder and run. To run the "release version" you may need to download and install [Microsoft Visual C++ 2010 Redistributable]. The "debug version" only will work if you have VS installed or the necessary DLLs.
You may try the 3 new hotkeys I added to the player:
F4: Toggle Fullscreen;
F10: Take a screenshot;
F11: Show/hide the Interactive Console.
The command-line available are the following. Please note it's a partial list, and most of the don't work properly yet. Some features were 'permanently activated' in this build and the equivalent command would be unnecessary or unfunctional.
btesttest
askexit
fixedpos
dropshadow
borderless
alwaysontop
fullscreen
noclosebtn
nominimize
resizeable
nof1
nof2
addf3
addf4
addf11
nohotkeys
addhotkeys
askexit
fixedpos
dropshadow
borderless
alwaysontop
fullscreen
noclosebtn
nominimize
resizeable
nof1
nof2
addf3
addf4
addf11
nohotkeys
addhotkeys
Thanks for the support! Soon I hope it will be ready for its first release.
Has anyone tested it? Okay I will give it a try RafaSol.
Dropbox can get viruses? Yikes. I would suggest you getting AVG 2013! My pc is verry very secure.
So where do I get the dll from and why didnt you include it?
now it says MSVCP100D.dll? Well I guess I am not testing this.
Also I can not read french on the error message.
Dropbox can get viruses? Yikes. I would suggest you getting AVG 2013! My pc is verry very secure.
So where do I get the dll from and why didnt you include it?
now it says MSVCP100D.dll? Well I guess I am not testing this.
Also I can not read french on the error message.
Original thread: https://forums.rpgmakerweb.com/threads/rgss300-player-an-alternative-to-aces-game-exe.4684/