Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Alikchi on May 04, 2002, 03:36:55 pm

Title: Small tables problem
Post by: Alikchi on May 04, 2002, 03:36:55 pm
Error: Unknown lookup_type in stuff_int_list
File:C:\projects\freespace2\code\Parse\PARSELO.CPP
Line: 1420

Call stack:
------------------------------------------------------------------
------------------------------------------------------------------


That's what I get. Help?
Title: Re: Small tables problem
Post by: vadar_1 on May 04, 2002, 05:21:04 pm
Code: [Select]

int stuff_int_list(int *ilp, int max_ints, int lookup_type)
{
int count = 0, ok_flag = 1, dummy;
ignore_white_space();

if (*Mp != '(') {
error_display(1, "Reading integer list.  Found [%c].  Expecting '('.\n", *Mp);
longjmp(parse_abort, 6);
}

Mp++;
ignore_white_space();

while (*Mp != ')') {
Assert(count < max_ints);
if (*Mp == '"') {
int num = 0;
char str[128];

get_string(str);
switch (lookup_type) {
case SHIP_TYPE:
num = ship_name_lookup(str); // returns index of Ship[] entry with name
break;

case SHIP_INFO_TYPE:
ok_flag = 1;
num = ship_info_lookup(str); // returns index of Ship_info[] entry with name
if (num < 0)
ok_flag = 0;
break;

case WEAPON_POOL_TYPE:
ok_flag = 1;
num = weapon_info_lookup(str);
if (num < 0)
ok_flag = 0;
break;

case WEAPON_LIST_TYPE:
num = weapon_info_lookup(str);
if (num < 0)
num = -2;
break;

case RAW_INTEGER_TYPE:
num = atoi(str);
break;

default:
Error(LOCATION,"Unknown lookup_type in stuff_int_list");
break;
}

if (ok_flag) {
if (num == -1) {
Error(LOCATION, "Unable to find string \"%s\" in stuff_int_list\n\nMany possible sources for this error.  Get a programmer!\n", str);
} else if (num == -2) {
if (strlen(str) > 0) {
Warning(LOCATION, "Unable to find WEAPON_LIST_TYPE string \"%s\" in stuff_int_list\n\nMany possible sources for this error.  Get a programmer!\n", str);
}
}

if (num < 0)  // other negatives used to bypass the above error trap, but should be -1
num = -1;

ilp[count++] = num;
}

} else {
if (ok_flag)
stuff_int(&ilp[count++]);
else
stuff_int(&dummy);
}

ignore_white_space();
}

Mp++;

return count;
}


Line 1420 reads

default:
   Error(LOCATION,"Unknown lookup_type in stuff_int_list");
   break;


Anyways, what were you doing at the time of the error?
Title: Small tables problem
Post by: Alikchi on May 04, 2002, 07:03:21 pm
Trying to load FS2.exe or FRED2.exe. It got all pissy.

(This is for a modded version of FS2, by the way.)
Title: Small tables problem
Post by: WMCoolmon on May 04, 2002, 11:59:21 pm
Is it a release build? I heard there were some problems with TBL files on a debug build
Title: Small tables problem
Post by: Alikchi on May 05, 2002, 04:08:08 pm
This is without changing the source code. Just tables and miscellaneous stuff changed.
Title: Small tables problem
Post by: EdrickV on May 05, 2002, 06:55:40 pm
You said this is for a "modded" version. What exactly do you mean? Is it a version you modified by using the source and compiled or did you download and install one of these FS2 mods like the Robotech MOD, BWO, etc.? In otherwords, what's different about it from a regular version installed from the CDs?
Title: Small tables problem
Post by: Alikchi on May 05, 2002, 07:59:51 pm
Just new tables, interface, ships, CB ANIs, briefing icons, everything. The whole load. Campaign I'm working on.
So no source changes.
Title: Small tables problem
Post by: EdrickV on May 05, 2002, 08:24:32 pm
Quote
Originally posted by Alikchi
Just new tables, interface, ships, CB ANIs, briefing icons, everything. The whole load. Campaign I'm working on.
So no source changes.


Something in your tables is what's screwing it up I think. Most likely a ship or weapon without a type. (All ships should have something like "fighter" "bomber" "capital" etc. on the $flags line in their ships.tbl entry.) I believe that error occurs when it's reading the ships.tbl and weapons.tbl table files and finds an entry where it can't figure out what it's supposed to be.
Title: Small tables problem
Post by: Alikchi on May 05, 2002, 08:33:11 pm
Well, that narrows it down to 100 entries or so
Title: Small tables problem
Post by: EdrickV on May 05, 2002, 08:54:58 pm
Did you make 100 entries yourself?? If not, look at the ones you've made yourself and if there isn't anything wrong there look at any you've edited but didn't make. Searching for $flag in the ships table could help speed things a long.
Title: Small tables problem
Post by: Alikchi on May 05, 2002, 09:27:55 pm
Okay, will do :)
Title: Small tables problem
Post by: vadar_1 on May 05, 2002, 10:51:09 pm
Quote
Originally posted by WMCoolmon
Is it a release build? I heard there were some problems with TBL files on a debug build


I was having weapons table problems when I tried to compile it in debug mode. It compiled, but FS2 refused to run, reporting something about "bogus" weapon table flags.
Title: Small tables problem
Post by: Alikchi on May 08, 2002, 03:56:12 pm
No luck yet.
Title: Small tables problem
Post by: EdrickV on May 08, 2002, 05:02:58 pm
If you could put your table files up for download somewhere (or send them to me) I could take a look through and see if anything looks wrong. The ship and weapon tables are the most likely culprits.
Title: Small tables problem
Post by: Alikchi on May 08, 2002, 06:36:23 pm
Yeah, those are the ones I looked through :) I'll send them to you.
Title: Small tables problem
Post by: EdrickV on May 08, 2002, 07:07:18 pm
If you don't know already, you can send the file(s) to [email protected] :)
Title: Small tables problem
Post by: EdrickV on May 09, 2002, 12:36:47 am
It took a long time, but I finally figured out what was wrong with your ship table file. And then I figured out I was wrong and found the real culprit in the Aten section:

$Subsystem:            turret06,0.833,1.0
   $Default PBanks:      ( "Vasudan Turret"" )
Title: Small tables problem
Post by: EdrickV on May 09, 2002, 12:44:05 am
Hard to believe one extra little " caused so much trouble. :)
Title: Small tables problem
Post by: WMCoolmon on May 09, 2002, 01:37:25 am
Quote
Originally posted by EdrickV
Hard to believe one extra little " caused so much trouble. :)

Yeah...only programming is so bad. One small typo or mistake (adding two ' instead of one " anyone?) and you get hours of debugging fun. :doubt:
Title: Small tables problem
Post by: EdrickV on May 09, 2002, 01:42:24 am
Quote
Originally posted by WMCoolmon

Yeah...only programming is so bad. One small typo or mistake (adding two ' instead of one " anyone?) and you get hours of debugging fun. :doubt:


Don't forget the missing ;'s that cause 20 different error messages. :) I actually haven't used debuggers much, a lot of that info doesn't mean anything to me as I don't know assembly. Variable watches can be useful though.

Edit: Or rather I don't know Intel assembly and have probably forgotten most of my knowledge of 6502B/65C816 assembly. :)
Title: Small tables problem
Post by: Alikchi on May 09, 2002, 02:37:56 pm
Doh!

Someone needs to make a problem that can fix things like this.
More detailed error messages would be a nice addition to the source code..

Well, it works now. Thanks dude :)