PsyOps Posted May 19, 2011 Report Posted May 19, 2011 Open #boss.lvl , import PsyBoss1.lvz, save lvl and lvz, exit. Once you get back into it, it gives an elvl error. and some tiles out of range or something. Hope this helps, and I would like a fix =).Drake-Bug.zip Quote
Samapico Posted May 19, 2011 Report Posted May 19, 2011 DCME usually adds a custom eLVL tag in the file to indicate a lvz file associated with the map. It doesn't seem to be adding it properly, though... I'll have to look into it later. #boss.lvl @ OpenMap, Bitmap info header: --- Color Depth: 24 --- Size: 304x160 --- BiSizeImage: 145920 --- Compression: 0#boss.lvl @ OpenMap, Bitmap info header: --- bfType: 19778 --- bfSize: 146176 --- bfReserved1: 145976 (145976)#boss.lvl @ Openmap, BMPData is read from lvl file#boss.lvl @ OpenMap, trying to read eLVL data#boss.lvl @ eLVL.GetELVLData, eLVL header info: --- magic: elvl --- size: 200 --- reserved: 0#boss.lvl @ eLVL.GetELVLData, Chunk loaded: ATTR (10) at 145989#boss.lvl @ Name = #boss#boss.lvl @ eLVL.GetELVLData, Chunk loaded: ATTR (11) at 146009#boss.lvl @ Version = 1.0#boss.lvl @ eLVL.GetELVLData, Chunk loaded: ATTR (5) at 146029#boss.lvl @ Zone = #boss.lvl @ eLVL.GetELVLData, Chunk loaded: ATTR (17) at 146045#boss.lvl @ MapCreator = PsyOps#boss.lvl @ eLVL.GetELVLData, Chunk loaded: ATTR (19) at 146073#boss.lvl @ Program = DCME 3.4.13#boss.lvl @ eLVL.GetELVLData, Chunk loaded: ATTR (15) at 146101#boss.lvl @ TilesetCreator = #boss.lvl @ eLVL.GetELVLData, Chunk loaded: DCID ( at 146125#boss.lvl @ MapID = 2B617057--- Mbox prompt --- DCME - Invalid eLVL chunk size;48--- Mbox result --- DCME - Invalid eLVL chunk size;1 [...] Map loaded successfullyReading ''Attempting to loaddd '' Quote
PsyOps Posted May 20, 2011 Author Report Posted May 20, 2011 thnx. Ive used Drake for a while and I'd just like to say you guys have done an awesome job. I dont think you get it enough =). Quote
Samapico Posted May 21, 2011 Report Posted May 21, 2011 Wow... I see the problem in the data, but I have no idea how it occured... As I said, we put a "DCLV" eLVL chunk to associate a lvz file with the map. This chunk is supposed to go like this: Bytes 1-4: "DCLV"Bytes 5-8: size of chunk (32 + strlen(filename))Bytes 9-40:MD5 checksum of the file to see if it still matches (this SHOULD be 32 bytes long)Bytes 41-...: Filename (non-null terminated) For some reason, the MD5 checksum is only 16 bytes long in the file... Are you using a 64-bit OS? ... Actually, when I look at the code that generates the MD5 checksum, I have no idea how it could ever output 32 bytes... It's an array of 4 'Long' integers, which are 4 bytes in VB6 ('Integer's being 2 bytes) Edit: MD5 checksums are actually 128 bits, or 16 bytes... but they're often represented as hexadecimal strings, which use 2 characters to represent one byte, which gives a 32 bytes string. That's quite a massive bug, actually... and I have no idea why it doesn't crash more often. Most of my maps that have this load without any problem, even though the eLVL chunk is clearly the wrong size. Relevant code: '... eLVL save function 'DCLV lvz paths chunks If FlagIs(flags, SFsaveELVLdclv) Then For i = 0 To parent.lvz.getLVZCount - 1 Dim lvzname As String lvzname = parent.lvz.getLVZname(i) parent.AddDebug "eLVL.PutELVLData, Saving LVZ '" & lvzname & "' at " & Seek(f) Put #f, , stringToBytes("DCLV") Put #f, , CLng(32 + Len(lvzname)) 'MD5 hash Dim md5 As New clsMD5 Put #f, , md5.CalculateMD5(parent.lvz.getLVZpath(i)) 'Lvz name (relative path) Put #f, , stringToBytes(lvzname) Seek #f, Next4bytes(Seek(f)) Next End If Public Function CalculateMD5(filename As String) As Long() Dim bytBuffer() As Byte 10 If Not FileExists(filename) Then 20 ReDim bytBuffer(0) 30 bytBuffer(0) = 0 40 Else 50 ReDim bytBuffer(FileLen(filename) - 1) Dim f As Integer 60 f = FreeFile 70 Open filename For Binary As #f 80 Get #f, , bytBuffer 90 Close #f 100 End If 110 MD5Start 120 MD564Split UBound(bytBuffer) + 1, bytBuffer 130 MD5Finish Dim retlng() As Long 140 ReDim retlng(3) Dim i As Integer 150 For i = 0 To 3 160 retlng(i) = arrLongConversion(i + 1) 170 Next 180 CalculateMD5 = retlng End Function Quote
PsyOps Posted May 21, 2011 Author Report Posted May 21, 2011 (edited) XP professional 32bit. I'm not sure what the code means hehe. I just know I broke it $$. Edited May 21, 2011 by PsyOps Quote
Drake7707 Posted May 29, 2011 Report Posted May 29, 2011 Ive used Drake for a while Should I feel violated ? That is exactly the reason why you don't put your forum name in a project's name Quote
PsyOps Posted June 10, 2011 Author Report Posted June 10, 2011 is this how you treat all your mantoys? You violated, psha. Thats not what you said .... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.