Possible reasons for a black screen

Started by Monsieur OUXX, Wed 13/06/2007 10:46:12

Previous topic - Next topic

Monsieur OUXX

Hi,

I'm at debugging phase for my script, and when i launch ("Test") the game, it instantly freezes into a black screen (this is normal because the bug in my script is probably in the initialization code - it's executed at startup)

My question is : what could cause a black screen?
- does AGS detect an infinite loop after a few seconds? (it would mean it's something else)
- is the screen black because AGS couldn't display anything yet, before freezing ?
- are there some special cases where AGS simply crashes (without exiting) instead of giving a reason such as 'index out of bounds in an array', etc.
 

Khris

I'd recommend not using the Test game menu option but running the exe from the compiled folder instead.
If you get a black screen, you might have used a Display command or something similar in a before fadein interaction leading to the game waiting for a keypress or click before displaying anything.

Monsieur OUXX

Quote from: KhrisMUC on Wed 13/06/2007 11:23:45
I'd recommend not using the Test game menu option but running the exe from the compiled folder instead.

Why so? For the reason you mention under? I can't see why the game would then behave in a different way..

Quote from: KhrisMUC on Wed 13/06/2007 11:23:45If you get a black screen, you might have used a Display command or something similar in a before fadein interaction leading to the game waiting for a keypress or click before displaying anything.

No, no, whatever key i press / mouse button i click, the game is frozen.
 

Khris

Well, there were cases when people had problems using test game but didn't when running the exe. Don't ask me about technical details, but I believe there's a not insignificant difference between the two methods (obviously, since double-clicking a program in windows is not necessarily the same as running an exe file from within a program).

AGS detects infinite loops after 150'000 iterations. If there's no Wait(x); or similar stuff inside the loop, it will only be a matter of seconds before AGS reaches this limit, though.

Without taking a look at the code there's isn't much else I can tell you.

Monsieur OUXX

OK. Do you know if there is any "logging" module developed by someone? (or within the native script)

I've been looking in the forum but the search on "log" gets parasited by the word "dialogs"
 

Khris

Try hitting Scroll Lock to check what the script is doing.
That and some other debug features are explained here:
http://www.adventuregamestudio.co.uk/manual/Debuggingfeatures.htm

Monsieur OUXX

#6
Quote from: KhrisMUC on Wed 13/06/2007 20:29:24
Try hitting Scroll Lock to check what the script is doing.

This is cool, though the text displayed goes much to fast

Quote from: KhrisMUC on Wed 13/06/2007 20:29:24
That and some other debug features are explained here:
http://www.adventuregamestudio.co.uk/manual/Debuggingfeatures.htm

The "console" feature could be interesting, but it doesn't seem to work by pressing the proper key (the one next to "1"); isn't it obsolete?




Anyway, i found out why there was a black screen : infinite loop (i forgot to put an 'i++;' in a loop  ;D). I just can't figure out why AGS didn't detect it, since there was no "wait" anywhere, so the 15000 iterations should have been reached very fast.
 

Ashen

Maybe irrelevant now, but for future reference:

Quote
This is cool, though the text displayed goes much to fast

Does this not help:
Quote from: The Manual
While this window is displayed, you can hold Right-Shift to pause it so you can actually read what it says - release Right Shift to continue the game.

If you press Left Shift, the game will be locked into a step-by-step mode, where you must press Left Shift every time to continue onto the next script line. Right Shift exits this mode.


Quote
The "console" feature could be interesting, but it doesn't seem to work by pressing the proper key (the one next to "1"); isn't it obsolete?

It still works for me in v2.72, what version are you using? (Not that it really matters as it's an unsupported feature - there's not much that can be done about it if it doesn't work.)
I know what you're thinking ... Don't think that.

Monsieur OUXX

#8
Quote from: The Manual...

OK. Sorry. In fact, everytime i want to look for something in the manual, i get quickly demotivated because the manual is so uneasy to find on the web (i never find the direct link from the AGS site, i always have to look for it via Google, on the americangirlscout website)

QuoteIt still works for me in v2.72, what version are you using?

2.72. Assuming that the console's key processing cannot be parasited by the custom script (i also use this physical key - the key left to '1' - to let my own console appear), i then suppose that AGS ignores the local key mapping (on a french keyboard, the '`' key is in fact '²'. The correct key for AGS's console would be pressed by doing AltGr+7 twice, and it doesn't seem to work   :-\)
 

Khris

There's an offline version of the manual, just press F1 in AGSEdit... ;)
Or double-click agshelp.chm in the main directory.

The online version is at www.adventuregamestudio.co.uk/manual, shouldn't be that hard to memorize.

SMF spam blocked by CleanTalk