Jump to content

MIT giving an ArrayIndexOutOfBoundsException


Guest G-Mon

Recommended Posts

Guest G-Mon

Finally got around to trying different installation possibilities with MIT. Just for the record, I tried:

  • Shadows of Amn only (i.e. no patch)
  • Shadows of Amn + official patch
  • Throne of Bhaal + official patch (again)

All of these were using full installations of BG2 (+expansion for the last one). Also, now that I think of it, I guess I should mention that I have BG2: The Collection (for the unaware, it includes SoA, ToB, official patches for both, and a bonus CD).

 

None of these resulted in MIT's controls becoming available. Between the patched SoA and the patched ToB, I decided to try copy-and-pasting the path to my BG1 install (MIT did recognize this install before) into the "Source" line to see if the controls become available when that happens (they did).

Link to comment

Ok, I have a feeling The Collection must have different versions of the game executables than what MIT supports at the moment. Do you know your way around a hex editor? If not, can you email me bgmain.exe from all the games you're having trouble with? If you do, I need the following, for all games:

- The full size of the executable, in bytes

- The offset of the string 'HD0:\\Music' (Or, possibly ".\\Music")

- The offset of the string 'HD0:\\dialog.tlk' (or, possibly, ".\\dialog.tlk")

- The offset of the string 'HD0:\\dialogf.tlk' (or, possibly, ".\\dialogf.tlk")

Link to comment
Guest G-Mon

Okay. Took me a bit to even find a decent hex editor, but I found my way around it pretty quickly. Anyway, here's what I came up with for ToB+patch (the other two would require a reinstall, which I really don't feel like doing tonight):

  • File Size of bgmain.exe: 7,839,790 bytes
  • Offset of "HD0:\Music" (had to remove a backslash because I couldn't find the strings as you typed them; typo on your part?): 007069B4
  • Offset of "HD0:\dialog.tlk": 00705E04
  • Offset of "HD0:\dialogf.tlk": 00705E14

Maybe tomorrow I'll be able to reinstall the whole setup (again); I can get the info for the other two cases then.

Link to comment
Guest G-Mon

MAN, I'm lazy. I said I'd have that info "tomorrow" over a week ago. For some reason, I just didn't feel like a reinstall. Then a few days ago, I remembered I had a virtual machine that I could install this stuff on, so I did that, copied the BGMain files from there, and looked up the strings, so here they are:

 

BGMain.exe (SoA, unpatched)

Size: 7,405,614 bytes

"HD0:\Music" offset: 006A18F8

"HD0:\dialog.tlk" offset: 006A0D68

"HD0:\dialogf.tlk" offset: 006A0D78

 

BGMain.exe (SoA, official patch)

Size: 7,417,902 bytes

"HD0:\Music" offset: 006A48F8

"HD0:\dialog.tlk" offset: 006A3D68

"HO0:\dialogf.tlk" offset: 006A3D78

 

I swear, I deserve to get hit for forgetting about something like that. ???

Link to comment

I was wondering where you disappeared to. Or if you even got the post.

You think you're lazy? I'm a month and a half late. :-)
;)

 

Anyway, I've put out 5.1.12 now, which should work properly.
Okay, I'll try it when the mirrors update.

 

EDIT: Nuts, same message I got at the start of this thread. ;) I think I'll try a full reinstall and using the patch from Bioware's site next (in case there's something wonky with the one on the disc). It'll have to wait until later, though.

 

EDIT #2: Nope, still nothin'. Interestingly, I had an older version (in the 5.0 branch) and that worked fine (but of course I couldn't copy the data, music, etc. folders with it).

Link to comment

Things I notice:

1. I forgot to put a couple of things into the CloningData, which could have caused problems.

2. Your unpatched SOA is identical to the normal patched SOA. This'll be why the 5.0.x version worked; I'm not sure why 5.1.11 didn't.

3. I should have noticed this sooner, because Java *should* have failed to compile this.

 

Try this new build ; if it works, I'll get it Officially released as 5.1.13.

Link to comment
(...)
  • File Size of bgmain.exe: 7,839,790 bytes
  • Offset of "HD0:\Music" (had to remove a backslash because I couldn't find the strings as you typed them; typo on your part?): 007069B4
  • Offset of "HD0:\dialog.tlk": 00705E04
  • Offset of "HD0:\dialogf.tlk": 00705E14
I've got this version of bgmain.exe as well and build 5.1.13 above
still doesn't work. Any ideas how can I help you fix this?

Link to comment
(...)
  • File Size of bgmain.exe: 7,839,790 bytes
  • Offset of "HD0:\Music" (had to remove a backslash because I couldn't find the strings as you typed them; typo on your part?): 007069B4
  • Offset of "HD0:\dialog.tlk": 00705E04
  • Offset of "HD0:\dialogf.tlk": 00705E14
I've got this version of bgmain.exe as well and build 5.1.13 above
still doesn't work. Any ideas how can I help you fix this?

Ditto Reddrake's comments above. None of my IE games work, with neither the version posted at the Downloads section (5.1.12) nor the one in this thread (5.1.13).

Link to comment
Guest El Cubo

I think I've fixed the bug. That ArrayIndexOutOfBoundException was caused when CloningData scanned the directory in the method CloningData.instanceFor(File). When source.listFiles(exeFilter) couldn't find a file, it returned a zero-length array. Now, because CloningData started checking the directory for Baldur's Gate 1 first, and it couldn't find bgmain2.exe, the listFiles() method returned the zero-length array which resulted in ArrayIndexOutOfBoundException.

 

So I simply added a check so, that if the resulting File array is of 0 length, it will move on to the next CloningData. Additionally the source code of CloningData was missing one comma.

 

Now, the MIT didn't copy files Language.txt and Keymap.ini, which seem to be important also. The former for bgconfig and latter for hotkeys. These could be added to CloningData.java, but I wasn't sure, if they are used in other versions than european.

 

I don't know for sure this fixed the problem once and for all, but at least it seemed to work for me in batch mode, and the GUI wasn't greyed out. I could put the .jar together and share it, if the original developer has no objections.

Link to comment
I could put the .jar together and share it, if the original developer has no objections.

No objections here; share away! MIT is under the GNU GPL (v2 or later); meaning, basically, that you can share it freely, as long as you include the source, and let others also share it freely under the same license. The license text should be included in the jar under the name COPYING if you're interested in the details.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...