Debugging Help

Anonymous
20 Oct 2004, 01:53
Hey,

Been working on a game for a few weeks now (in QDK, with various manual adjustments), and it seems I've just run into a problem. Was working on my game for an hour or two, closed it, and when I went to open it again tonight, I got an error. When I try to open it, QDK spits out:

FATAL ERROR: Expected > in msg <
FATAL ERROR: Expected > in msg <
FATAL ERROR: Expected > in msg <
FATAL ERROR: Expected > in msg <


Quest, on the other hand, just gives me:

Errors found in C:\Program Files\Quest\rsimulation.asl /--- LDF-ERROR: Unspecified: errors:help ---/


Ok, so, no problem, I can fix this. Just a syntax error. The problem is, Quest isn't giving me any line numbers, and my game is already 103kb of text. If it's at all avoidable, I really don't want to go through all that code by hand, checking each of the hundred's of messages to see if there's an end bracket. So, my question is this: is there any sort of debugger for ASL that I can use to expedite the process? Any [much] quicker way of doing this? I'm using the evaluation version of QDK, if it makes a difference. I'm going to buy pro eventually and all, I just can't at the moment. Any help would be appreciated.

I think Im Dead
20 Oct 2004, 02:01
alright well, the first error message is telling you that somewhere in your code you are missing a >(greather than bracket) in a few lines in which something is being messaged to the player(s). The second error message, I believe LDF are the language files Quest uses to translate itself to other languages. Are you using any LDF files to translate Quest? If not perhaps you somehow in one of your unclosed(Not contained <inside here>) sections of code you accidently entered something that tried to called for a translation file.

I'm just going to assume it's a few missing >'s and you might want to try opening your .ASL file in a text editor and using find(Ctrl+F) to find all of <'s then look at the end of each line it finds one and see if a closing bracket is where it needs to be.

Anonymous
20 Oct 2004, 02:44
Right... I know how to fix it. What I'm saying is; my game is 51 pages of code. I've got thousands of brackets. I'm wondering if there's a quicker way to find the actual error.

And, no, I'm not trying to translate my game. Not sure why that would be coming up.

Anonymous
20 Oct 2004, 02:44
Right... I know how to fix it. What I'm saying is; my game is 51 pages of code. I've got thousands of brackets. I'm wondering if there's a quicker way to find the actual error.

And, no, I'm not trying to translate my game. Not sure why that would be coming up.

I think Im Dead
20 Oct 2004, 06:42
No, and 51 pages is nothing.

Of your thousands of brackets, you are apparently missing atleast 4, start looking.

The only help you might get in automating this is from a replace or find function, or someone else doing it for you.

paul_one
20 Oct 2004, 08:06
Hmmmm - a debugging ASL program eh?

.... *thinks* ...

As I'm beginning C++ I may just have a look into doing that. Might be fun..

<> 's on one line (so missing <>'s should be easy to find)...
finding {}'s would be harder - but there must be a way - I have minor idea's.
Maybe also a little "before < or {" syntax spell-checker - doubt this would be much though.

I guess it could add variable support (warning about using variables before declairing them)... Don't expect it to use windows until V2 though! :P

Alex
20 Oct 2004, 08:52
Are you using Quest and QDK version 3.52? I thought I'd fixed the LDF error that comes up when there are errors in the game in that version.

The splitting line issue is completely mysterious to me. It has been reported before and happens when you have multiple lines in a description. Usually QDK correctly replaces the newline characters with |n, but sometimes it randomly doesn't. I have introduced code into QDK to check this and correct it in several locations - I thought that was part of 3.52, but it may be in 3.53, though I don't think I've seen reports of this error for a while which leads me to believe it was in 3.52.

If you email me your ASL file then I can pinpoint where the problem is and send you a fixed version.

paul_one
20 Oct 2004, 08:58
Alex - I did have a side note question for you but seem to have forgotten about it at work...

... Ah - why did you go for C++'s (maybe C's at that) definition of the "for" statement? Any particular reason? If it isn't for it's loop... Or I'm getting completely mixed up.

innox
20 Oct 2004, 10:26
Alex wrote:Are you using Quest and QDK version 3.52? I thought I'd fixed the LDF error that comes up when there are errors in the game in that version.

The splitting line issue is completely mysterious to me. It has been reported before and happens when you have multiple lines in a description. Usually QDK correctly replaces the newline characters with |n, but sometimes it randomly doesn't. I have introduced code into QDK to check this and correct it in several locations - I thought that was part of 3.52, but it may be in 3.53, though I don't think I've seen reports of this error for a while which leads me to believe it was in 3.52.

If you email me your ASL file then I can pinpoint where the problem is and send you a fixed version.


Yeah, using 3.52. Didn't realize there was a new version out. I'll upgrade today.

That actually makes some sense; there's a few functions of the game in which I'm inserting a lot of new line characters at the end of a message. They're fairly dynamic and quick-moving, with a lot of timers working in tandem, so it helps to keep things more coherent. This was one of the last things I was working on before my game stopped working. So, if I'm understanding what you're saying correctly, I should be able to just Ctrl+F for "|n" characters, and narrow my search considerably?

Thanks. :)

innox
20 Oct 2004, 10:50
Hmm. Unfortunately, that didn't seem to work. I do have a backup copy, thankfully, so I'm not overly worried, but I'd lose a lot of work if I were to revert to one; a lot of the mechanics in the game have taken a lot of creativity, and I'm not sure I could have everything come out the same way, if I need to re-engineer them.

I guess I'll go through manually, seeing as how there doesn't seem to be a better method, but perhaps a suggestion for future versions of Quest: from personal experiece, if you're using QDK, once the code gets long it's frustrating and time-consuming to get an error and to search through all of your code for it. In the past I've been lucky, and the errors have been more helpful; pointing to a specific item or command that needs to be fixed. In this case, there was no such reference. Either way, I think it'd be extremely helpful to have QDK give line numbers in it's error messages. Rather than "FATAL ERROR: Expected > in msg <", something like "[Line 532] FATAL ERROR: Expected > in msg <" would be infinitely more useful. I don't know how QDK actually parses ASL, but I can't see this as being difficult to program in.

Thanks to everyone for trying to help. Unless I'm missing something, I guess I just have to do it manually. Oh well.

Farvardin
20 Oct 2004, 11:50
I had a similar problem, you can check this post :

http://www.axeuk.com/phpBB2/viewtopic.p ... ht=bracket

I found a way to fix it, and I think you can find several similar tools for checking brackets, <>, or whatever.

Alex
20 Oct 2004, 12:49
CW said:


why did you go for C++'s (maybe C's at that) definition of the "for" statement? Any particular reason? If it isn't for it's loop... Or I'm getting completely mixed up.



I don't see what you mean... for one thing, Quest doesn't use C-style "for" loops. C would use something like


for (i=1; i<=10; i++)


whereas Quest uses


for <i; 1; 10>


How else do you think it should have been implemented?

innox, sorry for the confusion. 3.52 is the current version - 3.53 is in development and will be released soon.

Quest and QDK do check for missing brackets, which is why you get this error in the first place. They can't guess what the file is meant to say though, as it could be a line with a linefeed in the middle, it could be that the ending bracket has been omitted, or it could be that there is supposed to be an underscore at the end of the line to join it to the next.

It's actually pretty difficult to give a line number for the error as Quest reorganises the file when it loads it into memory, so when it encounters an error the line position that it's reading might not be anywhere the line in the ASL file it loaded.

From the error message it sounds like the entire line is simply


msg <


You can use something like Textpad to search for this as you can use regular expressions to search for "msg <" immediately followed by a linefeed. The regular expression will be something like


msg <\n

paul_one
20 Oct 2004, 19:28
Oh - well I'm quite messed up then :? ... Too many C++ tutorials/books.

I just thought since you have a VB background maybe a Basic aproach would have been easier - which it seems to be (even has the "step").

OK... My mistake.

007bond
20 Oct 2004, 21:47
I think you are confusing us all now CW

GameBoy
21 Oct 2004, 13:03
007bond wrote:I think you are confusing us all now CW


you mean you. :)