Typing "0" unloads level??

Posted By: gSet

Typing "0" unloads level?? - 11/26/10 17:17

I made a function for a text box, but for some reason when you use the 0 key it unloads the level and everything in it. I can't seem to figure it out but this must be built into the engine, and I need to disable it so that the player can use the 0 key without causing problems. Is there something obvious, or a way to work around this? Can't find much in the documentation. Thanks!
Posted By: 3run

Re: Typing "0" unloads level?? - 11/26/10 19:14

What you mean by 'unloads the level'??
Could you explain a bit more?
Posted By: Pappenheimer

Re: Typing "0" unloads level?? - 11/27/10 09:46

Write this into the main function:

on_0 = NULL;
Posted By: MrGuest

Re: Typing "0" unloads level?? - 11/27/10 11:27

Originally Posted By: Pappenheimer
Write this into the main function:

on_0 = NULL;
this won't work unless it's after a wait() command as default.c still overwrites key functions set to NULL.

or just comment out #include default.c
Posted By: gSet

Re: Typing "0" unloads level?? - 11/29/10 13:40

It seemed like 0 was unloading the level (sorry for the lack of clarification on that but it's now not necessary..) but it actually seems to be doing something strange with the camera, maybe placing it below the level. I tried commenting out #include default.c, but I think it's included whether or not you state that in the newest version, so I can't tell if it's because of some built in functionality for 0 or because of some strange thing in my own code.

I'm open to suggestions, but I'm also just going to keep looking through my own code to see if that may be the problem - though I can't find anything so far...

Edit: Placing on_0 = NULL; in my main function actually fixed this, so regardless of the problem it's not happening anymore.. I just wish I knew what it was.
Posted By: Pappenheimer

Re: Typing "0" unloads level?? - 11/29/10 18:51

Originally Posted By: MrGuest
Originally Posted By: Pappenheimer
Write this into the main function:

on_0 = NULL;
this won't work unless it's after a wait() command as default.c still overwrites key functions set to NULL.

or just comment out #include default.c

This makes no sense to me.
The engine reads through the scripts from beginning to end.
When #include default.c is before the main function, it can't overwrite the on_0 = NULL; - that's at least how I understand it.
Posted By: Redeemer

Re: Typing "0" unloads level?? - 11/29/10 19:10

Pressing "0" while testing your game will allow you to move the camera around using the arrow keys, but it will also cause the camera to abruptly change position. This will not happen in the published version of your game, with or without the "on_0 = NULL;" statement.
Posted By: MrGuest

Re: Typing "0" unloads level?? - 11/29/10 23:13

Originally Posted By: Pappenheimer
Originally Posted By: MrGuest
Originally Posted By: Pappenheimer
Write this into the main function:

on_0 = NULL;
this won't work unless it's after a wait() command as default.c still overwrites key functions set to NULL.

or just comment out #include default.c

This makes no sense to me.
The engine reads through the scripts from beginning to end.
When #include default.c is before the main function, it can't overwrite the on_0 = NULL; - that's at least how I understand it.
lol, if I ever understood what gamestudio tried doing I'm sure I'd have a medal by now

Code:
#include <acknex.h>
#include <default.c>

void main(){
	
	on_esc = NULL;
}

running this will still close the application when pressing escape, though I'd of thought when reading through default.c it would run any _startup() functions before the main() function, obvsiously not in this case crazy
© 2024 lite-C Forums