Torchmodders

Modding => GUTS Editor => Topic started by: Phanjam on February 13, 2016, 04:18:36 am


Title: [Data Editors > Skills] Problem Loading Skills
Post by: Phanjam on February 13, 2016, 04:18:36 am
I've got this problem reading the skills of the TL1CP mod into the GUTS Skills Editor.

When I try to activate the Skills Editor, I get this...

(http://i.imgur.com/7rVSPUd.png)

It always stops at that point ("Loading 38/68"). 

The mod itself seems to be running fine, but I'm worried that this error is there in the first place  :-[

I've tried reading through the error text from when you click the "Details" button to see if it might give me an idea of where to start looking, but it's hieroglyphics to me!

So I saved the error text to the attached file and I'm hoping some kind soul might be willing to take a look at it please?
Title: Re: [Data Editors > Skills] Problem Loading Skills
Post by: Kva3imoda on February 13, 2016, 04:44:00 am
Well, I've seen something similar elsewhere. As you can see, in some file you have a problem with the "Length" parameter, I suppose it is a syntax error.
I think you should use the search in Win Explorer, select the last modified skill files and check it out.
Title: Re: [Data Editors > Skills] Problem Loading Skills
Post by: Phanjam on February 13, 2016, 05:00:13 am
...in some file you have a problem with the "Length" parameter, I suppose it is a syntax error.

I just did a string search through all .DAT files in the TL1CP media\skills folder - there is no incidence of the string "length" :o
Title: Re: [Data Editors > Skills] Problem Loading Skills
Post by: Kva3imoda on February 13, 2016, 06:38:15 am
I just did a string search through all .DAT files in the TL1CP media\skills folder
Try to search everywhere.
I tried, and it seems that this parameter does not exist.  :-[
Title: Re: [Data Editors > Skills] Problem Loading Skills
Post by: Kva3imoda on February 13, 2016, 06:41:18 am
I have another plan.
Delete all *.BINDAT files and start GUTS. After the error find all files that don`t have a BINDAT- pair.
Title: Re: [Data Editors > Skills] Problem Loading Skills
Post by: gytfunke on February 13, 2016, 07:07:17 am
Kva3i's mighty brilliant.

If that doesn't work, though... you might have to roll back to a version that predates the error.  Personally, I'd try narrowing my the possibilities first.

Like Kva4i was saying, you could make a backup, then sort your files by last update.  Try deleting the files that were modified around the time the error popped up.  This might cause the mod not to open in guts if this creates a null file reference, but it could help you find the file.
Title: Re: [Data Editors > Skills] Problem Loading Skills
Post by: Phanjam on February 13, 2016, 09:09:25 pm
Also did a search through all the .LAYOUT files, but nothing there either.

Am doing the .DAT to .BINDAT comparisons now...

EDIT:
No luck, all the .DATs have matching .BINDATs  :-[
Title: Re: [Data Editors > Skills] Problem Loading Skills
Post by: Kva3imoda on February 13, 2016, 09:21:53 pm
EDIT:
No luck, all the .DATs have matching .BINDATs  :-[
Check BINLAYOUT
Title: Re: [Data Editors > Skills] Problem Loading Skills
Post by: Kva3imoda on February 13, 2016, 09:28:46 pm
In addition, you can check a folder-by-folder.
Create special Test mod, and add 1 folder step-by-step from your mod. Each step checks GUTS for the error.
Title: Re: [Data Editors > Skills] Problem Loading Skills
Post by: Phanjam on February 13, 2016, 10:23:36 pm
Check BINLAYOUT
Thanks.  I did just now but still, all LAYOUTS have matching BINLAYOUTs too.

Oh well, as long as it does not harm the performance of the mod I guess it's okay
Title: Re: [Data Editors > Skills] Problem Loading Skills
Post by: Vkoslak on February 14, 2016, 09:43:21 pm
Doing a search on length won't find the issue.  It looks like it is treating strings as arrays. My guess would be either you have a field that is supposed to be filled in and is blank, or you have a field that has too much text in it.  My money would be on the empty field. I suppose it could be a field with a minimum length on it as well.

I'm not sure how much programming you've had, but basically "text" would be a string. You can treat it as an array of chars, and it would have a length property of 4.
You could then access each character in the array by its index. Most computer languages are zero indexed. So for my "text" example, it would be  "array[0]" and that should return "t", the first character. If nothing has been entered, and the program tries to read "array[0]", that is when you get the kind of error you uploaded earlier.

I hope that helps.

Based upon this:

   at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   at Editor.CDataBlock..ctor(String& data)
   at Editor.CDataBlock..ctor(String& data)
   at Editor.CDataBlock..ctor(String& data)
   at Editor.CDataFile..ctor(String filename)
   at Editor.SkillEditor.PopulateSkillList()

It's going to be an issue with the name or identifier of a skill.  I would suspect based upon the SubString, that it is expecting the identifier to be in a specific format.

EDIT:
After looking at a few dat files for skills,  I would check all those properties that have a colon in them. You may have accidentally typed a semi colon instead.

Title: Re: [Data Editors > Skills] Problem Loading Skills
Post by: Phanjam on February 15, 2016, 07:35:45 am
Hey Vkoslak thanks very much for that! Ima try it out soon as i can (kinda swamped at work these days  >:( ) and yes, i have no programming background at all :D
Title: Re: [Data Editors > Skills] Problem Loading Skills
Post by: Chthon on February 16, 2016, 09:10:42 am
I agree with Vkoslak. It looks like it's trying to read past the end of a string.

An empty string is a strong candidate for being the cause.

A more subtle, and difficult to track down, possibility is that the empty string isn't in your file, but rather is a default for a mandatory field. GUTS very well might initialize mandatory string fields with empty strings (the default in C++), expecting them to be overwritten later with data read from the dat file. So you might look for missing or malformed lines for things like NAME that are possibly mandatory.

A third possibility is data corruption. Hard disks aren't perfect. A file that had nothing wrong with it when you saved it may have become corrupted in just the wrong spot. Unlikely, but it happens. (Happened to me once, in fact.)
Title: Re: [Data Editors > Skills] Problem Loading Skills
Post by: Phanjam on February 17, 2016, 06:30:26 am
You mean like NAME being mistyped as NMAE and similar? Yeah soooo many permutations. But I'll work along those lines as well ;)
Title: Re: [Data Editors > Skills] Problem Loading Skills
Post by: Chthon on February 17, 2016, 11:59:35 am
You mean like NAME being mistyped as NMAE and similar? Yeah soooo many permutations. But I'll work along those lines as well ;)

Yes, assuming my theories (that NAME is mandatory for skill dat files, and that mandatory string fields are initialized as an empty string waiting to be overwritten) are correct, then that is exactly the sort of thing that could cause this error.

Rather than searching for entries that are wrong, it might be easier to use a rule-out methodology. Use notepad++ to search for "<STRING>NAME:", "<STRING>DISPLAYNAME:", etc. across X files, until you find one that has less than X instances. Then start looking for the file with the typo.