Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Problem converting my maps


santa-clause
 Share

Recommended Posts

Hello everyone,

I'm having a little problem with converting my maps from prospekt to EA reborn.

It has something to do with the resources not being fully saved i've added the tutorials by matthew on how to make the advanced skills with xp and stuff.

This is the mod that converts everything:

```
Private Declare Sub ZeroMemory Lib "Kernel32.dll" Alias "RtlZeroMemory" (Destination As Any, ByVal Length As Long)Public Sub ConvertAccunts()Dim SFileName As String frmMain.Label1.Caption = "Processing maps... this may take longer depending on the amount of accounts present in \old\..." SFileName = Dir(App.Path & "\old\") Do While SFileName > "" ClearMap ' Load in the old Player. LoadMap SFileName ' Convert to the new Format ConvertMap ' Save Player SaveMap SFileName SFileName = Dir Loop ' Notify the user we're done. frmMain.Label1.Caption = "Done with converting the maps." MsgBox "Done!" & vbNewLine & "You may now close this application."End SubPrivate Sub LoadMap(ByVal SFileName As String) Dim filename As String Dim F, x, y, Z, i As Long filename = App.Path & "\old\" & SFileName F = FreeFile Open filename For Binary As #F Get #F, , OldMap.Name Get #F, , OldMap.Music Get #F, , OldMap.BGS Get #F, , OldMap.Revision Get #F, , OldMap.Moral Get #F, , OldMap.Up Get #F, , OldMap.Down Get #F, , OldMap.Left Get #F, , OldMap.Right Get #F, , OldMap.BootMap Get #F, , OldMap.BootX Get #F, , OldMap.BootY Get #F, , OldMap.Weather Get #F, , OldMap.WeatherIntensity Get #F, , OldMap.Fog Get #F, , OldMap.FogSpeed Get #F, , OldMap.FogOpacity Get #F, , OldMap.Red Get #F, , OldMap.Green Get #F, , OldMap.Blue Get #F, , OldMap.Alpha Get #F, , OldMap.MaxX Get #F, , OldMap.MaxY ' have to set the tile() ReDim OldMap.Tile(0 To OldMap.MaxX, 0 To OldMap.MaxY) For x = 0 To OldMap.MaxX For y = 0 To OldMap.MaxY Get #F, , OldMap.Tile(x, y) Next Next For x = 1 To MAX_MAP_NPCS Get #F, , OldMap.NPC(x) Get #F, , OldMap.NpcSpawnType(x) Next Get #F, , OldMap.IsMember Get #F, , OldMap.Panorama Get #F, , OldMap.DayNight Close #FEnd SubPrivate Sub ClearMap() Call ZeroMemory(ByVal VarPtr(OldMap), LenB(OldMap)) Call ZeroMemory(ByVal VarPtr(NewMap), LenB(NewMap))End SubPrivate Sub ConvertMap()Dim i, y, x, Z As Long NewMap.Name = OldMap.Name NewMap.Music = OldMap.Music NewMap.BGS = OldMap.Music NewMap.Revision = OldMap.Revision NewMap.Moral = OldMap.Moral NewMap.Up = OldMap.Up NewMap.Down = OldMap.Down NewMap.Left = OldMap.Left NewMap.Right = OldMap.Right NewMap.BootMap = OldMap.BootMap NewMap.BootX = OldMap.BootX NewMap.BootY = OldMap.BootY NewMap.Weather = OldMap.Weather NewMap.WeatherIntensity = OldMap.WeatherIntensity NewMap.Fog = OldMap.Fog NewMap.FogSpeed = OldMap.FogSpeed NewMap.FogOpacity = OldMap.FogOpacity NewMap.Red = OldMap.Red NewMap.Blue = OldMap.Blue NewMap.Green = OldMap.Green NewMap.Alpha = OldMap.Alpha NewMap.MaxX = OldMap.MaxX NewMap.MaxY = OldMap.MaxY ReDim NewMap.Tile(0 To NewMap.MaxX, 0 To NewMap.MaxY) ReDim Preserve OldMap.Tile(0 To NewMap.MaxX, 0 To NewMap.MaxY) For x = 0 To NewMap.MaxX For y = 0 To NewMap.MaxY For i = 1 To 5 NewMap.Tile(x, y).Layer(i).x = OldMap.Tile(x, y).Layer(i).x NewMap.Tile(x, y).Layer(i).y = OldMap.Tile(x, y).Layer(i).y NewMap.Tile(x, y).Layer(i).Tileset = OldMap.Tile(x, y).Layer(i).Tileset Next i For lala = 1 To MapLayer.Layer_Count - 1 NewMap.Tile(x, y).Autotile(lala) = OldMap.Tile(x, y).Autotile(lala) Next lala 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 NewMap.Tile(x, y).Data4 = OldMap.Tile(x, y).Data4 NewMap.Tile(x, y).DirBlock = OldMap.Tile(x, y).DirBlock Next y Next x For Z = 1 To MAX_MAP_NPCS NewMap.NPC(Z) = OldMap.NPC(Z) NewMap.NpcSpawnType(Z) = OldMap.NpcSpawnType(Z) Next Z OldMap.Panorama = NewMap.PanoramaEnd SubPrivate Sub SaveMap(ByVal SFileName As String) Dim filename As String Dim F, x, y, Z, i As Long filename = App.Path & "\new\" & SFileName F = FreeFile Open filename For Binary As #F Put #F, , NewMap.Name Put #F, , NewMap.Music Put #F, , NewMap.BGS Put #F, , NewMap.Revision Put #F, , NewMap.Moral Put #F, , NewMap.Up Put #F, , NewMap.Down Put #F, , NewMap.Left Put #F, , NewMap.Right Put #F, , NewMap.BootMap Put #F, , NewMap.BootX Put #F, , NewMap.BootY Put #F, , NewMap.Weather Put #F, , NewMap.WeatherIntensity Put #F, , NewMap.Fog Put #F, , NewMap.FogSpeed Put #F, , NewMap.FogOpacity Put #F, , NewMap.Red Put #F, , NewMap.Green Put #F, , NewMap.Blue Put #F, , NewMap.Alpha Put #F, , NewMap.MaxX Put #F, , NewMap.MaxY For x = 0 To NewMap.MaxX For y = 0 To NewMap.MaxY Put #F, , NewMap.Tile(x, y) Next Next For x = 1 To MAX_MAP_NPCS Put #F, , NewMap.NPC(x) Put #F, , NewMap.NpcSpawnType(x) Next Put #F, , NewMap.Panorama Close #FEnd Sub
```
Link to comment
Share on other sites

I just deleted all the resources before converting and it worked fine i only had a little problem with items but the engine i used before this one also had problems with items so i think it bugged and made some maps corrupted i deleted those maps and i actually couldn't save 3 maps so i think that's pretty good :D
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...