Jump to content


MIT giving an ArrayIndexOutOfBoundsException


27 replies to this topic

#16 Guest_G-Mon_*

Guest_G-Mon_*
  • Guests

Posted 24 July 2007 - 08:46 PM

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).

#17 Orions_Stardom

Orions_Stardom
  • Gibberlings
  • 206 posts

Posted 24 July 2007 - 10:46 PM

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")

#18 Guest_G-Mon_*

Guest_G-Mon_*
  • Guests

Posted 25 July 2007 - 12:04 AM

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.

#19 Guest_G-Mon_*

Guest_G-Mon_*
  • Guests

Posted 02 August 2007 - 04:12 PM

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. ???

#20 Orions_Stardom

Orions_Stardom
  • Gibberlings
  • 206 posts

Posted 19 September 2007 - 03:34 PM

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.

#21 G-Mon

G-Mon
  • Members
  • 59 posts
  • Location:Uhh... Wait, I know this....

Posted 19 September 2007 - 05:47 PM

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).

Edited by G-Mon, 27 September 2007 - 12:28 PM.


#22 Orions_Stardom

Orions_Stardom
  • Gibberlings
  • 206 posts

Posted 27 September 2007 - 01:55 PM

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.

#23 drake127

drake127
  • Members
  • 123 posts
  • Gender:Male
  • Location:Prague, Czech Republic

Posted 09 October 2007 - 03:21 PM

(...)

  • 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?

#24 Daulmakan

Daulmakan

    Comfortably numb

  • Members
  • 536 posts
  • Location:The Houses of the Holy

Posted 29 October 2007 - 02:41 AM

(...)

  • 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).
I ain't evil, I'm just good looking.


#25 Guest_El Cubo_*

Guest_El Cubo_*
  • Guests

Posted 23 May 2008 - 02:08 PM

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.

#26 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 23 May 2008 - 02:09 PM

Oh, and I used the build that I found in this thread.

#27 Orions_Stardom

Orions_Stardom
  • Gibberlings
  • 206 posts

Posted 23 May 2008 - 05:16 PM

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.

#28 Guest_El Cubo_*

Guest_El Cubo_*
  • Guests

Posted 23 May 2008 - 11:40 PM

All right, I put it in Mediafire: http://www.mediafire.com/?ccpcem9b2b2

Also, the GUI crashed when I clicked 'cancel' after cloning BGII. I guess there's an unending loop somewhere.



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users