Runtime Error 6
lyteside
11 Jan 2006, 19:45I've been unable to find the necessary information about this specific error. I am nearly sure that the issue is "over information" and that I will be unable to complete my game, because if I delete any section at all in the program [like an involved command or a larger room], it will run perfectly.
Troubleshooting I have already done:
1) I have over 10 libraries connected to the asl file and each library is pages upon pages long of code. We're talking a looooot of code here. I have tried commenting each one out, one at a time, and again... the game works fine. I have tried taking out the information from the libraries and "stuffing" them into the large asl file, but the program doesn't take too kindly to that either.
2) The error also disappears when simple msg lines are deleted, not just complex codes riddled with {} and <>, etc., which furthers my belief that this error is trying to tell me, "You can't program anymore stuff in here, idiot." for example if I were to delete a daunting section such as this:
then the game will work fine. But if instead I deleted a simple piece of code out of a larger work like this:
then the game will also run fine. so i'm confused.
comments or ideas? i'm really concerned about it, as I've invested a lot of time into the game. thank you guys so much!
Troubleshooting I have already done:
1) I have over 10 libraries connected to the asl file and each library is pages upon pages long of code. We're talking a looooot of code here. I have tried commenting each one out, one at a time, and again... the game works fine. I have tried taking out the information from the libraries and "stuffing" them into the large asl file, but the program doesn't take too kindly to that either.
2) The error also disappears when simple msg lines are deleted, not just complex codes riddled with {} and <>, etc., which furthers my belief that this error is trying to tell me, "You can't program anymore stuff in here, idiot." for example if I were to delete a daunting section such as this:
command <unwield #@object#> {
if (%wield% = 0) then msg <You aren't holding a weapon to unwield it.>
else {
if (#quest.lastobject# = #wieldedobject#) then {
property <#quest.lastobject#; alias=#wieldedobjectname#>
msg <You unwield the |xn>
foreground <&H2266F2>
msg <|b$displayname(#object#)$|xb.>
foreground <White>
set string <wieldedobject; thingie>
dec <wield>
if (#(object):class# = 9) then do <batteries off>
if (#(object):class# = 8) then dec <missilefire; 1>
if (#(object):double# = 1) then dec <doubledamage; 0>
if (#(object):unsafe# = 1) then dec <unsafe; 0>
if (#(object):disarm# = 1) then dec <disarm; 1>
set numeric <STR; %STR% - #(object):power#>
set numeric <DEX; %DEX%-#(object):agility#>}
else {
if (#quest.lastobject# = #wieldedobject2#) then {
property <#quest.lastobject#; alias=#wieldedobjectname2#>
msg <You unwield the |xn>
foreground <&H2266F2>
msg <|b$displayname(#object#)$|xb.>
foreground <white>
set string <wieldedobject2; thingie2>
dec <wield>
if (#(object):class# = 9) then do <batteries off>
if (#(object):class# = 8) then dec <missilefire; 1>
if (#(object):double# = 1) then dec <doubledamage; 0>
if (#(object):unsafe# = 1) then dec <unsafe; 0>
if (#(object):disarm# = 1) then dec <disarm; 1>
set numeric <STR; %STR% - #(object):power#>
set numeric <DEX; %DEX%-#(object):agility#>}
else msg <You're not even holding that weapon to begin with!>}
}
}
then the game will work fine. But if instead I deleted a simple piece of code out of a larger work like this:
else {
foreground <&H2266F2>
if ($lengthof(#(lastenemy):prefix#)$ = 0) then msg <|b$displayname(#lastenemy#)$|xb |xn>
else msg <The |b$displayname(#lastenemy#)$|xb |xn>
foreground <white>
msg <attacks you with #(lastenemy):weapon# for |cr|b%e_damage%|xb|cb points of damage.>
dec <HP; %e_damage%>
}
then the game will also run fine. so i'm confused.
comments or ideas? i'm really concerned about it, as I've invested a lot of time into the game. thank you guys so much!
davidw
11 Jan 2006, 19:54You say the errors disappear when simple message lines are deleted?
Well... at the risk of sounding a little sarcastic here... why not just delete the simple message lines?
Well... at the risk of sounding a little sarcastic here... why not just delete the simple message lines?
lyteside
11 Jan 2006, 19:57fair question. the problem is this:
the game is not done.
If it was done, i'd totally suck it up, delete enough msg lines to make the game work, and "hey, that's good enough."
but i'm gonna have to print many many more msg tags, code, rooms, etc. i can't find enough sacrificial code to compensate for the extra code i will be adding.
of course, deleting all the code in the game would result in a lack of errors, and a lack of game as well. to me, deleting my message lines to avoid errors would be like cutting off my legs so i won't get athlete's foot.
*edit*
well, i finally figured out the problem. It's because I have too many if then and else statements in my game. the game can only allow for a certain amount, so it looks like i won't be able to finish the game.
the game is not done.
If it was done, i'd totally suck it up, delete enough msg lines to make the game work, and "hey, that's good enough."
but i'm gonna have to print many many more msg tags, code, rooms, etc. i can't find enough sacrificial code to compensate for the extra code i will be adding.
of course, deleting all the code in the game would result in a lack of errors, and a lack of game as well. to me, deleting my message lines to avoid errors would be like cutting off my legs so i won't get athlete's foot.

*edit*
well, i finally figured out the problem. It's because I have too many if then and else statements in my game. the game can only allow for a certain amount, so it looks like i won't be able to finish the game.

paul_one
12 Jan 2006, 14:55That doesn't sound right at all.
I would have thought Quest would parse those lines as it was being executed (as it seems to from previous experience).
So the number of if's shouldn't effect it in the least.
Could you send me those files and I'll take a look into it (also count how many time's IF comes up so I can see if you've reached 32000+ if's yet).
I would have thought Quest would parse those lines as it was being executed (as it seems to from previous experience).
So the number of if's shouldn't effect it in the least.
Could you send me those files and I'll take a look into it (also count how many time's IF comes up so I can see if you've reached 32000+ if's yet).
lyteside
12 Jan 2006, 15:35good call. that's kind of what i was thinking too, with the 32,000 k limit thingie. I'm trying to do a quick count, but it's a pain in the butt.
thanks so much for taking a look at it for me! shall i send the files to your hotmail or you have a different addy?
*edit*
yeah, there's no way i'm close to 32,000 on the ifs. I'm averaging about 700 if then statements per page, with about 15 pages (libraries) total. so at most that's like in a 10,000 to 15,000 bracket. Couldn't possibly get to 32,000. however, if the else statements are being calculated as the same "type" of statement, then it's more feasible to think that its peaking past the 32,000 mark.
thanks so much for taking a look at it for me! shall i send the files to your hotmail or you have a different addy?
*edit*
yeah, there's no way i'm close to 32,000 on the ifs. I'm averaging about 700 if then statements per page, with about 15 pages (libraries) total. so at most that's like in a 10,000 to 15,000 bracket. Couldn't possibly get to 32,000. however, if the else statements are being calculated as the same "type" of statement, then it's more feasible to think that its peaking past the 32,000 mark.
paul_one
12 Jan 2006, 17:20The hotmail account is more helpful.
Going to get it into linux and do some quick and easy line counts
.
grep is SOOOO useful!
*kisses screen*
Unless you've reached the 32,000 (more like 32,500) line limit. But I thought libraries were a possible way around such a limit.
Plus you'd be very good to reach this limit, either that or slightly sloppy in the coding department.
Going to get it into linux and do some quick and easy line counts

grep is SOOOO useful!
*kisses screen*
Unless you've reached the 32,000 (more like 32,500) line limit. But I thought libraries were a possible way around such a limit.
Plus you'd be very good to reach this limit, either that or slightly sloppy in the coding department.
lyteside
12 Jan 2006, 17:44haha. thanks, dude. alright, i'll send them over promptly. thanks again for taking a look at it.


Alex
12 Jan 2006, 19:00If you could please also send the files to me I can identify exactly what's happening. If it does turn out to be an error in your ASL file at least I'll be able to get Quest to print a more helpful message.
lyteside
12 Jan 2006, 19:07sure thing, alex. thank you for taking the time to see what's going on, it means a lot to me.
i'm sendin' them ovah to ya.
i'm sendin' them ovah to ya.
paul_one
12 Jan 2006, 21:27Did a line count. You're only on 16522 lines right now (almost half way there).
A grep shows, 2040 if's.
I would run it in Linux but Quest just doesn't want to install using Wine at all.
Going to have to reboot into Window's.
A grep shows, 2040 if's.
I would run it in Linux but Quest just doesn't want to install using Wine at all.
Going to have to reboot into Window's.
lyteside
12 Jan 2006, 21:38ha ha. it just occured to me that i did a search for the word "if" not the if then statements
*slaps forehead*
2000 sounds closer to reality. we couldn't believe that we had written 10,000 if statements
*slaps forehead*
2000 sounds closer to reality. we couldn't believe that we had written 10,000 if statements
paul_one
12 Jan 2006, 22:03No - I just did a "grep -ci if *" (meaning find the number of times 'if' occurs in all the files - also ignore case).
So those are all if's, whether they are actually IF's or just in sentances.
I did try it and looked in the logfile.
Got an error of "too many end define 's".. So maybe it's that?
[edit]
Nope. Got 1493 "defines".
Now that number is really odd - so I'm guessing you have a missing "define" or three!
[edit2]
Found one:
define procedure <checkcoordinatesproc>
Got two end defines after it.
So those are all if's, whether they are actually IF's or just in sentances.
I did try it and looked in the logfile.
Got an error of "too many end define 's".. So maybe it's that?
[edit]
Nope. Got 1493 "defines".
Now that number is really odd - so I'm guessing you have a missing "define" or three!
[edit2]
Found one:
define procedure <checkcoordinatesproc>
Got two end defines after it.
Gordex
12 Jan 2006, 22:07I'll see if I can check it out with my program(s) too.
paul_one
12 Jan 2006, 22:18I use notepad++. Allows you to find something in alot of files at once - just like grep!
Thing is, it'll give you a total number of times it comes up and lines numbers and the lines etc. </hype>
Anyway, I've started to look through, but the coding syntax used is very odd, and personally highly unreadable.
I just don't like your indenting system at all.
I think you may have messed something up as notepad++ is having a hard time putting that code into closable 'blocks' in the file "space_station.qlb" - the one with the two end defines.
Thing is, it'll give you a total number of times it comes up and lines numbers and the lines etc. </hype>
Anyway, I've started to look through, but the coding syntax used is very odd, and personally highly unreadable.
I just don't like your indenting system at all.
I think you may have messed something up as notepad++ is having a hard time putting that code into closable 'blocks' in the file "space_station.qlb" - the one with the two end defines.
Alex
12 Jan 2006, 22:39I've looked at the code and what is happening is that it is in fact hitting the 32767 line limit - it's happening earlier than 32767 "actual" lines though because of the way Quest reorganises code internally.
I'm initially working on a version of QCompile which will be able to compile this code so that it can be loaded by Quest 3.53, since compiled games do the internal reorganisation before outputting the CAS file - the resulting CAS file will load much quicker in Quest than the ASL file for this reason too.
There will also be an update to Quest so it can handle this kind of file straight from the ASL.
I'm initially working on a version of QCompile which will be able to compile this code so that it can be loaded by Quest 3.53, since compiled games do the internal reorganisation before outputting the CAS file - the resulting CAS file will load much quicker in Quest than the ASL file for this reason too.
There will also be an update to Quest so it can handle this kind of file straight from the ASL.
paul_one
12 Jan 2006, 22:42Cool.
Sounds kinda odd that Quest is reaching the limit though.
Bleh, another end define found in the middle (?) of this procedure:
define procedure <createstats>
File: intro.qlb
Sounds kinda odd that Quest is reaching the limit though.
Bleh, another end define found in the middle (?) of this procedure:
define procedure <createstats>
File: intro.qlb
Gordex
12 Jan 2006, 23:05I am using UltraEdit32. Does the same type of thing you are talking about. We were originally using notepad to code, so the tabbing structure is outta whack. I'm using ultraedit now, and he is still using notepad. 
In my effort to look up the defines, I decided to check out a few other things. Now get this *MUahahhahaha* the main ASL file has 2 more "{" than "}" in it, and it is working LOL. How exactly does that work?

In my effort to look up the defines, I decided to check out a few other things. Now get this *MUahahhahaha* the main ASL file has 2 more "{" than "}" in it, and it is working LOL. How exactly does that work?
paul_one
14 Jan 2006, 19:29I haven't tried ultraedit.
Must say I love Notepad++ tho. Best all-round editor I've seen on Linux or Windows. Just needs a hex bit in it.
I did notice that there's one or two procedures that don't need to really be here.. Or would be better off turning into a simgle procedure to simplify it right down.
(ie "do <objectmove(sabre;sabre;Dana)>") instead of 2 or more procedures using the same code just with different names in certain locations.
Must say I love Notepad++ tho. Best all-round editor I've seen on Linux or Windows. Just needs a hex bit in it.
I did notice that there's one or two procedures that don't need to really be here.. Or would be better off turning into a simgle procedure to simplify it right down.
(ie "do <objectmove(sabre;sabre;Dana)>") instead of 2 or more procedures using the same code just with different names in certain locations.
Alex
15 Jan 2006, 16:30I now have a version of QCompile which can compile large games to a CAS file. Because it does Quest's internal code reorganisation itself, as long as the total number of ASL lines is under 32767, Quest will be able to open the CAS file even though it might not be able to open the ASL file.
If any Quest Pro users would like a copy of the updated QCompile please drop me an email.
Quest 4.0 will be able to open large ASL files - up to 2 billion lines.
If any Quest Pro users would like a copy of the updated QCompile please drop me an email.
Quest 4.0 will be able to open large ASL files - up to 2 billion lines.