Mirage Engine
Map converter? - Printable Version

+- Mirage Engine (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Map converter? (/showthread.php?tid=119)



- Belier13 - 14-06-2006

IF you know how to code it's kinda simple;

( taken from MS source )

Code:
Sub ConvertOldMapsToNew()
Dim FileName As String
Dim i As Long
Dim F As Long
Dim X As Long, Y As Long
Dim OldMap As OldMapRec
Dim NewMap As MapRec

    For i = 1 To MAX_MAPS
        FileName = App.Path & "\maps\map" & i & ".dat"
        
        ' Get the old file
        F = FreeFile
        Open FileName For Binary As #F
            Get #F, , OldMap
        Close #F
        
        ' Delete the old file
        Call Kill(FileName)
        
        ' Convert
        NewMap.Name = OldMap.Name
        NewMap.Revision = OldMap.Revision + 1
        NewMap.Moral = OldMap.Moral
        NewMap.Up = OldMap.Up
        NewMap.Down = OldMap.Down
        NewMap.Left = OldMap.Left
        NewMap.Right = OldMap.Right
        NewMap.Music = OldMap.Music
        NewMap.BootMap = OldMap.BootMap
        NewMap.BootX = OldMap.BootX
        NewMap.BootY = OldMap.BootY
        NewMap.Shop = OldMap.Shop
        For Y = 0 To MAX_MAPY
            For X = 0 To MAX_MAPX
                NewMap.Tile(X, Y).Ground = OldMap.Tile(X, Y).Ground
                NewMap.Tile(X, Y).Mask = OldMap.Tile(X, Y).Mask
                NewMap.Tile(X, Y).Anim = OldMap.Tile(X, Y).Anim
                NewMap.Tile(X, Y).Fringe = OldMap.Tile(X, Y).Fringe
                NewMap.Tile(X, Y).Type = OldMap.Tile(X, Y).Type
                NewMap.Tile(X, Y).Data1 = OldMap.Tile(X, Y).Data1
                NewMap.Tile(X, Y).Data2 = OldMap.Tile(X, Y).Data2
                NewMap.Tile(X, Y).Data3 = OldMap.Tile(X, Y).Data3
            Next X
        Next Y
        
        For X = 1 To MAX_MAP_NPCS
            NewMap.Npc(X) = OldMap.Npc(X)
        Next X
        
        ' Set new values to 0 or null
        NewMap.Indoors = NO
        
        ' Save the new map
        F = FreeFile
        Open FileName For Binary As #F
            Put #F, , NewMap
        Close #F
    Next i
End Sub

you also need old map and new map rec, once again if you know how to code..


- Matt - 14-06-2006

Jobs knows how to code, he was just asking for a converter that was released awhile ago.

Sorry Jobs, I havn't seen the converter in ages.


- funkynut - 14-06-2006

wow, havent seen you in ages jobs, anyway, what converter was it?


- Dragoons Master - 14-06-2006

Are you talking about mine? I did it a while ago, but I'm not home right now. When I'm back home I can send you. But Iwont be back home until the end of the weekend becouse I'm going to travel for a while.
Its not hard, but mine is very simple to convert, you copyyour OldMapRecand the New MapRec and it does all the rest.


- Obsidian - 14-06-2006

i have one. when i get home tonight i'll dig through my old stuff and upload that and the code for 'sise


- L&M - 14-06-2006

its on the esyluim diamond site

Click Me You know you want to


- Obsidian - 14-06-2006

You can download here.

http://xthost.info/endieko/Map%20Converter.rar