How do you make a screensaver or exe file created with the Game engine quit when you move the mouse?
Try searching the forum.
check your email
I have all ready tried the method that the link above points to (thoro’s method). It does not work for me. the file plays for 3 seconds and stops when the mouse is in the player window.
I also have tried to do what you have suggested PlantPerson. When I use a mouse movement sensor wired to a quit game actuator, the file stops playing as soon as it tries to start.
I am running windows 2000, I have python 20, python22 and python23 all installed on my computer. I had the PYTHON variables path set up to python20. I changed it to point to python23 and it still did not work.
Thanks for responding and I hope you will continue to try and help me with this problem. I am very new to the game engine and python.
Hmm, strange - does the executable (rename BlendSaver.scr to BlendSaver.exe) from this archive (http://www.pixelfresse.de/BlendSaver.zip) work on your system? I run Blender and this screen saver on XP machines.
Here’s my blend file, does it work in Blender on your system? http://www.pixelfresse.de/BlenderLogo_Screensaver.blend
Blender 2.35 is designed to run with Python 2.3, but I think my little script uses only built in functions, so this should not be an issue - correct me if I’m wrong.
Thanks thoro. Now I know that I was doing everything right, but I still have a problem.
The Blendersaver.exe from the Blendersaver zip exits after 3 seconds without me touching anything. I also downloaded the .blend file that you posted and it quits after 3 seconds as well.
I don’t know anything about python or coding so I don’t know what it could be.
I downloaded the screensavers that Harray made and they exit when I move the mouse but I don’t know the method he uses. I don’t have one of his .blend files. Looking above he likes your method better.
If you can think of what might be causing this please let me know.
MIDIJE, could you please open the blend file, delete the mouse sensor, hit ‘P’ key to play and check if it works with only the keyboard sensor listening? And how do the two varables behave? You can see them in the upper left, they are called OBSensor.timer and OBSensor.quit. OBSensor.timer should just count the time and OBSensor.quit should be 0 until you hit a key.
Let’s see if we can trace this…
When I hit P with the keyboard sensor and the mouse sensor added, the ObSensor.timer reaches 3 and the Obsensor.quit goes to 1 and the file quits running.
When I delete the mouse sensor and hit P, the OBsensor.timer continues to run pass 3 and when I hit a key on the keyboard the OBsensor.quit goes to 1 and the file stops running.
…so the mouse sensor seems to be the one we have to look for.
I changed the mouse movement sensor to a mouse over sensor I attached to a black background plane. I also deactivated TRUE pulse mode for this sensor (just a test, you can play with this option).
Thanks for the test .blend. Here is whats happening now. In the 3D window while in camera view, if I place the mouse outside of the black plane or outside of the camera view and hit P. The file will run until I move the mouse over the black plane area, but it will not stop running if I move the mouse around outside the black plane.
With the mouse outside the black plane if I hit any key the file will stop running.
If I place the mouse over the black plane area and hit P the file runs for a few seconds and stops and the OBsensor.quit changes to 1 without me touching anything. Some times it runs for 3 seconds, sometimes 5 and even up to 7 seconds before the OBsensor.quit changes to 1 and the file stops.
I understand if you can’t spend a lot of time on this and I thank you for all you have done.
hey there is a new feature coded into blender, when you export as runtime and save as *.scr it is now a screensaver, you right click it installs, no more .bat things and junk also mouse/keyboard make the screensaver go away, its in cvs.
…hey, sounds cool. Thanks for the tip, Mark62756.
I looked for this option in the current 2.36 Release Candidate and could not find it - if I save a runtime with .scr, it’s still a standard exe file. Is it already released?