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

[Paid 30$] Need map converter


LGDR
 Share

Recommended Posts

```
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 will have to look at the differences between the map types inbetween 3.0.3 and eclipse and change that sub accordingly to make it work for you, but it is probably silly to pay 30 bucks for that.
Link to comment
Share on other sites

@Joost, consider this… the Nightly version of EO converts all graphics in memory to powers of two... if his tilesets are thousands of pixels in length, then finding the next power of 2 to fit would be huge and 90% of graphics cards could not support it. So there is a good chance that a part of the job will be splitting his tilesets and therefore editing each of the maps values to draw from different tilesets. This could be significantly larger of a project than you think.
Link to comment
Share on other sites

@jcsnider:

> @Joost, consider this… the Nightly version of EO converts all graphics in memory to powers of two... if his tilesets are thousands of pixels in length, then finding the next power of 2 to fit would be huge and 90% of graphics cards could not support it. So there is a good chance that a part of the job will be splitting his tilesets and therefore editing each of the maps values to draw from different tilesets. This could be significantly larger of a project than you think.

True, but only for the nightly version. For everything else paying anything more than 10 bucks (hour of work) would be getting ripped off imo.
Link to comment
Share on other sites

Yes, in DX8 it will not support a tileset that big. It would have to be split into 512 by 512 segments and then a ton of calculations would have to be done to revise your mapdata to work. In other words, it is very difficult especially for an average programmer.
Link to comment
Share on other sites

so cant u just do
```
newtileset = oldmapx * oldmapy
newmapx = 0
newmapy = 0

```And split up every tile in 32*32 with top left tile being tileset 1, tile next to it tileset 2, etcetera. The x/y data for the tile will be irrelevant so all you need is right tileset.
Link to comment
Share on other sites

@Joost:

> so cant u just do
> ```
> newtileset = oldmapx * oldmapy
> newmapx = 0
> newmapy = 0
>
> ```And split up every tile in 32*32 with top left tile being tileset 1, tile next to it tileset 2, etcetera. The x/y data for the tile will be irrelevant so all you need is right tileset.

Then you have to create a new surface for every tile, which would be waaay slower than just using a tileset. (Since there is an overhead for each surface you have to keep track of.)

Also, why would you do that instead of splitting up the tileset manually? Seems like a lot of work for something so menial.
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...