Page 1 of 1

How to quit a program gracefully?

PostPosted: Sun Mar 14, 2004 4:11 pm
by Just4Fun
How would I end a program's execution when a user left mouse clicks on an object/actor?


(You guys have really been busy! I feel like the perpetual last person in the race...) :cry:

PostPosted: Sun Mar 14, 2004 4:43 pm
by ingsan
i never tested it but u can try this :
    add Event(on given actor) MouseButtonDown
    Click on Left-click
    add Action Script Editor and write :


Code: Select all
ExitGame();


i think that could work :?

PostPosted: Sun Mar 14, 2004 4:45 pm
by ingsan
:o i tested it and it works with perfect grace ! :wink:

PostPosted: Sun Mar 14, 2004 5:40 pm
by Just4Fun
That did it! :)
Thank You, ingsan...

PostPosted: Sun Mar 14, 2004 5:45 pm
by ingsan
:wink:

PostPosted: Sun Mar 14, 2004 6:15 pm
by Just4Fun
Another thought/question -

Suppose I would like the program to end when:

Event - Left Mouse Down on actor

Then: a script for keydown <Escape key> so that the program would terminate back to the Game Editor development environment.

Can this be done? How? I've checked the C syntax site and can't find anything on how to do it. TIA

PostPosted: Sun Mar 14, 2004 8:27 pm
by ingsan
Do you want a mouse left-click and an Escape key to BOTH end GE program in Game mode or do u want an exe to switch u to GE program on Escape button ?
i don't understand :?

PostPosted: Sun Mar 14, 2004 8:52 pm
by Just4Fun
ingsan,

I would like to have one button in the program that would,when pressed, exit into the Game Editor ide without having to physically press the Esc Key. This would be a way to break out of a running program for testing purposes. I'm not even sure that it can be done. When I use the exit script that you kindly taught me, the GE ide tries to shut down too.

Thank you for trying to help me. I'm learning a lot, but one question leads to another ... Rachel

PostPosted: Sun Mar 14, 2004 9:06 pm
by ingsan
Dont't worry about asking questions. I'm glad to try helping u :wink:
Ok, now.

The difference between GE demo version and GE Pro 1.1 is that, if u tell the Escape key to quit the game, in GEPro's .exe, the game just quits like a totally normal game.

Whereas when u are in Game mode (in demo version as well as pro version)pressing the Escape key will try to end GE application, and it's just what happening to u. But no Worries !Keep Cool and don't PANic ;:,!"é,(çàèé"(!:é(ù: :lol: This mean that IT WORKS ! :P

PostPosted: Wed Dec 07, 2005 10:47 pm
by NyahKitty
Ok.. I can get the game to quit when I click an actor made for exiting the game.

Now, I want to make that actor fade when clicked and then exit the game after that actor is 100% transparent.

How do I do that?

Right now I use a two actor process:
-the first actor is the original X
-the second actor is a big red X which appears over the first X
-the second actor starts to fade right after it was created
Great so far
-now I set up a conditional event that says that if the second actor's tranparency equals 100%, the program should exit, using the script
ExitProgram ();
I've also tried having the second actor destroyed when it reaches 100% transparency. When this actor dies, then have the program exit.

Either way, I've gotten no results except with the Mouse Button Up event.

Is there a way to handle this so I can have nifty fade VFX for my actor and then the program exits?

PostPosted: Thu Dec 08, 2005 10:17 am
by Novice
Try creating a timer that will cover the lenght of the fade and on timer exit game.

PostPosted: Thu Dec 08, 2005 12:21 pm
by makslane
In the fader actor:

if(transp >= 1.0)
{
ExitGame();
}