How to quit a program gracefully?

Non-platform specific questions.

How to quit a program gracefully?

Postby Just4Fun » Sun Mar 14, 2004 4:11 pm

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:
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby ingsan » Sun Mar 14, 2004 4:43 pm

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 :?
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby ingsan » Sun Mar 14, 2004 4:45 pm

:o i tested it and it works with perfect grace ! :wink:
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby Just4Fun » Sun Mar 14, 2004 5:40 pm

That did it! :)
Thank You, ingsan...
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby ingsan » Sun Mar 14, 2004 5:45 pm

:wink:
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby Just4Fun » Sun Mar 14, 2004 6:15 pm

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
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby ingsan » Sun Mar 14, 2004 8:27 pm

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 :?
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby Just4Fun » Sun Mar 14, 2004 8:52 pm

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
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby ingsan » Sun Mar 14, 2004 9:06 pm

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
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby NyahKitty » Wed Dec 07, 2005 10:47 pm

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?
Samples of my art can be found at:

http://www.HodgePodgeStudios.com
User avatar
NyahKitty
 
Posts: 65
Joined: Fri Jul 29, 2005 1:28 am
Score: 0 Give a positive score

Postby Novice » Thu Dec 08, 2005 10:17 am

Try creating a timer that will cover the lenght of the fade and on timer exit game.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby makslane » Thu Dec 08, 2005 12:21 pm

In the fader actor:

if(transp >= 1.0)
{
ExitGame();
}
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron