|
sys_exit
#440326
04/23/14 19:45
04/23/14 19:45
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
OP
Serious User
|
OP
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
Hi, I am noticing that I cannot use my esc button to exit my game. I've tried:
function on_esc_event(){sys_exit("321");}
and that didn't work, which is strange since
function on_x_event(){sys_exit("321");}
^^ This does. Hmm..?
|
|
|
Re: sys_exit
[Re: Superku]
#440333
04/23/14 20:57
04/23/14 20:57
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
OP
Serious User
|
OP
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
No such luck This also happens on my other machine. This works: function on_grave_event(){sys_exit("321");} with or without the default.c
Last edited by DLively; 04/23/14 20:57.
|
|
|
Re: sys_exit
[Re: DLively]
#440334
04/23/14 21:28
04/23/14 21:28
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
Then you're overwriting on_esc yourself. This sample code works flawlessly:
#include <acknex.h>
function on_esc_event()
{
printf("Oh yeah!");
sys_exit(NULL);
}
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: sys_exit
[Re: DLively]
#440340
04/23/14 22:46
04/23/14 22:46
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
#include <acknex.h>
void main()
{
while(1)
{
DEBUG_VAR(key_esc,20);
wait(1);
}
}
If this shows 1 then you are overwriting it somewhere else, maybe in some include file, I don't know. Maybe add an "DEBUG_VAR(on_esc,40);" as well.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: sys_exit
[Re: Superku]
#440350
04/24/14 07:45
04/24/14 07:45
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
OP
Serious User
|
OP
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
It stays at 0 :?
It was 1 giant script. There was no esc being used until I tried to define it cause it wasn't working.
If I try DEBUG_VAR(on_esc,40); I get a number 207856.813
Last edited by DLively; 04/24/14 07:45.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|