Attribute VB_Name = "VisualHeightmap" Public Function WorkoutHeightmap(Heightmap As String) FrmHeightmap.Hide ClearAllBlocks Dim TmpHeightmapLine As String Dim TmpHeightmapPiece As String Dim PrevLeft As String Dim NumP As String Dim LongestLine As String NumP = 0 '' Get Heightmap Line: For X = 0 To 40000 On Error GoTo endin TmpHeightmapLine = Split(Heightmap, vbCrLf)(X) For Y = 1 To 40000 NumP = NumP + 1 '' Get The Particular Square: TmpHeightmapPiece = Mid(TmpHeightmapLine, Y, 1) If TmpHeightmapPiece = "" Then GoTo Endofline Select Case LCase(TmpHeightmapPiece) '' Walkable: Case 0 FrmHeightmap.Walkable(NumP).Left = Y * 360 - 300 FrmHeightmap.Walkable(NumP).Top = X * 360 + 100 Case 1 FrmHeightmap.Up1(NumP).Left = Y * 360 - 300 FrmHeightmap.Up1(NumP).Top = X * 360 + 100 Case 2 FrmHeightmap.Up2(NumP).Left = Y * 360 - 300 FrmHeightmap.Up2(NumP).Top = X * 360 + 100 Case 3 To 100 FrmHeightmap.Up3(NumP).Left = Y * 360 - 300 FrmHeightmap.Up3(NumP).Top = X * 360 + 100 '' None Walkable: Case "a" FrmHeightmap.NonWalkable(NumP).Left = Y * 360 - 300 FrmHeightmap.NonWalkable(NumP).Top = X * 360 + 100 Case "b" FrmHeightmap.NonWalkable(NumP).Left = Y * 360 - 300 FrmHeightmap.NonWalkable(NumP).Top = X * 360 + 100 Case "c" FrmHeightmap.NonWalkable(NumP).Left = Y * 360 - 300 FrmHeightmap.NonWalkable(NumP).Top = X * 360 + 100 Case "d" FrmHeightmap.NonWalkable(NumP).Left = Y * 360 - 300 FrmHeightmap.NonWalkable(NumP).Top = X * 360 + 100 Case "e" FrmHeightmap.NonWalkable(NumP).Left = Y * 360 - 300 FrmHeightmap.NonWalkable(NumP).Top = X * 360 + 100 Case "f" '' Black: Case "x" FrmHeightmap.Black(NumP).Left = Y * 360 - 300 FrmHeightmap.Black(NumP).Top = X * 360 + 100 End Select NN: Dim TmpY As String TmpY = Y Next Y Endofline: FrmHeightmap.Width = 368 * TmpY - 1 If FrmHeightmap.Width < 6090 Then FrmHeightmap.Width = 6090 Dim TmpX As String TmpX = X Next X endin: FrmHeightmap.Height = 600 * TmpX FrmHeightmap.Shape(1).Left = 55 FrmHeightmap.Shape(1).Top = FrmHeightmap.ScaleHeight - 600 FrmHeightmap.Shape(1).Width = FrmHeightmap.ScaleWidth - 155 FrmHeightmap.Frame1.Top = FrmHeightmap.Shape(1).Top + 90 FrmHeightmap.Frame1.Left = FrmHeightmap.Shape(1).Left + 120 FrmHeightmap.Show End Function Public Function ClearAllBlocks() On Error GoTo endin For X = 0 To 5000 FrmHeightmap.Walkable(X).Top = 99999 FrmHeightmap.NonWalkable(X).Top = 999999 FrmHeightmap.Black(X).Top = 9999999 Next X endin: End Function