Automatic restart of game after crash

Hi,

I have made a game recently. Sometimes the game will shut down (or crash) without an error message either form Blender or windows. The game will close when people are going buttonbashing. How can I automaticly restart my exe file when it’s closed?

Is it in Windows XP possible to check if an process in taskmanager is running and if it’s not run the process? Or are there other posibilities?

I hope someone can help me. Thanks…

I don’t think you want it to restart on crash/exit.

That could make a highly frustrating loop if for some reason it crashed consistently.
crash > restart > crash > restart etc.

Unless I misunderstand you.

Yeah that’s true, but how can I else prevent people from buttonbashing? Also the game runs at an exhibit, so when it crashes it needs to automatticly run again.

Let me explain what happens.

The game only uses 3 action buttons, 2 buttons to walk forward and backwards and a trackball to rotate the direction the player is looking.

If you press an action button most of the time a menu pops up (wich are all overlay scenes), or the heads up display changes. If I quickly press 2 buttons (or press them at the same time) than menu’s will blend in eachother and that’s not what it’s suppose to be doing.

Also when I press several button at the same time and keep bashing them, blender will shut down, no error or someting, just shutting down.

More info: The game runs on Windows XP if that’s relevant :stuck_out_tongue:

Has anybody have an idea how to prevent / solve this?

Disable the menu buttons while the action is being played. When the action is done, turn them back on. You can use python do to this or logic buttons.

To use Logic bricks, take a look at the thread below to see how Blendenzo did something similar with a switch true property. You’d put something like that on all of the buttons you want to disable while the action is running.

http://blenderartists.org/forum/showthread.php?t=97303

Python. Use a Global variable. Something like GameLogic.buttonReady = True. Set it to false while the action is running and back to true when the action is done. Then you’d use something like this on all of the buttons you want to disable

if GameLogic.buttonReady == True:
GameLogic.buttonReady = False
(code to run action)

When the action is done running, GameLogic.buttonReady = True

Allright, thanks for the help, that’s indeed a good idea. I’ll try that and test it and post the result back again.

It works great :smiley: thanks… Used the Python method. Now I just have to check if the game doesn’t crash anymore…