Page 2 of 2

Posted: Wed May 20, 2009 7:45 am
by poiuy_qwert
Ah yeah there was a Mac bug that caused programs that used mpq stuff to close at start. It will be fixed for next version.

Posted: Wed May 20, 2009 11:31 am
by Lord_Jeremy
Ah thanks so much. You're the best :)

Posted: Wed May 20, 2009 8:15 pm
by poiuy_qwert
Oh i think i remember how to fix it for source users. Open LibsSFmpq.py and find this part of code (might be a little different):[spoiler]

Code: Select all

def MpqInitialize():
   _SFmpq.MpqGetVersionString.restype = c_char_p
   _SFmpq.MpqGetVersion.restype = c_float
   _SFmpq.SFMpqGetVersionString.restype = c_char_p
   _SFmpq.SFMpqGetVersionString2.argtypes = [c_char_p,c_int]
   _SFmpq.SFMpqGetVersion.restype = SFMPQVERSION
   
   _SFmpq.SFileOpenArchive.argtypes = [c_char_p,c_int,c_int,c_void_p]
   _SFmpq.SFileCloseArchive.argtypes = [c_int]
   #_SFmpq.SFileOpenFileAsArchive.argtypes = [c_int,c_char_p,c_int,c_int,c_void_p]
   _SFmpq.SFileGetArchiveName.argtypes = [c_int,c_char_p,c_int]
   _SFmpq.SFileOpenFile.argtypes = [c_char_p,c_void_p]
   _SFmpq.SFileOpenFileEx.argtypes = [c_int,c_char_p,c_int,c_void_p]
   _SFmpq.SFileCloseFile.argtypes = [c_int]
   _SFmpq.SFileGetFileSize.argtypes = [c_int,c_void_p]
   _SFmpq.SFileGetFileArchive.argtypes = [c_int,c_void_p]
   _SFmpq.SFileGetFileName.argtypes = [c_int,c_char_p,c_int]
   _SFmpq.SFileSetFilePointer.argtypes = [c_int,c_int,c_void_p,c_int]
   _SFmpq.SFileReadFile.argtypes = [c_int,c_void_p,c_int,c_void_p,c_void_p]

   _SFmpq.SFileGetFileInfo.argtypes = [c_int,c_int]
   _SFmpq.SFileListFiles.argtypes = [c_int,c_char_p,c_void_p,c_int]
   # _SFmpq..argtypes = []
   # _SFmpq..argtypes = []
   # _SFmpq..argtypes = []
   # _SFmpq..argtypes = []
   # _SFmpq..argtypes = []
   # _SFmpq..argtypes = []
   _SFmpq.SFileSetArchivePriority.argtypes = [c_int,c_int]
   _SFmpq.MpqOpenArchiveForUpdate.argtypes = [c_char_p,c_int,c_int]
   _SFmpq.MpqCloseUpdatedArchive.argtypes = [c_int,c_int]
   _SFmpq.MpqAddFileToArchive.argtypes = [c_int,c_char_p,c_char_p,c_int]
   _SFmpq.MpqAddWaveToArchive.argtypes = [c_int,c_char_p,c_char_p,c_int,c_int]
   _SFmpq.MpqRenameFile.argtypes = [c_int,c_char_p,c_char_p]
   _SFmpq.MpqDeleteFile.argtypes = [c_int,c_char_p,c_char_p]
   _SFmpq.MpqCompactArchive.argtypes = [c_int]
   _SFmpq.MpqAddFileFromBuffer.argtypes = [c_int,c_void_p,c_int,c_char_p,c_int]
[/spoiler]You just have to add one line after the first ("if not FOLDER:"), then indent the lines under it (or just copying whats below over the old stuff should work):[spoiler]

Code: Select all

def MpqInitialize():
   if not FOLDER:
      _SFmpq.MpqGetVersionString.restype = c_char_p
      _SFmpq.MpqGetVersion.restype = c_float
      _SFmpq.SFMpqGetVersionString.restype = c_char_p
      _SFmpq.SFMpqGetVersionString2.argtypes = [c_char_p,c_int]
      _SFmpq.SFMpqGetVersion.restype = SFMPQVERSION
      
      _SFmpq.SFileOpenArchive.argtypes = [c_char_p,c_int,c_int,c_void_p]
      _SFmpq.SFileCloseArchive.argtypes = [c_int]
      #_SFmpq.SFileOpenFileAsArchive.argtypes = [c_int,c_char_p,c_int,c_int,c_void_p]
      _SFmpq.SFileGetArchiveName.argtypes = [c_int,c_char_p,c_int]
      _SFmpq.SFileOpenFile.argtypes = [c_char_p,c_void_p]
      _SFmpq.SFileOpenFileEx.argtypes = [c_int,c_char_p,c_int,c_void_p]
      _SFmpq.SFileCloseFile.argtypes = [c_int]
      _SFmpq.SFileGetFileSize.argtypes = [c_int,c_void_p]
      _SFmpq.SFileGetFileArchive.argtypes = [c_int,c_void_p]
      _SFmpq.SFileGetFileName.argtypes = [c_int,c_char_p,c_int]
      _SFmpq.SFileSetFilePointer.argtypes = [c_int,c_int,c_void_p,c_int]
      _SFmpq.SFileReadFile.argtypes = [c_int,c_void_p,c_int,c_void_p,c_void_p]

      _SFmpq.SFileGetFileInfo.argtypes = [c_int,c_int]
      _SFmpq.SFileListFiles.argtypes = [c_int,c_char_p,c_void_p,c_int]
      # _SFmpq..argtypes = []
      # _SFmpq..argtypes = []
      # _SFmpq..argtypes = []
      # _SFmpq..argtypes = []
      # _SFmpq..argtypes = []
      # _SFmpq..argtypes = []
      _SFmpq.SFileSetArchivePriority.argtypes = [c_int,c_int]
      _SFmpq.MpqOpenArchiveForUpdate.argtypes = [c_char_p,c_int,c_int]
      _SFmpq.MpqCloseUpdatedArchive.argtypes = [c_int,c_int]
      _SFmpq.MpqAddFileToArchive.argtypes = [c_int,c_char_p,c_char_p,c_int]
      _SFmpq.MpqAddWaveToArchive.argtypes = [c_int,c_char_p,c_char_p,c_int,c_int]
      _SFmpq.MpqRenameFile.argtypes = [c_int,c_char_p,c_char_p]
      _SFmpq.MpqDeleteFile.argtypes = [c_int,c_char_p,c_char_p]
      _SFmpq.MpqCompactArchive.argtypes = [c_int]
      _SFmpq.MpqAddFileFromBuffer.argtypes = [c_int,c_void_p,c_int,c_char_p,c_int]
[/spoiler]

Posted: Thu May 21, 2009 3:26 am
by Lord_Jeremy
Thank you, that did indeed fix the problem. I'm guessing python doesn't ignore tabs, perhaps using the indent-levels instead of braces as in C?

Anyway, where the hell did you get your format documentations? I've done extensive searching myself and only found scattered notes across defunct websites. Oh and I'm wondering if the Unused value of the Flingy.dat is really unused. I noticed a bunch of units use it, though maybe it really does nothing :P

Posted: Thu May 21, 2009 3:50 am
by poiuy_qwert
Yes thats how python works.

I got most online but some from FaRTy1billion. I think anything marked as unused (if it has no ? after it) is unreferenced by the actual game code, though I used the labels from DatEdit so i'm not 100% sure.

Posted: Wed Oct 28, 2009 10:34 pm
by poiuy_qwert
[quote name='bajadulce' post='7905' date='Oct 28 2009, 05:33 AM']WTF.. why didn't you say something earlier. :lol:[/quote]
Heh Its only plastered everywhere ;) :P Im glad you like it!