Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Trading Journey
by 7th_zorro. 04/27/24 04:42
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TipmyPip, Ayumi), 769 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
sys_exit #440326
04/23/14 19:45
04/23/14 19:45
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline 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:

Code:
function on_esc_event(){sys_exit("321");}



and that didn't work, which is strange since

Code:
function on_x_event(){sys_exit("321");}



^^ This does.

Hmm..?


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: sys_exit [Re: DLively] #440328
04/23/14 19:49
04/23/14 19:49
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Have you tried to set
on_esc = ...;
somewhere in your script (let's say the main function)?


"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] #440330
04/23/14 19:58
04/23/14 19:58
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Yes and with no result smirk

Its very strange as I have not defined anywhere that on_esc = null


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: sys_exit [Re: DLively] #440331
04/23/14 20:09
04/23/14 20:09
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Do you have default.c included? Normally this should not overwrite it but try to comment the include of default.c and try again.


"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] #440333
04/23/14 20:57
04/23/14 20:57
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
No such luck smirk

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.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
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 Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Then you're overwriting on_esc yourself. This sample code works flawlessly:
Code:
#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: Uhrwerk] #440338
04/23/14 22:32
04/23/14 22:32
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
that is literally the only place in my script that deals with esc.

I tried your alternative with much excitement and it didn't work for me smirk


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: sys_exit [Re: DLively] #440339
04/23/14 22:37
04/23/14 22:37
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
as mentioned every other key seems to work..


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
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 Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Code:
#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 Offline OP
Serious User
DLively  Offline 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.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1