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

ER 1.8 Isometric Tutorial


Mohenjo Daro
 Share

Recommended Posts

![alt text](https://i.postimg.cc/yN5mWQ1k/isometric.gif)

isometric.gif

***
I've only tested this code in ER 18., but porting it to other engines shouldn't be the hardest thing to do assuming you know what you're doing.

All changes made in this tutorial are client side only, you do not need to change the server code.

If you find and bugs, feel free to post them here and I will take a look when I have time.

For those who just want the source, here you go: https://www.dropbox.com/s/socsi5d4btu339g/Eclipse Renewal Isomentric.rar?dl=0

***
***







The following changes swapping constants and variables for other variables (eg. 32 -> PIC_X). Some of these may not be in other engines, or there may be more, so I suggest searching 32, 16, 40, 48, and 64 (the reasoning is because those are multiples of 32).

In general, use PIC_X or Y for 32s that are for the map; and SIZE_X or Y for anything else. Just look at the code and choose what to use based on that.

***

***
***

`frmDev`

Find
```
Private Sub MappicTileset_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo ErrorHandler
X = X + (frmDev.scrlPictureX.value * 32)
Y = Y + (frmDev.scrlPictureY.value * 32)
```
Change it to
```
Private Sub MappicTileset_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo ErrorHandler
X = X + (frmDev.scrlPictureX.value * PIC_X)
Y = Y + (frmDev.scrlPictureY.value * PIC_Y)
```

***

Find
```
Private Sub MappicTileset_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo ErrorHandler
X = X + (frmDev.scrlPictureX.value * 32)
Y = Y + (frmDev.scrlPictureY.value * 32)
```
Change it to
```
Private Sub MappicTileset_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo ErrorHandler
X = X + (frmDev.scrlPictureX.value * PIC_X)
Y = Y + (frmDev.scrlPictureY.value * PIC_Y)
```

***
***

`frmMain`

Find
```
Max_MapX_Orig = frmMain.ScaleWidth \ PIC_X
Max_MapY_Orig = frmMain.ScaleHeight \ PIC_Y
```
Change it to
```
Max_MapX_Orig = Sqr(CCur(frmMain.ScaleWidth ^ 2) + CCur(frmMain.ScaleHeight ^ 2)) \ PIC_X
Max_MapY_Orig = Sqr(CCur(frmMain.ScaleWidth ^ 2) + CCur(frmMain.ScaleHeight ^ 2)) \ PIC_Y
```

***

Find
```
.Top = GUI(GUI_SHOP).Y + ShopTop + ((ShopOffsetY + 32) * ((i - 1) \ ShopColumns))
.Bottom = .Top + PIC_Y
.Left = GUI(GUI_SHOP).X + ShopLeft + ((ShopOffsetX + 32) * (((i - 1) Mod ShopColumns)))
.Right = .Left + PIC_X
```
Change it to
```
.Top = GUI(GUI_SHOP).Y + ShopTop + ((ShopOffsetY + SIZE_Y) * ((I - 1) \ ShopColumns))
.Bottom = .Top + SIZE_Y
.Left = GUI(GUI_SHOP).X + ShopLeft + ((ShopOffsetX + SIZE_X) * (((I - 1) Mod ShopColumns)))
.Right = .Left + SIZE_X
```

***

Find
```
.Top = InvTop + ((InvOffsetY + 32) * ((i - 1) \ InvColumns)) + GUI(GUI_INVENTORY).Y
.Bottom = .Top + PIC_Y
.Left = InvLeft + ((InvOffsetX + 32) * (((i - 1) Mod InvColumns))) + GUI(GUI_INVENTORY).X
.Right = .Left + PIC_X
```
Change it to
```
.Top = InvTop + ((InvOffsetY + SIZE_Y) * ((I - 1) \ InvColumns)) + GUI(GUI_INVENTORY).Y
.Bottom = .Top + SIZE_Y
.Left = InvLeft + ((InvOffsetX + SIZE_X) * (((I - 1) Mod InvColumns))) + GUI(GUI_INVENTORY).X
.Right = .Left + SIZE_X
```

***

Find
```
.Top = SpellTop + ((SpellOffsetY + 32) * ((i - 1) \ SpellColumns)) + GUI(GUI_SKILLS).Y
.Bottom = .Top + PIC_Y
.Left = SpellLeft + ((SpellOffsetX + 32) * (((i - 1) Mod SpellColumns))) + GUI(GUI_SKILLS).X
.Right = .Left + PIC_X
```
Change it to
```
.Top = SpellTop + ((SpellOffsetY + SIZE_Y) * ((I - 1) \ SpellColumns)) + GUI(GUI_SKILLS).Y
.Bottom = .Top + SIZE_Y
.Left = SpellLeft + ((SellOffsetX + SIZE_X) * (((I - 1) Mod SpellColumns))) + GUI(GUI_SKILLS).X
.Right = .Left + SIZE_X
```

***

Find
```
.Top = GUI(GUI_TRADE).Y + TrdTop + ((TrdOffsetY + 32) * ((i - 1) \ TrdColumns))
.Bottom = .Top + PIC_Y
.Left = GUI(GUI_TRADE).X + TrdLeft + ((TrdOffsetX + 32) * (((i - 1) Mod TrdColumns)))
.Right = .Left + PIC_X
```
Change it to
```
.Top = GUI(GUI_TRADE).Y + TrdTop + ((TrdOffsetY + SIZE_Y) * ((I - 1) \ TrdColumns))
.Bottom = .Top + SIZE_Y
.Left = GUI(GUI_TRADE).X + TrdLeft + ((TrdOffsetX + SIZE_X) * (((I - 1) Mod TrdColumns)))
.Right = .Left + SIZE_X
```

***

Find
```
.Top = GUI(GUI_TRADE).Y + TrdTop + ((TrdOffsetY + 32) * ((i - 1) \ TrdColumns))
.Bottom = .Top + PIC_Y
.Left = GUI(GUI_TRADE).X + (GUI(GUI_TRADE).Width * 0.5) - 6 + TrdLeft + ((TrdOffsetX + 32) * (((i - 1) Mod TrdColumns)))
.Right = .Left + PIC_X
```
Change it to
```
.Top = GUI(GUI_TRADE).Y + TrdTop + ((TrdOffsetY + SIZE_Y) * ((I - 1) \ TrdColumns))
.Bottom = .Top + SIZE_Y
.Left = GUI(GUI_TRADE).X + (GUI(GUI_TRADE).Width * 0.5) - 6 + TrdLeft + ((TrdOffsetX + SIZE_X) * (((I - 1) Mod TrdColumns)))
.Right = .Left + SIZE_X
```

***

Find
```
.Top = GUI(GUI_BANK).Y + BankTop + ((BankOffsetY + 32) * ((i - 1) \ BankColumns))
.Bottom = .Top + PIC_Y
.Left = GUI(GUI_BANK).X + BankLeft + ((BankOffsetX + 32) * (((i - 1) Mod BankColumns)))
.Right = .Left + PIC_X
```
Change it to
```
.Top = GUI(GUI_BANK).Y + BankTop + ((BankOffsetY + SIZE_Y) * ((I - 1) \ BankColumns))
.Bottom = .Top + SIZE_Y
.Left = GUI(GUI_BANK).X + BankLeft + ((BankOffsetX + SIZE_X) * (((I - 1) Mod BankColumns)))
.Right = .Left + SIZE_X
```

***
***

`modConstants`

Find
```
Public Const PIC_X As Long = 32
Public Const PIC_Y As Long = 32
```
Change it to
```
Public Const PIC_X As Long = 64
Public Const PIC_Y As Long = 32
```
This will change the size of the tiles to support isometric tiles

***
***

`modDirectDraw` / `modGraphics`

Find
```
Direct3D_Window.BackBufferWidth = frmMain.ScaleWidth 'Match the backbuffer width with the display width
Direct3D_Window.BackBufferHeight = frmMain.ScaleHeight 'Match the backbuffer height with the display height
```
Change it to
```
Direct3D_Window.BackBufferWidth = WindowWidth ' Match the backbuffer width with the display width
Direct3D_Window.BackBufferHeight = WindowHeight ' Match the backbuffer height with the display height
```

***

Find
```
rec.Right = rec.Left + 32
rec.Bottom = rec.Top + 32
RenderTexture Tex_Direction, ConvertMapX(X * PIC_X), ConvertMapY(Y * PIC_Y), rec.Left, rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, D3DColorRGBA(255, 255, 255, 255)
```
Change it to
```
rec.Right = rec.Left + PIC_X
rec.Bottom = rec.Top + PIC_Y
RenderTexture Tex_Direction, ConvertMapIsoX(X * PIC_X, Y * PIC_Y), ConvertMapIsoY(Y * PIC_Y, X * PIC_X), rec.Left, rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, D3DColorRGBA(255, 255, 255, 255)
```

***

Find
```
RenderTexture Tex_Direction, ConvertMapX(X * PIC_X) + DirArrowX(i), ConvertMapY(Y * PIC_Y) + DirArrowY(i), rec.Left, rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, D3DColorRGBA(255, 255, 255, 255)
```
Change it to
```
RenderTexture Tex_Direction, ConvertMapIsoX(X * PIC_X, Y * PIC_Y) + DirArrowX(I), ConvertMapIsoY(Y * PIC_Y, X * PIC_X) + DirArrowY(I), rec.Left, rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, D3DColorRGBA(255, 255, 255, 255)
```

***

Find (in both `Public Sub DrawTarget` and `Public Sub DrawHover`)
```
X = X - ((Width - 32) * 0.5)
Y = Y - (Height * 0.5)

X = ConvertMapX(X)
Y = ConvertMapY(Y)
```
Change it to
```
Dim tmpX As Long, tmpY As Long
tmpX = X - (Width * 0.5)
tmpY = Y - (Height * 0.5)


X = ConvertMapIsoX(tmpX, tmpY)
Y = ConvertMapIsoY(tmpY, tmpX)
```

***

Find
```
Public Sub DrawMapTile(ByVal X As Long, ByVal Y As Long)
Dim rec As RECT
Dim i As Long

' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo ErrorHandler

With Map.Tile(X, Y)
For i = MapLayer.Ground To MapLayer.Mask5
If Autotile(X, Y).Layer(i).renderState = RENDER_STATE_NORMAL Then
' Draw normally
RenderTexture Tex_Tileset(.Layer(i).Tileset), ConvertMapX(X * PIC_X), ConvertMapY(Y * PIC_Y), .Layer(i).X * 32, .Layer(i).Y * 32, 32, 32, 32, 32, -1
ElseIf Autotile(X, Y).Layer(i).renderState = RENDER_STATE_AUTOTILE Then
' Draw autotiles
DrawAutoTile i, ConvertMapX(X * PIC_X), ConvertMapY(Y * PIC_Y), 1, X, Y
DrawAutoTile i, ConvertMapX((X * PIC_X) + 16), ConvertMapY(Y * PIC_Y), 2, X, Y
DrawAutoTile i, ConvertMapX(X * PIC_X), ConvertMapY((Y * PIC_Y) + 16), 3, X, Y
DrawAutoTile i, ConvertMapX((X * PIC_X) + 16), ConvertMapY((Y * PIC_Y) + 16), 4, X, Y
End If
Next
End With

' Error handler
Exit Sub

ErrorHandler:
HandleError "DrawMapTile", "modGraphics", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Public Sub DrawMapFringeTile(ByVal X As Long, ByVal Y As Long)
Dim rec As RECT
Dim i As Long

' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo ErrorHandler

With Map.Tile(X, Y)
For i = MapLayer.Fringe To MapLayer.Fringe5
If Autotile(X, Y).Layer(i).renderState = RENDER_STATE_NORMAL Then
' Draw normally
RenderTexture Tex_Tileset(.Layer(i).Tileset), ConvertMapX(X * PIC_X), ConvertMapY(Y * PIC_Y), .Layer(i).X * 32, .Layer(i).Y * 32, 32, 32, 32, 32, -1
ElseIf Autotile(X, Y).Layer(i).renderState = RENDER_STATE_AUTOTILE Then
' Draw autotiles
DrawAutoTile i, ConvertMapX(X * PIC_X), ConvertMapY(Y * PIC_Y), 1, X, Y
DrawAutoTile i, ConvertMapX((X * PIC_X) + 16), ConvertMapY(Y * PIC_Y), 2, X, Y
DrawAutoTile i, ConvertMapX(X * PIC_X), ConvertMapY((Y * PIC_Y) + 16), 3, X, Y
DrawAutoTile i, ConvertMapX((X * PIC_X) + 16), ConvertMapY((Y * PIC_Y) + 16), 4, X, Y
End If
Next
End With

' Error handler
Exit Sub
ErrorHandler:
HandleError "DrawMapFringeTile", "modGraphics", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
```
Change it to
```
Public Sub DrawMapTile(ByVal X As Long, ByVal Y As Long, ByVal layer As Byte)
Dim rec As RECT

' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo ErrorHandler

With Map.Tile(X, Y)
If Autotile(X, Y).layer(layer).renderState = RENDER_STATE_NORMAL Then
' Draw normally
RenderTexture Tex_Tileset(.layer(layer).Tileset), ConvertMapIsoX(X * PIC_X, Y * PIC_Y), ConvertMapIsoY(Y * PIC_Y, X * PIC_X), .layer(layer).X * PIC_X, .layer(layer).Y * PIC_Y, PIC_X, PIC_Y, PIC_X, PIC_Y, -1
ElseIf Autotile(X, Y).layer(layer).renderState = RENDER_STATE_AUTOTILE Then
' Draw autotiles
DrawAutoTile layer, ConvertMapIsoX(X * PIC_X, Y * PIC_Y), ConvertMapIsoY(Y * PIC_Y, X * PIC_X), 1, X, Y
DrawAutoTile layer, ConvertMapIsoX((X * PIC_X) + (PIC_X * 0.5), Y * PIC_Y), ConvertMapIsoY(Y * PIC_Y, (X * PIC_X) + (PIC_X * 0.5)), 2, X, Y
DrawAutoTile layer, ConvertMapIsoX(X * PIC_X, (Y * PIC_Y) + (PIC_Y * 0.5)), ConvertMapIsoY((Y * PIC_Y) + (PIC_Y * 0.5), X * PIC_X), 3, X, Y
DrawAutoTile layer, ConvertMapIsoX((X * PIC_X) + (PIC_X * 0.5), (Y * PIC_Y) + (PIC_Y * 0.5)), ConvertMapIsoY((Y * PIC_Y) + (PIC_Y * 0.5), (X * PIC_X) + (PIC_X * 0.5)), 4, X, Y
End If
End With

' Error handler
Exit Sub
ErrorHandler:
HandleError "DrawMapTile", "modGraphics", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Public Sub DrawMapFringeTile(ByVal X As Long, ByVal Y As Long, ByVal layer As Byte)
Dim rec As RECT
'Dim layer As Long

' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo ErrorHandler

With Map.Tile(X, Y)
If Autotile(X, Y).layer(layer).renderState = RENDER_STATE_NORMAL Then
' Draw normally
RenderTexture Tex_Tileset(.layer(layer).Tileset), ConvertMapIsoX(X * PIC_X, Y * PIC_Y), ConvertMapIsoY(Y * PIC_Y, X * PIC_X), .layer(layer).X * PIC_X, .layer(layer).Y * PIC_Y, PIC_X, PIC_Y, PIC_X, PIC_Y, -1
ElseIf Autotile(X, Y).layer(layer).renderState = RENDER_STATE_AUTOTILE Then
' Draw autotiles
DrawAutoTile layer, ConvertMapIsoX(X * PIC_X, Y * PIC_Y), ConvertMapIsoY(Y * PIC_Y, X * PIC_X), 1, X, Y
DrawAutoTile layer, ConvertMapIsoX((X * PIC_X) + (PIC_X * 0.5), Y * PIC_Y), ConvertMapIsoY(Y * PIC_Y, (X * PIC_X) + (PIC_X * 0.5)), 2, X, Y
DrawAutoTile layer, ConvertMapIsoX(X * PIC_X, (Y * PIC_Y) + (PIC_Y * 0.5)), ConvertMapIsoY((Y * PIC_Y) + (PIC_Y * 0.5), X * PIC_X), 3, X, Y
DrawAutoTile layer, ConvertMapIsoX((X * PIC_X) + (PIC_X * 0.5), (Y * PIC_Y) + (PIC_Y * 0.5)), ConvertMapIsoY((Y * PIC_Y) + (PIC_Y * 0.5), (X * PIC_X) + (PIC_X * 0.5)), 4, X, Y
End If
End With

' Error handler
Exit Sub
ErrorHandler:
HandleError "DrawMapFringeTile", "modGraphics", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
```
This is changing the rendering so we can render layer by layer instead of tile by tile

***

Find
```
RenderTexture Tex_Door, ConvertMapX(x2), ConvertMapY(y2), rec.Left, rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, D3DColorRGBA(255, 255, 255, 255)
'Call DDS_BackBuffer.DrawFast(ConvertMapX(X2), ConvertMapY(Y2), DDS_Door, rec, DDDrawFAST_WAIT Or DDDrawFAST_SRCCOLORKEY)
```
Change it to
```
RenderTexture Tex_Door, ConvertMapIsoX(x2, y2), ConvertMapIsoY(y2, x2), rec.Left, rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, D3DColorRGBA(255, 255, 255, 255)
```

***

Find
```
BloodCount = Tex_Blood.Width / 32
```
Change it to
```
BloodCount = Tex_Blood.Width / SIZE_X
```

***

Find
```
RenderTexture Tex_Blood, ConvertMapX(.X * PIC_X), ConvertMapY(.Y * PIC_Y), rec.Left, rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, D3DColorRGBA(255, 255, 255, 255)
```
Change it to
```
RenderTexture Tex_Blood, ConvertMapIsoX(.X * PIC_X, .Y * PIC_Y), ConvertMapIsoY(.Y * PIC_Y, .X * PIC_X), rec.Left, rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, D3DColorRGBA(255, 255, 255, 255)
```

***

Find
```
' no lock, default x + y
X = (AnimInstance(Index).X * 32) + 16 - (Width * 0.5)
Y = (AnimInstance(Index).Y * 32) + 16 - (Height * 0.5)
End If

X = ConvertMapX(X)
Y = ConvertMapY(Y)
```
Change it to
```
' no lock, default x + y
X = (AnimInstance(Index).X * PIC_X) + (PIC_X * 0.5) - (Width * 0.5)
Y = (AnimInstance(Index).Y * PIC_Y) + (PIC_Y * 0.5) - (Height * 0.5)
End If

X = ConvertMapIsoX(X, Y)
Y = ConvertMapIsoY(Y, X)
```

***

Find
```
If Tex_Item(PicNum).Width > 64 Then ' has more than 1 frame
With rec
.Top = 0
.Bottom = 32
.Left = (MapItem(ItemNum).Frame * 32)
.Right = .Left + 32
```
Change it to
```
If Tex_Item(PicNum).Width > (SIZE_X * 2) Then ' has more than 1 frame
With rec
.Top = 0
.Bottom = SIZE_Y
.Left = (MapItem(ItemNum).Frame * SIZE_X)
.Right = .Left + SIZE_X
```

***

Find
```
RenderTexture Tex_Item(PicNum), ConvertMapX(MapItem(ItemNum).X * PIC_X), ConvertMapY(MapItem(ItemNum).Y * PIC_Y), rec.Left, rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, D3DColorRGBA(255, 255, 255, 255)
```
Change it to
```
RenderTexture Tex_Item(PicNum), ConvertMapIsoX(MapItem(ItemNum).X * PIC_X, MapItem(ItemNum).Y * PIC_Y), ConvertMapIsoY(MapItem(ItemNum).Y * PIC_Y, MapItem(ItemNum).X * PIC_X), rec.Left, rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, D3DColorRGBA(255, 255, 255, 255)
```

***

Find
```
' Set base x + y, then the offset due to size
X = (MapResource(Resource_num).X * PIC_X) - (Tex_Resource(Resource_sprite).Width * 0.5) + 16
Y = (MapResource(Resource_num).Y * PIC_Y) - Tex_Resource(Resource_sprite).Height + 32

For i = 1 To Player_HighIndex
If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
If ConvertMapY(GetPlayerY(i)) < ConvertMapY(MapResource(Resource_num).Y) And ConvertMapY(GetPlayerY(i)) > ConvertMapY(MapResource(Resource_num).Y) - (Tex_Resource(Resource_sprite).Height) / 32 Then
If ConvertMapX(GetPlayerX(i)) >= ConvertMapX(MapResource(Resource_num).X) - ((Tex_Resource(Resource_sprite).Width * 0.5) / 32) And ConvertMapX(GetPlayerX(i)) <= ConvertMapX(MapResource(Resource_num).X) + ((Tex_Resource(Resource_sprite).Width * 0.5) / 32) Then
```
Change it to
```
' Set base x + y, then the offset due to size
X = (MapResource(Resource_num).X * PIC_X) - (Tex_Resource(Resource_sprite).Width * 0.5) + (PIC_X * 0.5)
Y = (MapResource(Resource_num).Y * PIC_Y) - Tex_Resource(Resource_sprite).Height + PIC_Y

For I = 1 To Player_HighIndex
If IsPlaying(I) And GetPlayerMap(I) = GetPlayerMap(MyIndex) Then
If ConvertMapIsoY(GetPlayerY(I), GetPlayerX(I)) < ConvertMapIsoY(MapResource(Resource_num).Y, MapResource(Resource_num).X) And ConvertMapIsoY(GetPlayerY(I), GetPlayerX(I)) > ConvertMapIsoY(MapResource(Resource_num).Y, MapResource(Resource_num).X) - (Tex_Resource(Resource_sprite).Height) / PIC_Y Then
If ConvertMapIsoX(GetPlayerX(I), GetPlayerY(I)) >= ConvertMapIsoX(MapResource(Resource_num).X, MapResource(Resource_num).Y) - ((Tex_Resource(Resource_sprite).Width * 0.5) / PIC_X) And ConvertMapIsoX(GetPlayerX(I), GetPlayerY(I)) <= ConvertMapIsoX(MapResource(Resource_num).X, MapResource(Resource_num).Y) + ((Tex_Resource(Resource_sprite).Width * 0.5) / PIC_X) Then
```

***

Find
```
If Resource < 1 Or Resource > NumResources Then Exit Sub

X = ConvertMapX(dX)
Y = ConvertMapY(dY)
```
Change it to
```
If Resource < 1 Or Resource > NumResources Then Exit Sub

X = ConvertMapIsoX(dX, dY)
Y = ConvertMapIsoY(dY, dX)
```

***

Find
```
RenderTexture Tex_Bars, ConvertMapX(tmpX), ConvertMapY(tmpY), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
```
Change it to
```
RenderTexture Tex_Bars, ConvertMapIsoX(tmpX, tmpY), ConvertMapIsoY(tmpY, tmpX), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
```

***

Find
```
RenderTexture Tex_Bars, ConvertMapX(tmpX), ConvertMapY(tmpY), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
```
Change it to
```
RenderTexture Tex_Bars, ConvertMapIsoX(tmpX, tmpY), ConvertMapIsoY(tmpY, tmpX), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
```

***

Find
```
RenderTexture Tex_Bars, ConvertMapX(tmpX), ConvertMapY(tmpY), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
```
Change it to
```
RenderTexture Tex_Bars, ConvertMapIsoX(tmpX, tmpY), ConvertMapIsoY(tmpY, tmpX), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
```

***

Find
```
RenderTexture Tex_Bars, ConvertMapX(tmpX), ConvertMapY(tmpY), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
```
Change it to
```
RenderTexture Tex_Bars, ConvertMapIsoX(tmpX, tmpY), ConvertMapIsoY(tmpY, tmpX), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
```

***

Find
```
RenderTexture Tex_Bars, ConvertMapX(tmpX), ConvertMapY(tmpY), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
```
Change it to
```
RenderTexture Tex_Bars, ConvertMapIsoX(tmpX, tmpY), ConvertMapIsoY(tmpY, tmpX), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
```

***

Find
```
RenderTexture Tex_Bars, ConvertMapX(tmpX), ConvertMapY(tmpY), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
```
Change it to
```
RenderTexture Tex_Bars, ConvertMapIsoX(tmpX, tmpY), ConvertMapIsoY(tmpY, tmpX), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
```

***

Find
```
RenderTexture Tex_Bars, ConvertMapX(tmpX), ConvertMapY(tmpY), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
```
Change it to
```
RenderTexture Tex_Bars, ConvertMapIsoX(tmpX, tmpY), ConvertMapIsoY(tmpY, tmpX), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
```

***

Find
```
RenderTexture Tex_Bars, ConvertMapX(tmpX), ConvertMapY(tmpY), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
```
Change it to
```
RenderTexture Tex_Bars, ConvertMapIsoX(tmpX, tmpY), ConvertMapIsoY(tmpY, tmpX), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
```

***

Find
```
With dRect
.Top = HotbarTop + GUI(GUI_HOTBAR).Y
.Left = HotbarLeft + ((HotbarOffsetX + 32) * ((i - 1) Mod MAX_HOTBAR)) + GUI(GUI_HOTBAR).X
.Bottom = .Top + 32
.Right = .Left + 32
End With

With destRect
.Top = HotbarTop
.Left = HotbarLeft + (HotbarOffsetX + 32) * ((i - 1) Mod MAX_HOTBAR)
.Bottom = .Top + 32
.Right = .Left + 32
End With

With sRect
.Top = 0
.Left = 0
.Bottom = 32
.Right = 32
End With
```
Change it to
```
With dRect
.Top = HotbarTop + GUI(GUI_HOTBAR).Y
.Left = HotbarLeft + ((HotbarOffsetX + SIZE_X) * ((I - 1) Mod MAX_HOTBAR)) + GUI(GUI_HOTBAR).X
.Bottom = .Top + SIZE_Y
.Right = .Left + SIZE_Y
End With

With destRect
.Top = HotbarTop
.Left = HotbarLeft + (HotbarOffsetX + 32) * ((i - 1) Mod MAX_HOTBAR)
.Left = HotbarLeft + (HotbarOffsetX + SIZE_X) * ((I - 1) Mod MAX_HOTBAR)
.Bottom = .Top + SIZE_Y
.Right = .Left + SIZE_Y
End With

With sRect
.Top = 0
.Left = 0
.Bottom = SIZE_Y
.Right = SIZE_X
End With
```

***

Find
```
With sRect
.Top = 0
.Left = 0
.Bottom = 32
.Right = 32
End With
If Len(Spell(Hotbar(i).Slot).Name) > 0 Then
If Spell(Hotbar(i).Slot).Icon > 0 Then
```
Change it to
```
With sRect
.Top = 0
.Left = 0
.Bottom = SIZE_Y
.Right = SIZE_X
End With
If Len(Spell(Hotbar(i).Slot).Name) > 0 Then
If Spell(Hotbar(i).Slot).Icon > 0 Then
```

***

Find
```
For n = 1 To MAX_PLAYER_SPELLS
If PlayerSpells(n) = Hotbar(i).Slot Then
' has spell
If Not SpellCD(i) = 0 Then
sRect.Left = 32
sRect.Right = 64
End If
End If
Next
```
Change it to
```
For n = 1 To MAX_PLAYER_SPELLS
If PlayerSpells(n) = Hotbar(i).Slot Then
' has spell
If Not SpellCD(I) = 0 Then
sRect.Left = SIZE_X
sRect.Right = SIZE_X * 2
End If
End If
Next
```

***

Find
```
' Calculate the X
X = GetPlayerX(Index) * PIC_X + Player(Index).xOffset - ((Tex_Character(Sprite).Width / 4 - 32) * 0.5)

' Is the player's height more than 32..?
If (Tex_Character(Sprite).Height) > 32 Then
' Create a 32 pixel offset for larger sprites
Y = GetPlayerY(Index) * PIC_Y + Player(Index).yOffset - ((Tex_Character(Sprite).Height / 4) - 32)
Else
' Proceed as normal
Y = GetPlayerY(Index) * PIC_Y + Player(Index).yOffset
End If

' render the actual sprite
Call DrawSprite(Sprite, X, Y, rec)
```
Change it to
```
' Calculate the X
X = GetPlayerX(Index) * PIC_X + Player(Index).xOffset - ((Tex_Character(Sprite).Width / 4 - PIC_X) * 0.5)

' Is the player's height more than PIC_Y..?
If (Tex_Character(Sprite).Height) > PIC_Y Then
' Create a 32 pixel offset for larger sprites
Y = GetPlayerY(Index) * PIC_Y + Player(Index).yOffset - ((Tex_Character(Sprite).Height / 4) - PIC_Y)
Else
' Proceed as normal
Y = GetPlayerY(Index) * PIC_Y + Player(Index).yOffset
End If

X = X - (PIC_X * 0.75)
Y = Y - (PIC_Y * 0.5)

' render the actual sprite
Call DrawSprite(Sprite, X, Y, rec)
```

***

Find
```
' Calculate the X
X = MapNpc(MapNpcNum).X * PIC_X + MapNpc(MapNpcNum).xOffset - ((Tex_Character(Sprite).Width / 4 - 32) * 0.5)

' Is the player's height more than 32..?
If (Tex_Character(Sprite).Height / 4) > 32 Then
' Create a 32 pixel offset for larger sprites
Y = MapNpc(MapNpcNum).Y * PIC_Y + MapNpc(MapNpcNum).yOffset - ((Tex_Character(Sprite).Height / 4) - 32)
Else
' Proceed as normal
Y = MapNpc(MapNpcNum).Y * PIC_Y + MapNpc(MapNpcNum).yOffset
End If

Call DrawSprite(Sprite, X, Y, rec)
```
Change it to
```
' Calculate the X
X = MapNpc(MapNpcNum).X * PIC_X + MapNpc(MapNpcNum).xOffset - ((Tex_Character(Sprite).Width / 4 - PIC_X) * 0.5)

' Is the player's height more than 32..?
If (Tex_Character(Sprite).Height / 4) > PIC_Y Then
' Create a 32 pixel offset for larger sprites
Y = MapNpc(MapNpcNum).Y * PIC_Y + MapNpc(MapNpcNum).yOffset - ((Tex_Character(Sprite).Height / 4) - PIC_Y)
Else
' Proceed as normal
Y = MapNpc(MapNpcNum).Y * PIC_Y + MapNpc(MapNpcNum).yOffset
End If

X = X - (PIC_X * 0.75)
Y = Y - (PIC_Y * 0.5)

Call DrawSprite(Sprite, X, Y, rec)
```

***

Find
```
' clipping
X = ConvertMapX(x2)
Y = ConvertMapY(y2)
Width = (rec.Right - rec.Left)
Height = (rec.Bottom - rec.Top)
```
Change it to
```
' clipping
X = ConvertMapIsoX(x2, y2)
Y = ConvertMapIsoY(y2, x2)
Width = (rec.Right - rec.Left)
Height = (rec.Bottom - rec.Top)
```

***

Find
```
If Sprite < 1 Or Sprite > NumCharacters Then Exit Sub
X = ConvertMapX(x2)
Y = ConvertMapY(y2)
Width = (rec.Right - rec.Left)
Height = (rec.Bottom - rec.Top)
```
Change it to
```
If Sprite < 1 Or Sprite > NumCharacters Then Exit Sub
X = ConvertMapIsoX(x2, y2)
Y = ConvertMapIsoY(y2, x2)
Width = (rec.Right - rec.Left)
Height = (rec.Bottom - rec.Top)
```

***

Find
```
For X = 0 To ((Map.MaxX * 32) / 256) + 1
For Y = 0 To ((Map.MaxY * 32) / 256) + 1
RenderTexture Tex_Fog(fogNum), ConvertMapX((X * 256) + fogOffsetX), ConvertMapY((Y * 256) + fogOffsetY), 0, 0, 256, 256, 256, 256, color
```
Change it to
```
For X = 0 To ((Map.MaxX * PIC_X) / 256) + 1
For Y = 0 To ((Map.MaxY * PIC_Y) / 256) + 1
RenderTexture Tex_Fog(fogNum), ConvertMapIsoX((X * 256) + fogOffsetX, (Y * 256) + fogOffsetY), ConvertMapIsoY((Y * 256) + fogOffsetY, (X * 256) + fogOffsetX), 0, 0, 256, 256, 256, 256, color
```

***

Find
```
RenderTexture Tex_White, 0, 0, 0, 0, frmMain.ScaleWidth, frmMain.ScaleHeight, 32, 32, color
```
Change it to
```
RenderTexture Tex_White, ScreenX, ScreenY, 0, 0, ScreenWidth, ScreenHeight, 32, 32, color
```

***

Find
```
If itempic < 1 Or itempic > numitems Then Exit Sub
MaxFrames = (Tex_Item(itempic).Width * 0.5) / 32 ' Work out how many frames there are. /2 because of inventory icons as well as ingame

If MapItem(i).Frame < MaxFrames - 1 Then
MapItem(i).Frame = MapItem(i).Frame + 1
```
Change it to
```
MaxFrames = (Tex_Item(itempic).Width * 0.5) / SIZE_X ' Work out how many frames there are. /2 because of inventory icons as well as ingame

If MapItem(I).Frame < MaxFrames - 1 Then
MapItem(I).Frame = MapItem(I).Frame + 1
```

***

Find
```
If itempic > 0 And itempic <= numitems Then
If Tex_Item(itempic).Width > 64 Then
MaxFrames = (Tex_Item(itempic).Width * 0.5) / 32 ' Work out how many frames there are. /2 because of inventory icons as well as ingame

If InvItemFrame(i) < MaxFrames - 1 Then
InvItemFrame(i) = InvItemFrame(i) + 1
Else
InvItemFrame(i) = 1
End If

With rec
.Top = 0
.Bottom = 32
.Left = (Tex_Item(itempic).Width * 0.5) + (InvItemFrame(i) * 32) ' middle to get the start of inv gfx, then +32 for each frame
.Right = .Left + 32
End With

With rec_pos
.Top = InvTop + ((InvOffsetY + 32) * ((i - 1) \ InvColumns))
.Bottom = .Top + PIC_Y
.Left = InvLeft + ((InvOffsetX + 32) * (((i - 1) Mod InvColumns)))
.Right = .Left + PIC_X
End With

' We'll now re-Draw the item, and place the currency value over it again 😛
```
Change it to
```
If itempic > 0 And itempic <= numitems Then
If Tex_Item(itempic).Width > 64 Then
MaxFrames = (Tex_Item(itempic).Width * 0.5) / SIZE_X ' Work out how many frames there are. /2 because of inventory icons as well as ingame

If InvItemFrame(I) < MaxFrames - 1 Then
InvItemFrame(I) = InvItemFrame(I) + 1
Else
InvItemFrame(i) = 1
End If

With rec
.Top = 0
.Bottom = SIZE_Y
.Left = (Tex_Item(itempic).Width * 0.5) + (InvItemFrame(I) * SIZE_X) ' middle to get the start of inv gfx, then +32 for each frame
.Right = .Left + SIZE_X
End With

With rec_pos
.Top = InvTop + ((InvOffsetY + SIZE_Y) * ((I - 1) \ InvColumns))
.Bottom = .Top + SIZE_Y
.Left = InvLeft + ((InvOffsetX + SIZE_X) * (((I - 1) Mod InvColumns)))
.Right = .Left + SIZE_X
End With

' We'll now re-Draw the item, and place the currency value over it again 😛
```

***

Find
```
With rec
.Top = 0
.Bottom = 32
.Left = 32
.Right = 64
End With

With rec_pos
.Top = InvTop + ((InvOffsetY + 32) * ((i - 1) \ InvColumns))
.Bottom = .Top + PIC_Y
.Left = InvLeft + ((InvOffsetX + 32) * (((i - 1) Mod InvColumns)))
.Right = .Left + PIC_X
End With

RenderTextureByRects Tex_Item(itempic), rec, rec_pos, GuiTrans
```
Change it to
```
With rec
.Top = 0
.Bottom = SIZE_Y
.Left = SIZE_X
.Right = SIZE_X * 2
End With

With rec_pos
.Top = InvTop + ((InvOffsetY + SIZE_Y) * ((I - 1) \ InvColumns))
.Bottom = .Top + SIZE_Y
.Left = InvLeft + ((InvOffsetX + SIZE_X) * (((I - 1) Mod InvColumns)))
.Right = .Left + SIZE_X
End With

RenderTextureByRects Tex_Item(itempic), rec, rec_pos, GuiTrans
```

***

Find
```
If itempic > 0 And itempic <= numitems Then
With rec
.Top = 0
.Bottom = 32
.Left = 32
.Right = 64
End With

With rec_pos
.Top = GUI(GUI_TRADE).Y + TrdTop + ((TrdOffsetY + 32) * ((i - 1) \ TrdColumns))
.Bottom = .Top + PIC_Y
.Left = GUI(GUI_TRADE).X + TrdLeft + ((TrdOffsetX + 32) * (((i - 1) Mod TrdColumns)))
.Right = .Left + PIC_X
End With

RenderTextureByRects Tex_Item(itempic), rec, rec_pos, GuiTrans
```
Change it to
```
If itempic > 0 And itempic <= numitems Then
With rec
.Top = 0
.Bottom = SIZE_Y
.Left = SIZE_X
.Right = SIZE_X * 2
End With

With rec_pos
.Top = GUI(GUI_TRADE).Y + TrdTop + ((TrdOffsetY + SIZE_Y) * ((I - 1) \ TrdColumns))
.Bottom = .Top + SIZE_Y
.Left = GUI(GUI_TRADE).X + TrdLeft + ((TrdOffsetX + SIZE_X) * (((I - 1) Mod TrdColumns)))
.Right = .Left + SIZE_X
End With

RenderTextureByRects Tex_Item(itempic), rec, rec_pos, GuiTrans
```

***

Find
```
If itempic > 0 And itempic <= numitems Then
With rec
.Top = 0
.Bottom = 32
.Left = 32
.Right = 64
End With

With rec_pos
.Top = GUI(GUI_TRADE).Y + TrdTop + ((TrdOffsetY + 32) * ((i - 1) \ TrdColumns))
.Bottom = .Top + PIC_Y
.Left = GUI(GUI_TRADE).X + (GUI(GUI_TRADE).Width * 0.5) - 6 + TrdLeft + ((TrdOffsetX + 32) * (((i - 1) Mod TrdColumns)))
.Right = .Left + PIC_X
End With

RenderTextureByRects Tex_Item(itempic), rec, rec_pos, GuiTrans
```
Change it to
```
If itempic > 0 And itempic <= numitems Then
With rec
.Top = 0
.Bottom = SIZE_Y
.Left = SIZE_X
.Right = SIZE_X * 2
End With

With rec_pos
.Top = GUI(GUI_TRADE).Y + TrdTop + ((TrdOffsetY + SIZE_Y) * ((I - 1) \ TrdColumns))
.Bottom = .Top + SIZE_Y
.Left = GUI(GUI_TRADE).X + (GUI(GUI_TRADE).Width * 0.5) - 6 + TrdLeft + ((TrdOffsetX + SIZE_X) * (((I - 1) Mod TrdColumns)))
.Right = .Left + SIZE_X
End With

RenderTextureByRects Tex_Item(itempic), rec, rec_pos, GuiTrans
```

***

Find
```
With rec
.Top = 0
.Bottom = 32
.Left = 0
.Right = 32
End With

If Not SpellCD(i) = 0 Then
rec.Left = 32
rec.Right = 64
End If

With rec_pos
.Top = SpellTop + ((SpellOffsetY + 32) * ((i - 1) \ SpellColumns)) + GUI(GUI_SKILLS).Y
.Bottom = .Top + PIC_Y
.Left = SpellLeft + ((SpellOffsetX + 32) * (((i - 1) Mod SpellColumns))) + GUI(GUI_SKILLS).X
.Right = .Left + PIC_X
End With

RenderTextureByRects Tex_SpellIcon(SpellIcon), rec, rec_pos, GuiTrans
```
Change it to
```
With rec
.Top = 0
.Bottom = SIZE_Y
.Left = 0
.Right = SIZE_X
End With

If Not SpellCD(I) = 0 Then
rec.Left = SIZE_X
rec.Right = SIZE_X * 2
End If

With rec_pos
.Top = SpellTop + ((SpellOffsetY + SIZE_Y) * ((I - 1) \ SpellColumns)) + GUI(GUI_SKILLS).Y
.Bottom = .Top + SIZE_Y
.Left = SpellLeft + ((SpellOffsetX + SIZE_X) * (((I - 1) Mod SpellColumns))) + GUI(GUI_SKILLS).X
.Right = .Left + SIZE_X
End With

RenderTextureByRects Tex_SpellIcon(SpellIcon), rec, rec_pos, GuiTrans
```

***

Find
```
With rec
.Top = 0
.Bottom = 32
.Left = 0
.Right = 32
End With

With rec_pos
.Top = GUI(GUI_SHOP).Y + ShopTop + ((ShopOffsetY + 32) * ((i - 1) \ ShopColumns))
.Bottom = .Top + PIC_Y
.Left = GUI(GUI_SHOP).X + ShopLeft + ((ShopOffsetX + 32) * (((i - 1) Mod ShopColumns)))
.Right = .Left + PIC_X
End With

RenderTextureByRects Tex_Item(itempic), rec, rec_pos, GuiTrans
```
Change it to
```
With rec
.Top = 0
.Bottom = SIZE_Y
.Left = 0
.Right = SIZE_X
End With

With rec_pos
.Top = GUI(GUI_SHOP).Y + ShopTop + ((ShopOffsetY + SIZE_Y) * ((I - 1) \ ShopColumns))
.Bottom = .Top + SIZE_Y
.Left = GUI(GUI_SHOP).X + ShopLeft + ((ShopOffsetX + SIZE_X) * (((I - 1) Mod ShopColumns)))
.Right = .Left + SIZE_X
End With

RenderTextureByRects Tex_Item(itempic), rec, rec_pos, GuiTrans
```

***

Find
```
With rec
.Top = 0
.Bottom = 32
.Left = 0
.Right = 32
End With

With rec_pos
.Top = InvTop + ((InvOffsetY + 32) * ((i - 1) \ InvColumns)) + GUI(GUI_INVENTORY).Y
.Bottom = .Top + PIC_Y
.Left = InvLeft + ((InvOffsetX + 32) * (((i - 1) Mod InvColumns))) + GUI(GUI_SKILLS).X
.Right = .Left + PIC_X
End With

If UsedIngredients(i) = True Then RenderTexture Tex_GUI(GUI_DRAGBOX), rec_pos.Left, rec_pos.Top, 0, 0, PIC_X, PIC_Y, PIC_X + 4, PIC_Y + 4, D3DColorRGBA(255, 255, 255, GuiTrans * 0.25)
```
Change it to
```
With rec
.Top = 0
.Bottom = SIZE_Y
.Left = 0
.Right = SIZE_X
End With

With rec_pos
.Top = InvTop + ((InvOffsetY + SIZE_Y) * ((I - 1) \ InvColumns)) + GUI(GUI_INVENTORY).Y
.Bottom = .Top + SIZE_Y
.Left = InvLeft + ((InvOffsetX + SIZE_X) * (((I - 1) Mod InvColumns))) + GUI(GUI_SKILLS).X
.Right = .Left + SIZE_X
End With

If UsedIngredients(i) = True Then RenderTexture Tex_GUI(GUI_DRAGBOX), rec_pos.Left, rec_pos.Top, 0, 0, PIC_X, PIC_Y, PIC_X + 4, PIC_Y + 4, D3DColorRGBA(255, 255, 255, GuiTrans * 0.25)
```

***

Find
```
With destRect
.x1 = (EditorTileX * 32) - sRect.Left
.x2 = (EditorTileWidth * 32) + .x1
.y1 = (EditorTileY * 32) - sRect.Top
.y2 = (EditorTileHeight * 32) + .y1
End With

DrawSelectionBox destRect
```
Change it to
```
With destRect
.x1 = (EditorTileX * PIC_X) - sRect.Left
.x2 = (EditorTileWidth * PIC_X) + .x1
.y1 = (EditorTileY * PIC_Y) - sRect.Top
.y2 = (EditorTileHeight * PIC_Y) + .y1
End With

DrawSelectionBox destRect
```

***

Find
```
If frmDev.optBlock.value Then Exit Sub

With rec
.Top = 0
.Bottom = .Top + PIC_Y
.Left = 0
.Right = .Left + PIC_X
End With

RenderTexture Tex_Misc, ConvertMapX(CurX * PIC_X), ConvertMapY(CurY * PIC_Y), rec.Left, rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, D3DColorRGBA(255, 255, 255, 255)
```
Change it to
```
If frmDev.optBlock.value Then Exit Sub

With drec
.Top = ConvertMapIsoY(CurY * PIC_Y, CurX * PIC_X)
.Bottom = .Top + PIC_Y
.Left = ConvertMapIsoX(CurX * PIC_X, CurY * PIC_Y)
.Right = .Left + PIC_X
End With

With srec
.Top = 0
.Bottom = .Top + SIZE_Y
.Left = 0
.Right = .Left + SIZE_X
End With

RenderTextureByRects Tex_Misc, srec, drec, 255
```

***

Find
```
' blit lower tiles
If NumTileSets > 0 Then
For X = TileView.Left To TileView.Right
For Y = TileView.Top To TileView.Bottom
If IsValidMapPoint(X, Y) Then
Call DrawMapTile(X, Y)
End If
Next
Next
End If
```
Change it to
```
' blit lower tiles
If NumTileSets > 0 Then
For indLayer = MapLayer.Ground To MapLayer.Mask5
For X = TileView.Left To TileView.Right
For Y = TileView.Top To TileView.Bottom
If IsValidMapPoint(X, Y) Then
Call DrawMapTile(X, Y, indLayer)
End If
Next
Next
Next
End If
```

***

Find
```
' blit out upper tiles
If NumTileSets > 0 Then
For X = TileView.Left To TileView.Right
For Y = TileView.Top To TileView.Bottom
If IsValidMapPoint(X, Y) Then
Call DrawMapFringeTile(X, Y)
End If
Next
Next
End If
```
Change it to
```
' blit out upper tiles
If NumTileSets > 0 Then
For indLayer = MapLayer.Fringe To MapLayer.Fringe5
For X = TileView.Left To TileView.Right
For Y = TileView.Top To TileView.Bottom
If IsValidMapPoint(X, Y) Then
Call DrawMapFringeTile(X, Y, indLayer)
End If
Next
Next
Next
End If
```

***

Find
```
' Draw the target icon
If myTarget > 0 Then
If myTargetType = TARGET_TYPE_PLAYER Then
DrawTarget (Player(myTarget).X * 32) + Player(myTarget).xOffset, (Player(myTarget).Y * 32) + Player(myTarget).yOffset
ElseIf myTargetType = TARGET_TYPE_NPC Then
DrawTarget (MapNpc(myTarget).X * 32) + MapNpc(myTarget).xOffset, (MapNpc(myTarget).Y * 32) + MapNpc(myTarget).yOffset
End If
End If
```
Change it to
```
' Draw the target icon
If myTarget > 0 Then
If myTargetType = TARGET_TYPE_PLAYER Then
DrawTarget (Player(myTarget).X * PIC_X) + Player(myTarget).xOffset, (Player(myTarget).Y * PIC_Y) + Player(myTarget).yOffset
ElseIf myTargetType = TARGET_TYPE_NPC Then
DrawTarget (MapNpc(myTarget).X * PIC_X) + MapNpc(myTarget).xOffset, (MapNpc(myTarget).Y * PIC_Y) + MapNpc(myTarget).yOffset
End If
End If
```

***

Find
```
DrawHover TARGET_TYPE_PLAYER, i, (Player(i).X * 32) + Player(i).xOffset, (Player(i).Y * 32) + Player(i).yOffset
```
Change it to
```
DrawHover TARGET_TYPE_PLAYER, I, (Player(I).X * PIC_X) + Player(I).xOffset, (Player(I).Y * PIC_Y) + Player(I).yOffset
```

***

Find
```
If myTargetType = TARGET_TYPE_NPC And myTarget = i Then
' dont render lol
Else
DrawHover TARGET_TYPE_NPC, i, (MapNpc(i).X * 32) + MapNpc(i).xOffset, (MapNpc(i).Y * 32) + MapNpc(i).yOffset
End If
End If
End If
Next

If DrawThunder > 0 Then RenderTexture Tex_White, 0, 0, 0, 0, frmMain.ScaleWidth, frmMain.ScaleHeight, 32, 32, D3DColorRGBA(255, 255, 255, 160): DrawThunder = DrawThunder - 1

' rec_pos
With rec_pos
.Bottom = screenY
.Right = screenX
End With

With srcRect
.x1 = 0
.x2 = (MAX_MAPX + 1) * PIC_X ' frmMain.ScaleWidth
.y1 = 0
.y2 = (MAX_MAPY + 1) * PIC_Y ' frmMain.ScaleHeight
End With

With destRect
.x1 = 0
.x2 = .x1 + screenX
.y1 = 0
.y2 = .y1 + screenY
End With
```
Change it to
```
If myTargetType = TARGET_TYPE_NPC And myTarget = i Then
' dont render lol
Else
DrawHover TARGET_TYPE_NPC, I, (MapNpc(I).X * PIC_X) + MapNpc(I).xOffset, (MapNpc(I).Y * PIC_Y) + MapNpc(I).yOffset
End If
End If
End If
Next

If DrawThunder > 0 Then RenderTexture Tex_White, ScreenX, ScreenY, 0, 0, ScreenWidth, ScreenHeight, PIC_X, PIC_Y, D3DColorRGBA(255, 255, 255, 160): DrawThunder = DrawThunder - 1

' rec_pos
With rec_pos
.Bottom = WindowHeight
.Right = WindowWidth
End With

With srcRect
.x1 = 0
.x2 = WindowWidth
.y1 = 0
.y2 = WindowHeight
End With

With destRect
.x1 = 0
.x2 = WindowWidth
.y1 = 0
.y2 = WindowHeight
End With
```

***

Find
```
If FadeAmount > 0 Then RenderTexture Tex_Fade, 0, 0, 0, 0, screenX, screenY, 32, 32, D3DColorRGBA(255, 255, 255, FadeAmount)
If FlashTimer > GetTick Then RenderTexture Tex_White, 0, 0, 0, 0, screenX, screenY, 32, 32, -1
```
Change it to
```
If FadeAmount > 0 Then RenderTexture Tex_Fade, ScreenX, ScreenY, 0, 0, ScreenWidth, ScreenHeight, SIZE_X, SIZE_Y, D3DColorRGBA(255, 255, 255, FadeAmount)
If FlashTimer > GetTick Then RenderTexture Tex_White, ScreenX, ScreenY, 0, 0, ScreenWidth, ScreenHeight, SIZE_X, SIZE_Y, -1
```

***

Find
```
Direct3D_Window.BackBufferWidth = frmMain.ScaleWidth 'Match the backbuffer width with the display width
Direct3D_Window.BackBufferHeight = frmMain.ScaleHeight 'Match the backbuffer height with the display height
```
Change it to
```
Direct3D_Window.BackBufferWidth = WindowWidth 'Match the backbuffer width with the display width
Direct3D_Window.BackBufferHeight = WindowHeight 'Match the backbuffer height with the display height
```

***

Find
```
Public Sub UpdateCamera()
Dim offsetX As Long
Dim offsetY As Long
Dim StartX As Long
Dim StartY As Long
Dim EndX As Long
Dim EndY As Long

' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo ErrorHandler
If MyIndex = 0 Then Exit Sub

offsetX = 0 ' Player(MyIndex).xOffset + PIC_X
offsetY = 0 ' Player(MyIndex).yOffset + PIC_Y

StartX = GetPlayerX(MyIndex) - StartXValue
StartY = GetPlayerY(MyIndex) - StartYValue
If Player(MyIndex).Dir = DIR_RIGHT Then StartX = StartX - 1
If Player(MyIndex).Dir = DIR_DOWN Then StartY = StartY - 1
If Player(MyIndex).Dir = DIR_LEFT Then
offsetX = offsetX
End If

If StartX >= 0 Then
If StartX + MAX_MAPX < Map.MaxX Then
If Player(MyIndex).Dir = DIR_LEFT Then
offsetX = Player(MyIndex).xOffset
ElseIf Player(MyIndex).Dir = DIR_RIGHT Then
offsetX = PIC_X + Player(MyIndex).xOffset
End If
End If
End If
If StartY >= 0 Then
If StartY + MAX_MAPY < Map.MaxY Then
If Player(MyIndex).Dir = DIR_UP Then
offsetY = Player(MyIndex).yOffset
ElseIf Player(MyIndex).Dir = DIR_DOWN Then
offsetY = PIC_Y + Player(MyIndex).yOffset
End If
End If
End If

If StartX < 0 Then StartX = 0
If StartY < 0 Then StartY = 0

If MAX_MAPX >= Map.MaxX Then StartX = (Map.MaxX * 0.5) - (MAX_MAPX * 0.5)
If MAX_MAPY >= Map.MaxY Then StartY = (Map.MaxY * 0.5) - (MAX_MAPY * 0.5)

EndX = StartX + MAX_MAPX
EndY = StartY + MAX_MAPY

If MAX_MAPX < Map.MaxX Then
If EndX > Map.MaxX Then StartX = Map.MaxX - MAX_MAPX: EndX = StartX + MAX_MAPX
End If
If MAX_MAPY < Map.MaxY Then
If EndY > Map.MaxY Then StartY = Map.MaxY - MAX_MAPY: EndY = StartY + MAX_MAPY
End If

With TileView
.Top = StartY
.Bottom = EndY + 2
.Left = StartX
.Right = EndX + 2
End With

With Camera
.Top = offsetY
.Bottom = .Top + screenY
.Left = offsetX
.Right = .Left + screenX
End With

UpdateDrawMapName

' Error handler
Exit Sub
ErrorHandler:
HandleError "UpdateCamera", "modGraphics", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
```
Change it to
```
Public Sub UpdateCamera()
Dim startX As Long
Dim startY As Long
Dim EndX As Long
Dim EndY As Long

Dim X As Long, Y As Long
X = GetPlayerX(MyIndex)
Y = GetPlayerY(MyIndex)

startX = (X - MAX_MAPX) ' (X - (StartXValue * 2))
startY = (Y - MAX_MAPY) ' (Y - (StartYValue * 2))
If Player(MyIndex).Dir = DIR_RIGHT Then startX = startX - 1
If Player(MyIndex).Dir = DIR_DOWN Then startY = startY - 1

If startX < 0 Then startX = 0
If startY < 0 Then startY = 0

If MAX_MAPX >= Map.MaxX Then startX = (Map.MaxX * 0.5) - (MAX_MAPX * 0.5)
If MAX_MAPY >= Map.MaxY Then startY = (Map.MaxY * 0.5) - (MAX_MAPY * 0.5)

EndX = (X + MAX_MAPX) ' (X + (StartXValue * 2))
EndY = (Y + MAX_MAPY) ' (Y + (StartYValue * 2))

With TileView
.Top = startY
.Bottom = EndY + 2
.Left = startX
.Right = EndX + 2
End With

Dim offsetX As Long, offsetY As Long

With Player(MyIndex)
offsetX = ((X * PIC_X) - HalfX) + .xOffset
offsetY = ((Y * PIC_Y) - HalfY) + .yOffset
End With

' Convert Cartesian Offset to Isometric
Dim tmpOffsetX As Long, tmpOffsetY As Long
tmpOffsetX = offsetX - (offsetY * 2)
tmpOffsetY = offsetY + (offsetX * 0.5)

offsetX = tmpOffsetX * 0.5
offsetY = tmpOffsetY * 0.5

With Camera
.Top = offsetY
.Bottom = .Top + ScreenHeight
.Left = offsetX
.Right = .Left + ScreenWidth
End With

UpdateDrawMapName

' Error handler
Exit Sub
ErrorHandler:
HandleError "UpdateCamera", "modGraphics", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
```

***

Remove
```
Public Function ConvertMapX(ByVal X As Long) As Long
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo ErrorHandler

ConvertMapX = X - (TileView.Left * PIC_X) - Camera.Left
' Error handler
Exit Function
ErrorHandler:
HandleError "ConvertMapX", "modGraphics", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Function
End Function

Public Function ConvertMapY(ByVal Y As Long) As Long
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo ErrorHandler

ConvertMapY = Y - (TileView.Top * PIC_Y) - Camera.Top

' Error handler
Exit Function
ErrorHandler:
HandleError "ConvertMapY", "modGraphics", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Function
End Function
```

***

Find
```
With dRect
.Top = GUI(GUI_BANK).Y + BankTop + ((BankOffsetY + 32) * ((i - 1) \ BankColumns))
.Bottom = .Top + PIC_Y
.Left = GUI(GUI_BANK).X + BankLeft + ((BankOffsetX + 32) * (((i - 1) Mod BankColumns)))
.Right = .Left + PIC_X
End With

RenderTextureByRects Tex_Item(Sprite), sRect, dRect, GuiTrans
```
Change it to
```
With dRect
.Top = GUI(GUI_BANK).Y + BankTop + ((BankOffsetY + SIZE_Y) * ((I - 1) \ BankColumns))
.Bottom = .Top + SIZE_Y
.Left = GUI(GUI_BANK).X + BankLeft + ((BankOffsetX + SIZE_X) * (((I - 1) Mod BankColumns)))
.Right = .Left + SIZE_X
End With

RenderTextureByRects Tex_Item(Sprite), sRect, dRect, GuiTrans
```

***

**NOTE:** For the events, I'm not entirely sure which variable to use in all the cases (some things need PIC_X/Y and some need SIZE_X/Y). I didn't test the events, I just looked at the code and guessed which variable to switch in at 2am, so don't be surprised if some of the variables need to be swapped.

Find
```
For i = 1 To Map.EventCount
If Map.Events(i).pageCount <= 0 Then
sRect.Top = 0
sRect.Bottom = 32
sRect.Left = 0
sRect.Right = 32
RenderTexture Tex_Selection, ConvertMapX(X), ConvertMapY(Y), sRect.Left, sRect.Right, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
GoTo nextevent
End If

Width = 32
Height = 32

X = Map.Events(i).X * 32
Y = Map.Events(i).Y * 32
X = ConvertMapX(X)
Y = ConvertMapY(Y)
```
Change it to
```
For i = 1 To Map.EventCount
If Map.Events(i).pageCount <= 0 Then
sRect.Top = 0
sRect.Bottom = SIZE_Y
sRect.Left = 0
sRect.Right = SIZE_X
RenderTexture Tex_Selection, ConvertMapIsoX(X, Y), ConvertMapIsoY(Y, X), sRect.Left, sRect.Right, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
GoTo nextevent
End If
Width = PIC_X
Height = PIC_Y

Dim tmpX As Long, tmpY As Long
tmpX = Map.Events(I).X * PIC_X
tmpY = Map.Events(I).Y * PIC_Y
X = ConvertMapIsoX(tmpX, tmpY)
Y = ConvertMapIsoY(tmpY, tmpX)
```

***

Find
```
Select Case Map.Events(i).Pages(1).GraphicType
Case 0
sRect.Top = 0
sRect.Bottom = 32
sRect.Left = 0
sRect.Right = 32
RenderTexture Tex_Selection, X, Y, sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
Case 1
If Map.Events(i).Pages(1).Graphic > 0 And Map.Events(i).Pages(1).Graphic <= NumCharacters Then

sRect.Top = (Map.Events(i).Pages(1).GraphicY * (Tex_Character(Map.Events(i).Pages(1).Graphic).Height / 4))
sRect.Left = (Map.Events(i).Pages(1).GraphicX * (Tex_Character(Map.Events(i).Pages(1).Graphic).Width / 4))
sRect.Bottom = sRect.Top + 32
sRect.Right = sRect.Left + 32
RenderTexture Tex_Character(Map.Events(i).Pages(1).Graphic), X, Y, sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)

sRect.Top = 0
sRect.Bottom = 32
sRect.Left = 0
sRect.Right = 32
RenderTexture Tex_Selection, X, Y, sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
Else
sRect.Top = 0
sRect.Bottom = 32
sRect.Left = 0
sRect.Right = 32
RenderTexture Tex_Selection, X, Y, sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
End If
Case 2
If Map.Events(i).Pages(1).Graphic > 0 And Map.Events(i).Pages(1).Graphic < NumTileSets Then
sRect.Top = Map.Events(i).Pages(1).GraphicY * 32
sRect.Left = Map.Events(i).Pages(1).GraphicX * 32
sRect.Bottom = sRect.Top + 32
sRect.Right = sRect.Left + 32
RenderTexture Tex_Tileset(Map.Events(i).Pages(1).Graphic), X, Y, sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)

sRect.Top = 0
sRect.Bottom = 32
sRect.Left = 0
sRect.Right = 32
RenderTexture Tex_Selection, X, Y, sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
Else
sRect.Top = 0
sRect.Bottom = 32
sRect.Left = 0
sRect.Right = 32
RenderTexture Tex_Selection, X, Y, sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
End If
End Select
```
Change it to
```
Select Case Map.Events(i).Pages(1).GraphicType
Case 0
sRect.Top = 0
sRect.Bottom = SIZE_Y
sRect.Left = 0
sRect.Right = SIZE_X
RenderTexture Tex_Selection, X, Y, sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
Case 1
If Map.Events(i).Pages(1).Graphic > 0 And Map.Events(i).Pages(1).Graphic <= NumCharacters Then

sRect.Top = (Map.Events(I).Pages(1).GraphicY * (Tex_Character(Map.Events(I).Pages(1).Graphic).Height / 4))
sRect.Left = (Map.Events(I).Pages(1).GraphicX * (Tex_Character(Map.Events(I).Pages(1).Graphic).Width / 4))
sRect.Bottom = sRect.Top + SIZE_Y
sRect.Right = sRect.Left + SIZE_X
RenderTexture Tex_Character(Map.Events(I).Pages(1).Graphic), X, Y, sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)

sRect.Top = 0
sRect.Bottom = SIZE_Y
sRect.Left = 0
sRect.Right = SIZE_X
RenderTexture Tex_Selection, X, Y, sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
Else
sRect.Top = 0
sRect.Bottom = SIZE_Y
sRect.Left = 0
sRect.Right = SIZE_X
RenderTexture Tex_Selection, X, Y, sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
End If
Case 2
If Map.Events(I).Pages(1).Graphic > 0 And Map.Events(I).Pages(1).Graphic < NumTileSets Then
sRect.Top = Map.Events(I).Pages(1).GraphicY * 32
sRect.Left = Map.Events(I).Pages(1).GraphicX * 32
sRect.Bottom = sRect.Top + SIZE_Y
sRect.Right = sRect.Left + SIZE_X
RenderTexture Tex_Tileset(Map.Events(I).Pages(1).Graphic), X, Y, sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)

sRect.Top = 0
sRect.Bottom = SIZE_Y
sRect.Left = 0
sRect.Right = SIZE_X
RenderTexture Tex_Selection, X, Y, sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
Else
sRect.Top = 0
sRect.Bottom = SIZE_Y
sRect.Left = 0
sRect.Right = SIZE_X
RenderTexture Tex_Selection, X, Y, sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
End If
End Select
```

***

Find
```
With destRect
.x1 = (GraphicSelX * 32) - sRect.Left
.x2 = ((GraphicSelX2 - GraphicSelX) * 32) + .x1
.y1 = (GraphicSelY * 32) - sRect.Top
.y2 = ((GraphicSelY2 - GraphicSelY) * 32) + .y1
End With
End If
DrawSelectionBox destRect
```
Change it to
```
With destRect
.x1 = (GraphicSelX * SIZE_X) - sRect.Left
.x2 = ((GraphicSelX2 - GraphicSelX) * SIZE_X) + .x1
.y1 = (GraphicSelY * SIZE_Y) - sRect.Top
.y2 = ((GraphicSelY2 - GraphicSelY) * SIZE_Y) + .y1
End With
End If
DrawSelectionBox destRect
```

***

Find
```
RenderTextureByRects Tex_Tileset(frmEditor_Events.scrlGraphic.value), sRect, dRect, 255
If (GraphicSelX2 < GraphicSelX Or GraphicSelY2 < GraphicSelY) Or (GraphicSelX2 = 0 And GraphicSelY2 = 0) Then
With destRect
.x1 = (GraphicSelX * 32) - sRect.Left
.x2 = PIC_X + .x1
.y1 = (GraphicSelY * 32) - sRect.Top
.y2 = PIC_Y + .y1
End With

Else
With destRect
.x1 = (GraphicSelX * 32) - sRect.Left
.x2 = ((GraphicSelX2 - GraphicSelX) * 32) + .x1
.y1 = (GraphicSelY * 32) - sRect.Top
.y2 = ((GraphicSelY2 - GraphicSelY) * 32) + .y1
End With
End If
```
Change it to
```
RenderTextureByRects Tex_Tileset(frmEditor_Events.scrlGraphic.value), sRect, dRect, 255
If (GraphicSelX2 < GraphicSelX Or GraphicSelY2 < GraphicSelY) Or (GraphicSelX2 = 0 And GraphicSelY2 = 0) Then
With destRect
.x1 = (GraphicSelX * SIZE_X) - sRect.Left
.x2 = PIC_X + .x1
.y1 = (GraphicSelY * SIZE_Y) - sRect.Top
.y2 = PIC_Y + .y1
End With

Else
With destRect
.x1 = (GraphicSelX * SIZE_X) - sRect.Left
.x2 = ((GraphicSelX2 - GraphicSelX) * SIZE_X) + .x1
.y1 = (GraphicSelY * SIZE_Y) - sRect.Top
.y2 = ((GraphicSelY2 - GraphicSelY) * SIZE_Y) + .y1
End With
End If
```

***

Find
```
Case 2
If tmpEvent.Pages(curPageNum).Graphic > 0 And tmpEvent.Pages(curPageNum).Graphic <= NumTileSets Then
If tmpEvent.Pages(curPageNum).GraphicX2 = 0 Or tmpEvent.Pages(curPageNum).GraphicY2 = 0 Then
sRect.Top = tmpEvent.Pages(curPageNum).GraphicY * 32
sRect.Left = tmpEvent.Pages(curPageNum).GraphicX * 32
sRect.Bottom = sRect.Top + 32
sRect.Right = sRect.Left + 32
With dRect
dRect.Top = (193 * 0.5) - ((sRect.Bottom - sRect.Top) * 0.5)
dRect.Bottom = dRect.Top + (sRect.Bottom - sRect.Top)
```
Change it to
```
Case 2
If tmpEvent.Pages(curPageNum).Graphic > 0 And tmpEvent.Pages(curPageNum).Graphic <= NumTileSets Then
If tmpEvent.Pages(curPageNum).GraphicX2 = 0 Or tmpEvent.Pages(curPageNum).GraphicY2 = 0 Then
sRect.Top = tmpEvent.Pages(curPageNum).GraphicY * SIZE_Y
sRect.Left = tmpEvent.Pages(curPageNum).GraphicX * SIZE_X
sRect.Bottom = sRect.Top + SIZE_Y
sRect.Right = sRect.Left + SIZE_X
With dRect
dRect.Top = (193 * 0.5) - ((sRect.Bottom - sRect.Top) * 0.5)
dRect.Bottom = dRect.Top + (sRect.Bottom - sRect.Top)
```

***

Find
```
Direct3D_Device.Present destRect, destRect, frmEditor_Events.picGraphic.hwnd, ByVal (0)
Else
sRect.Top = tmpEvent.Pages(curPageNum).GraphicY * 32
sRect.Left = tmpEvent.Pages(curPageNum).GraphicX * 32
sRect.Bottom = sRect.Top + ((tmpEvent.Pages(curPageNum).GraphicY2 - tmpEvent.Pages(curPageNum).GraphicY) * 32)
sRect.Right = sRect.Left + ((tmpEvent.Pages(curPageNum).GraphicX2 - tmpEvent.Pages(curPageNum).GraphicX) * 32)
With dRect
dRect.Top = (193 * 0.5) - ((sRect.Bottom - sRect.Top) * 0.5)
dRect.Bottom = dRect.Top + (sRect.Bottom - sRect.Top)
```
Change it to
```
Direct3D_Device.Present destRect, destRect, frmEditor_Events.picGraphic.hwnd, ByVal (0)
Else
sRect.Top = tmpEvent.Pages(curPageNum).GraphicY * SIZE_Y
sRect.Left = tmpEvent.Pages(curPageNum).GraphicX * SIZE_X
sRect.Bottom = sRect.Top + ((tmpEvent.Pages(curPageNum).GraphicY2 - tmpEvent.Pages(curPageNum).GraphicY) * SIZE_Y)
sRect.Right = sRect.Left + ((tmpEvent.Pages(curPageNum).GraphicX2 - tmpEvent.Pages(curPageNum).GraphicX) * SIZE_X)
With dRect
dRect.Top = (193 * 0.5) - ((sRect.Bottom - sRect.Top) * 0.5)
dRect.Bottom = dRect.Top + (sRect.Bottom - sRect.Top)
```

***

Find
```
' Calculate the X
X = Map.MapEvents(id).X * PIC_X + Map.MapEvents(id).xOffset - ((Width - 32) * 0.5)

' Is the player's height more than 32..?
If (Height * 4) > 32 Then
' Create a 32 pixel offset for larger sprites
Y = Map.MapEvents(id).Y * PIC_Y + Map.MapEvents(id).yOffset - ((Height) - 32)
Else
' Proceed as normal
Y = Map.MapEvents(id).Y * PIC_Y + Map.MapEvents(id).yOffset
```
Change it to
```
' Calculate the X
X = Map.MapEvents(id).X * PIC_X + Map.MapEvents(id).xOffset - ((Width - SIZE_X) * 0.5)

' Is the player's height more than 32..?
If (Height * 4) > SIZE_Y Then
' Create a 32 pixel offset for larger sprites
Y = Map.MapEvents(id).Y * PIC_Y + Map.MapEvents(id).yOffset - ((Height) - SIZE_Y)
Else
' Proceed as normal
Y = Map.MapEvents(id).Y * PIC_Y + Map.MapEvents(id).yOffset
```

***

Find
```
If Map.MapEvents(id).GraphicY2 > 0 Or Map.MapEvents(id).GraphicX2 > 0 Then
With sRect
.Top = Map.MapEvents(id).GraphicY * 32
.Bottom = .Top + ((Map.MapEvents(id).GraphicY2 - Map.MapEvents(id).GraphicY) * 32)
.Left = Map.MapEvents(id).GraphicX * 32
.Right = .Left + ((Map.MapEvents(id).GraphicX2 - Map.MapEvents(id).GraphicX) * 32)
End With
Else
With sRect
.Top = Map.MapEvents(id).GraphicY * 32
.Bottom = .Top + 32
.Left = Map.MapEvents(id).GraphicX * 32
.Right = .Left + 32
End With
End If

X = Map.MapEvents(id).X * 32
Y = Map.MapEvents(id).Y * 32

X = X - ((sRect.Right - sRect.Left) * 0.5)
Y = Y - (sRect.Bottom - sRect.Top) + 32


If Map.MapEvents(id).GraphicY2 > 0 Then
RenderTexture Tex_Tileset(Map.MapEvents(id).GraphicNum), ConvertMapX(Map.MapEvents(id).X * 32), ConvertMapY((Map.MapEvents(id).Y - ((Map.MapEvents(id).GraphicY2 - Map.MapEvents(id).GraphicY) - 1)) * 32), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
Else
RenderTexture Tex_Tileset(Map.MapEvents(id).GraphicNum), ConvertMapX(Map.MapEvents(id).X * 32), ConvertMapY(Map.MapEvents(id).Y * 32), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
End If
End Select
End Sub
```
Change it to
```
If Map.MapEvents(id).GraphicY2 > 0 Or Map.MapEvents(id).GraphicX2 > 0 Then
With sRect
.Top = Map.MapEvents(id).GraphicY * SIZE_Y
.Bottom = .Top + ((Map.MapEvents(id).GraphicY2 - Map.MapEvents(id).GraphicY) * SIZE_Y)
.Left = Map.MapEvents(id).GraphicX * SIZE_X
.Right = .Left + ((Map.MapEvents(id).GraphicX2 - Map.MapEvents(id).GraphicX) * SIZE_X)
End With
Else
With sRect
.Top = Map.MapEvents(id).GraphicY * SIZE_Y
.Bottom = .Top + SIZE_Y
.Left = Map.MapEvents(id).GraphicX * SIZE_X
.Right = .Left + SIZE_X
End With
End If

X = Map.MapEvents(id).X * PIC_X
Y = Map.MapEvents(id).Y * PIC_Y

X = X - ((sRect.Right - sRect.Left) * 0.5)
Y = Y - (sRect.Bottom - sRect.Top) + PIC_Y

Dim tmpX As Long, tmpY As Long
If Map.MapEvents(id).GraphicY2 > 0 Then
tmpX = Map.MapEvents(id).X * PIC_X
tmpY = (Map.MapEvents(id).Y - ((Map.MapEvents(id).GraphicY2 - Map.MapEvents(id).GraphicY) - 1)) * PIC_Y
RenderTexture Tex_Tileset(Map.MapEvents(id).GraphicNum), ConvertMapIsoX(tmpX, tmpY), ConvertMapIsoY(tmpY, tmpX), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
Else
tmpX = Map.MapEvents(id).X * PIC_X
tmpY = Map.MapEvents(id).Y * PIC_Y
RenderTexture Tex_Tileset(Map.MapEvents(id).GraphicNum), ConvertMapIsoX(tmpX, tmpY), ConvertMapIsoY(tmpY, tmpX), sRect.Left, sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, sRect.Right - sRect.Left, sRect.Bottom - sRect.Top, D3DColorRGBA(255, 255, 255, 255)
End If
End Select
End Sub
```

***

Find
```
Dim btnEnabled() As Byte, btnCount As Byte
Dim guiScreenX As Long, guiScreenY As Long

If MAX_MAPX = 0 Then
guiScreenX = screenX
Else
guiScreenX = screenX * (((MAX_MAPX + 1) * PIC_X) / screenX)
End If
If MAX_MAPY = 0 Then
guiScreenY = screenY
Else
guiScreenY = screenY * (((MAX_MAPY + 1) * PIC_Y) / screenY)
End If

'Loading Interface.ini data
'Dim filename As String
```
Change it to
```
Dim btnEnabled() As Byte, btnCount As Byte
Dim guiScreenX As Long, guiScreenY As Long

guiScreenX = WindowWidth
guiScreenY = WindowHeight

'Loading Interface.ini data
'Dim filename As String
```

***

Find
```
' Inner tiles (Top right subtile region)
' NW - a
autoInner(1).X = 32
autoInner(1).Y = 0

' NE - b
autoInner(2).X = 48
autoInner(2).Y = 0

' SW - c
autoInner(3).X = 32
autoInner(3).Y = 16

' SE - d
autoInner(4).X = 48
autoInner(4).Y = 16

' Outer Tiles - NW (bottom subtile region)
' NW - e
autoNW(1).X = 0
autoNW(1).Y = 32

' NE - f
autoNW(2).X = 16
autoNW(2).Y = 32

' SW - g
autoNW(3).X = 0
autoNW(3).Y = 48

' SE - h
autoNW(4).X = 16
autoNW(4).Y = 48

' Outer Tiles - NE (bottom subtile region)
' NW - i
autoNE(1).X = 32
autoNE(1).Y = 32

' NE - g
autoNE(2).X = 48
autoNE(2).Y = 32

' SW - k
autoNE(3).X = 32
autoNE(3).Y = 48

' SE - l
autoNE(4).X = 48
autoNE(4).Y = 48

' Outer Tiles - SW (bottom subtile region)
' NW - m
autoSW(1).X = 0
autoSW(1).Y = 64

' NE - n
autoSW(2).X = 16
autoSW(2).Y = 64

' SW - o
autoSW(3).X = 0
autoSW(3).Y = 80

' SE - p
autoSW(4).X = 16
autoSW(4).Y = 80

' Outer Tiles - SE (bottom subtile region)
' NW - q
autoSE(1).X = 32
autoSE(1).Y = 64

' NE - r
autoSE(2).X = 48
autoSE(2).Y = 64

' SW - s
autoSE(3).X = 32
autoSE(3).Y = 80

' SE - t
autoSE(4).X = 48
autoSE(4).Y = 80
```
Change it to
```
' Inner tiles (Top right subtile region)
' NW - a
autoInner(1).X = PIC_X
autoInner(1).Y = 0

' NE - b
autoInner(2).X = PIC_X * 1.5 ' 48
autoInner(2).Y = 0

' SW - c
autoInner(3).X = PIC_X ' 32
autoInner(3).Y = PIC_Y * 0.5 ' 16

' SE - d
autoInner(4).X = PIC_X * 1.5 ' 48
autoInner(4).Y = PIC_Y * 0.5 ' 16

' Outer Tiles - NW (bottom subtile region)
' NW - e
autoNW(1).X = 0
autoNW(1).Y = PIC_Y ' 32

' NE - f
autoNW(2).X = PIC_X * 0.5 ' 16
autoNW(2).Y = PIC_Y ' 32

' SW - g
autoNW(3).X = 0
autoNW(3).Y = PIC_Y * 1.5 ' 48

' SE - h
autoNW(4).X = PIC_X * 0.5 ' 16
autoNW(4).Y = PIC_Y * 1.5 ' 48

' Outer Tiles - NE (bottom subtile region)
' NW - i
autoNE(1).X = PIC_X ' 32
autoNE(1).Y = PIC_Y ' 32

' NE - g
autoNE(2).X = PIC_X * 1.5 ' 48
autoNE(2).Y = PIC_Y ' 32

' SW - k
autoNE(3).X = PIC_X ' 32
autoNE(3).Y = PIC_Y * 1.5 ' 48

' SE - l
autoNE(4).X = PIC_X * 1.5 ' 48
autoNE(4).Y = PIC_Y * 1.5 ' 48

' Outer Tiles - SW (bottom subtile region)
' NW - m
autoSW(1).X = 0
autoSW(1).Y = PIC_Y * 2 ' 64

' NE - n
autoSW(2).X = PIC_X * 0.5 ' 16
autoSW(2).Y = PIC_Y * 2 ' 64

' SW - o
autoSW(3).X = 0
autoSW(3).Y = PIC_Y * 2.5 ' 80

' SE - p
autoSW(4).X = PIC_X * 0.5 ' 16
autoSW(4).Y = PIC_Y * 2.5 ' 80

' Outer Tiles - SE (bottom subtile region)
' NW - q
autoSE(1).X = PIC_X ' 32
autoSE(1).Y = PIC_Y * 2 ' 64

' NE - r
autoSE(2).X = PIC_X * 1.5 ' 48
autoSE(2).Y = PIC_Y * 2 ' 64

' SW - s
autoSE(3).X = PIC_X ' 32
autoSE(3).Y = PIC_Y * 2.5 ' 80

' SE - t
autoSE(4).X = PIC_X * 1.5 ' 48
autoSE(4).Y = PIC_Y * 2.5 ' 80
```

***

Find
```
Autotile(X, Y).Layer(layerNum).renderState = RENDER_STATE_AUTOTILE
' cache tileset positioning
For quarterNum = 1 To 4
Autotile(X, Y).Layer(layerNum).srcX(quarterNum) = (Map.Tile(X, Y).Layer(layerNum).X * 32) + Autotile(X, Y).Layer(layerNum).QuarterTile(quarterNum).X
Autotile(X, Y).Layer(layerNum).srcY(quarterNum) = (Map.Tile(X, Y).Layer(layerNum).Y * 32) + Autotile(X, Y).Layer(layerNum).QuarterTile(quarterNum).Y
Next
```
Change it to
```
Autotile(X, Y).Layer(layerNum).renderState = RENDER_STATE_AUTOTILE
' cache tileset positioning
For quarterNum = 1 To 4
Autotile(X, Y).layer(layerNum).srcX(quarterNum) = (Map.Tile(X, Y).layer(layerNum).X * PIC_X) + Autotile(X, Y).layer(layerNum).QuarterTile(quarterNum).X
Autotile(X, Y).layer(layerNum).srcY(quarterNum) = (Map.Tile(X, Y).layer(layerNum).Y * PIC_Y) + Autotile(X, Y).layer(layerNum).QuarterTile(quarterNum).Y
Next
```

***

Find
```
' calculate the offset
Select Case Map.Tile(X, Y).Autotile(layerNum)
Case AUTOTILE_WATERFALL
yOffset = (waterfallFrame - 1) * 32
Case AUTOTILE_ANIM
xOffset = autoTileFrame * 64
Case AUTOTILE_CLIFF
yOffset = -32
End Select

' Draw the quarter
'EngineRenderRectangle Tex_Tileset(Map.Tile(x, y).Layer(layerNum).Tileset), destX, destY, Autotile(x, y).Layer(layerNum).srcX(quarterNum) + xOffset, Autotile(x, y).Layer(layerNum).srcY(quarterNum) + yOffset, 16, 16, 16, 16, 16, 16
RenderTexture Tex_Tileset(Map.Tile(X, Y).Layer(layerNum).Tileset), destX, destY, Autotile(X, Y).Layer(layerNum).srcX(quarterNum) + xOffset, Autotile(X, Y).Layer(layerNum).srcY(quarterNum) + yOffset, 16, 16, 16, 16, -1
End Sub
```
Change it to
```
' calculate the offset
Select Case Map.Tile(X, Y).Autotile(layerNum)
Case AUTOTILE_WATERFALL
yOffset = (waterfallFrame - 1) * PIC_Y
Case AUTOTILE_ANIM
xOffset = autoTileFrame * PIC_X * 2
Case AUTOTILE_CLIFF
yOffset = PIC_Y * -1
End Select

' Draw the quarter
'EngineRenderRectangle Tex_Tileset(Map.Tile(x, y).Layer(layerNum).Tileset), destX, destY, Autotile(x, y).Layer(layerNum).srcX(quarterNum) + xOffset, Autotile(x, y).Layer(layerNum).srcY(quarterNum) + yOffset, 16, 16, 16, 16, 16, 16
RenderTexture Tex_Tileset(Map.Tile(X, Y).layer(layerNum).Tileset), destX, destY, Autotile(X, Y).layer(layerNum).srcX(quarterNum) + xOffset, Autotile(X, Y).layer(layerNum).srcY(quarterNum) + yOffset, PIC_X * 0.5, PIC_Y * 0.5, PIC_X * 0.5, PIC_Y * 0.5, -1
End Sub
```

***

Find
```
' Draw
color = D3DColorARGB(alpha, rcolor, gcolor, bcolor)

RenderTexture Tex_Lightmap, ConvertMapX(GetPlayerX(MyIndex) * 32) + Player(MyIndex).xOffset - (Tex_Lightmap.Width * 0.5) + (PIC_X * 0.5), ConvertMapY(GetPlayerY(MyIndex) * 32) + Player(MyIndex).yOffset - (Tex_Lightmap.Height * 0.5) - (PIC_Y * 0.5), 0, 0, Tex_Lightmap.Width, Tex_Lightmap.Height, Tex_Lightmap.Width, Tex_Lightmap.Height, color
```
Change it to
```
' Draw
color = D3DColorARGB(alpha, rcolor, gcolor, bcolor)

RenderTexture Tex_Lightmap, ConvertMapIsoX(GetPlayerX(MyIndex) * PIC_X, GetPlayerY(MyIndex) * PIC_Y) + Player(MyIndex).xOffset - (Tex_Lightmap.Width * 0.5) + (PIC_X * 0.5), ConvertMapIsoY(GetPlayerY(MyIndex) * PIC_Y, GetPlayerX(MyIndex) * PIC_X) + Player(MyIndex).yOffset - (Tex_Lightmap.Height * 0.5) - (PIC_Y * 0.5), 0, 0, Tex_Lightmap.Width, Tex_Lightmap.Height, Tex_Lightmap.Width, Tex_Lightmap.Height, color
End Sub
```

***
***

`modGameEditors`

Find
```
y2 = 0 ' starting tile for y axis
For Y = CurY To CurY + EditorTileHeight - 1
x2 = 0 ' re-set x count every y loop
For X = CurX To CurX + EditorTileWidth - 1
If X >= 0 And X <= Map.MaxX Then
If Y >= 0 And Y <= Map.MaxY Then
With Map.Tile(X, Y)
.Layer(CurLayer).X = EditorTileX + x2
.Layer(CurLayer).Y = EditorTileY + y2
.Layer(CurLayer).Tileset = frmDev.scrlTileSet.value
.Autotile(CurLayer) = 0
CacheRenderState X, Y, CurLayer
End With
End If
End If
x2 = x2 + 1
Next
y2 = y2 + 1
Next
```
Change it to
```
Dim tmpX As Long, tmpY As Long
Dim startTileX As Long, startTileY As Long
Dim TileX As Long, TileY As Long
startTileX = X: startTileY = Y
TileX = startTileX: TileY = startTileY

For tmpY = 0 To EditorTileHeight - 1
For tmpX = 0 To EditorTileWidth - 1
If TileX >= 0 And TileX <= Map.MaxX Then
If TileY >= 0 And TileY <= Map.MaxY Then
With Map.Tile(TileX, TileY)
.layer(CurLayer).X = EditorTileX + tmpX
.layer(CurLayer).Y = EditorTileY + tmpY
.layer(CurLayer).Tileset = frmDev.scrlTileSet.value
.Autotile(CurLayer) = 0
CacheRenderState TileX, TileY, CurLayer
End With
End If
End If
TileX = TileX + 1
TileY = TileY - 1
Next

startTileY = startTileY + 1
TileY = startTileY

startTileX = startTileX + 1
TileX = startTileX
Next
```

***

Find
```
tempX = PIC_X * 0.5
tempY = PIC_Y * 0.5
X = X Mod 32
Y = Y Mod 32
If X > tempX Then
If Y > tempY Then ' Quadrant 4
If (X - PIC_X) / (Y - PIC_Y) > (tempX - PIC_X) / (tempY - PIC_Y) Then ' 2
i = 2
Else ' 4
i = 4
End If
Else ' Quadrant 1
If (X - PIC_X) / Y < (tempX - PIC_X) / tempY Then ' 1
i = 1
Else ' 4
i = 4
End If
End If
Else
If Y > tempY Then ' Quadrant 3
If X / (Y - PIC_Y) > tempX / (tempY - PIC_Y) Then ' 3
i = 3
Else ' 2
i = 2
End If
Else ' Quadrant 2
X = X
Y = Y
If X / Y > tempX / tempY Then ' 1
i = 1
Else ' 3
i = 3
End If
End If
End If
```
Change it to
```
Dim tmpX As Long, tmpY As Long
tmpX = X - ConvertMapIsoX((CurX * PIC_X), (CurY * PIC_Y))
tmpY = Y - ConvertMapIsoY((CurY * PIC_Y), (CurX * PIC_X))

X = (tmpX Mod PIC_X)
Y = (tmpY Mod PIC_Y)

If X >= (PIC_X * 0.5) Then
If Y >= (PIC_Y * 0.5) Then ' Quadrant 4
I = 4
Else ' Quadrant 1
I = 1
End If
Else
If Y >= (PIC_Y * 0.5) Then ' Quadrant 3
I = 2
Else ' Quadrant 2
I = 3
End If
End If
```
This will allow you to click tiles to directionally block them

***

Find
```
If frmDev.optMapAttribute(15).value Then
If movedMouse Then Exit Sub
X = X - (CurX * 32)
Y = Y - (CurY * 32)
```
Change it to
```
If frmDev.optMapAttribute(15).value Then
If movedMouse Then Exit Sub
X = X - (CurX * PIC_X)
Y = Y - (CurY * PIC_Y)
```

***
***

`modGameLogic`

Find
```
Sub ProcessMovement(ByVal Index As Long)
Dim MovementSpeed As Long
```
Change it to
```
Dim MovementSpeedX As Long, MovementSpeedY As Long
```

***

Find
```
Select Case Player(Index).Moving
Case MOVING_WALKING
PlayerMovement(Index) = 1
MovementSpeed = ((ElapsedTime / 1000) * (WALK_SPEED * SIZE_X))
Case MOVING_RUNNING
PlayerMovement(Index) = 2
MovementSpeed = ((ElapsedTime / 1000) * ((WALK_SPEED + ((GetPlayerStat(Index, Agility) + (Player(Index).Level / 25)) ^ 0.4)) * SIZE_X))
Case Else
PlayerMovement(Index) = 0
Exit Sub
End Select
```
Change it to
```
Select Case Player(Index).Moving
Case MOVING_WALKING
PlayerMovement(Index) = 1
MovementSpeedX = ((ElapsedTime * 0.001) * (WALK_SPEED * PIC_X))
MovementSpeedY = ((ElapsedTime * 0.001) * (WALK_SPEED * PIC_Y))
Case MOVING_RUNNING
PlayerMovement(Index) = 2
MovementSpeedX = ((ElapsedTime * 0.001) * ((WALK_SPEED + ((GetPlayerStat(Index, Agility) + (Player(Index).Level * 0.04)) ^ 0.4)) * PIC_X))
MovementSpeedY = ((ElapsedTime * 0.001) * ((WALK_SPEED + ((GetPlayerStat(Index, Agility) + (Player(Index).Level * 0.04)) ^ 0.4)) * PIC_Y))
Case Else
PlayerMovement(Index) = 0
Exit Sub
End Select

If (MovementSpeedX Mod 2) = 1 Then
MovementSpeedX = MovementSpeedX - 1
End If
If (MovementSpeedY Mod 2) = 1 Then
MovementSpeedY = MovementSpeedY - 1
End If
```
Moving now uses two directions instead of one, and the bit at the bottom is to help prevent camera shaking

***

Find
```
Select Case GetPlayerDir(Index)
Case DIR_UP
Player(Index).yOffset = Player(Index).yOffset - MovementSpeed
If Player(Index).yOffset < 0 Then Player(Index).yOffset = 0
Case DIR_DOWN
Player(Index).yOffset = Player(Index).yOffset + MovementSpeed
If Player(Index).yOffset > 0 Then Player(Index).yOffset = 0
Case DIR_LEFT
Player(Index).xOffset = Player(Index).xOffset - MovementSpeed
If Player(Index).xOffset < 0 Then Player(Index).xOffset = 0
Case DIR_RIGHT
Player(Index).xOffset = Player(Index).xOffset + MovementSpeed
If Player(Index).xOffset > 0 Then Player(Index).xOffset = 0
End Select
```
Change it to
```
Select Case GetPlayerDir(Index)
Case DIR_UP
Player(Index).yOffset = Player(Index).yOffset - MovementSpeedY
If Player(Index).yOffset < 0 Then Player(Index).yOffset = 0
Case DIR_DOWN
Player(Index).yOffset = Player(Index).yOffset + MovementSpeedY
If Player(Index).yOffset > 0 Then Player(Index).yOffset = 0
Case DIR_LEFT
Player(Index).xOffset = Player(Index).xOffset - MovementSpeedX
If Player(Index).xOffset < 0 Then Player(Index).xOffset = 0
Case DIR_RIGHT
Player(Index).xOffset = Player(Index).xOffset + MovementSpeedX
If Player(Index).xOffset > 0 Then Player(Index).xOffset = 0
End Select
```

***

Find
```
DrawMapNameX = (frmMain.ScaleWidth - getWidth(Font_Default, Trim$(Map.Name))) * 0.5
```
Change it to
```
DrawMapNameX = (ScreenWidth - getWidth(Font_Default, Trim$(Map.Name))) * 0.5
```

***

Find
```
' check for off-screen
If Y + GUI(GUI_DESCRIPTION_SPELL).Height > frmMain.ScaleHeight Then
Y = frmMain.ScaleHeight - GUI(GUI_DESCRIPTION_SPELL).Height
End If
If X + GUI(GUI_DESCRIPTION_SPELL).Width > frmMain.ScaleWidth Then
X = frmMain.ScaleWidth - GUI(GUI_DESCRIPTION_SPELL).Width
End If
```
Change it to
```
' check for off-screen
If Y + GUI(GUI_DESCRIPTION_SPELL).Height > WindowHeight Then
Y = WindowHeight - GUI(GUI_DESCRIPTION_SPELL).Height
End If
If X + GUI(GUI_DESCRIPTION_SPELL).Width > WindowWidth Then
X = WindowWidth - GUI(GUI_DESCRIPTION_SPELL).Width
End If
```

***

Find
```
' check for off-screen
If Y + GUI(GUI_DESCRIPTION_ITEM).Height > frmMain.ScaleHeight Then
Y = frmMain.ScaleHeight - GUI(GUI_DESCRIPTION_ITEM).Height
End If
If X + GUI(GUI_DESCRIPTION_ITEM).Width > frmMain.ScaleWidth Then
X = frmMain.ScaleWidth - GUI(GUI_DESCRIPTION_ITEM).Width
End If
```
Change it to
```
' check for off-screen
If Y + GUI(GUI_DESCRIPTION_ITEM).Height > WindowHeight Then
Y = WindowHeight - GUI(GUI_DESCRIPTION_ITEM).Height
End If
If X + GUI(GUI_DESCRIPTION_ITEM).Width > WindowWidth Then
X = WindowWidth - GUI(GUI_DESCRIPTION_ITEM).Width
End If
```

***

Find
```
Left = GUI(GUI_HOTBAR).X + ((HotbarOffsetX + 32) * (((i - 1) Mod MAX_HOTBAR)))
```
Change it to
```
Left = GUI(GUI_HOTBAR).X + ((HotbarOffsetX + SIZE_X) * (((I - 1) Mod MAX_HOTBAR)))
```

***

Find
```
.Top = GUI(GUI_BANK).Y + BankTop + ((BankOffsetY + 32) * ((i - 1) \ BankColumns))
.Bottom = .Top + PIC_Y
.Left = GUI(GUI_BANK).X + BankLeft + ((BankOffsetX + 32) * (((i - 1) Mod BankColumns)))
.Right = .Left + PIC_X
```
Change it to
```
.Top = GUI(GUI_BANK).Y + BankTop + ((BankOffsetY + SIZE_Y) * ((I - 1) \ BankColumns))
.Bottom = .Top + SIZE_Y
.Left = GUI(GUI_BANK).X + BankLeft + ((BankOffsetX + SIZE_X) * (((I - 1) Mod BankColumns)))
.Right = .Left + SIZE_X
```

***

Find
```
- .Top = InvTop + ((InvOffsetY + 32) * ((i - 1) \ InvColumns)) + GUI(GUI_INVENTORY).Y
- .Bottom = .Top + PIC_Y
- .Left = InvLeft + ((InvOffsetX + 32) * (((i - 1) Mod InvColumns))) + GUI(GUI_SKILLS).X
- .Right = .Left + PIC_X
```
Change it to
```
.Top = InvTop + ((InvOffsetY + SIZE_Y) * ((I - 1) \ InvColumns)) + GUI(GUI_INVENTORY).Y
.Bottom = .Top + SIZE_Y
.Left = InvLeft + ((InvOffsetX + SIZE_X) * (((I - 1) Mod InvColumns))) + GUI(GUI_SKILLS).X
.Right = .Left + SIZE_X
```

***

Find
```
.Top = SpellTop + ((SpellOffsetY + 32) * ((i - 1) \ SpellColumns)) + GUI(GUI_SKILLS).Y
.Bottom = .Top + PIC_Y
.Left = SpellLeft + ((SpellOffsetX + 32) * (((i - 1) Mod SpellColumns))) + GUI(GUI_SKILLS).X
.Right = .Left + PIC_X
```
Change it to
```
.Top = SpellTop + ((SpellOffsetY + SIZE_Y) * ((I - 1) \ SpellColumns)) + GUI(GUI_SKILLS).Y
.Bottom = .Top + SIZE_Y
.Left = SpellLeft + ((SpellOffsetX + SIZE_X) * (((I - 1) Mod SpellColumns))) + GUI(GUI_SKILLS).X
.Right = .Left + SIZE_X
```

***

Find
```
WeatherParticle(numLayer, i).X = (TileView.Left * 32) - 32
WeatherParticle(numLayer, i).Y = (TileView.Top * 32) + Rand(-32, frmMain.ScaleHeight)
```
Change it to
```
WeatherParticle(numLayer, I).X = (TileView.Left * PIC_X) - PIC_X
WeatherParticle(numLayer, I).Y = (TileView.Top * PIC_Y) + Rand(PIC_Y * -1, ScreenHeight)
```

***

Find
```
WeatherParticle(numLayer, i).X = (TileView.Left * 32) + Rand(-32, frmMain.ScaleWidth)
WeatherParticle(numLayer, i).Y = (TileView.Top * 32) - 32
```
Change it to
```
WeatherParticle(numLayer, I).X = (TileView.Left * PIC_X) + Rand(PIC_X * -1, ScreenWidth)
WeatherParticle(numLayer, I).Y = (TileView.Top * PIC_Y) - PIC_Y
```

***

Find
```
For i = 1 To MAX_WEATHER_PARTICLES
If WeatherParticle(numLayer, i).InUse Then
If WeatherParticle(numLayer, i).X > TileView.Right * 32 Or WeatherParticle(numLayer, i).Y > TileView.Bottom * 32 Then
WeatherParticle(numLayer, i).InUse = False
```
Change it to
```
For I = 1 To MAX_WEATHER_PARTICLES
If WeatherParticle(numLayer, I).InUse Then
If WeatherParticle(numLayer, I).X > TileView.Right * PIC_X Or WeatherParticle(numLayer, I).Y > TileView.Bottom * PIC_Y Then
WeatherParticle(numLayer, I).InUse = False
```

***
***

`modGeneral`

Find
```
' set loading screen
loadGUI True
frmLoad.Visible = True
```
Add above it
```
' Set Screen Size
Call ResizeForm
```
This will set the form sizes before things are drawn so they don't cause errors

***

Find
```
' set values for directional blocking arrows
DirArrowX(1) = 12 ' up
DirArrowY(1) = 0
DirArrowX(2) = 12 ' down
DirArrowY(2) = 23
DirArrowX(3) = 0 ' left
DirArrowY(3) = 12
DirArrowX(4) = 23 ' right
DirArrowY(4) = 12
```
Change it to
```
' set values for directional blocking arrows
DirArrowX(1) = ((PIC_X - 😎 * 0.75) - 1 ' up
DirArrowY(1) = (PIC_Y * 0.25) + 1
DirArrowX(2) = ((PIC_X - 😎 * 0.25) + 1 ' down
DirArrowY(2) = ((PIC_Y - 😎 * 0.75) - 1
DirArrowX(3) = (PIC_X * 0.25) + 1 ' left
DirArrowY(3) = ((PIC_Y - 😎 * 0.25) + 1
DirArrowX(4) = ((PIC_X - 😎 * 0.75) - 1 ' right
DirArrowY(4) = ((PIC_Y - 😎 * 0.75) - 1
```
This will change where the directional blocking arrows are placed on the tiles

***

Find
```
Public Sub ResizeForm()
...
End Sub
```
Replace the whole sub with the following
```
Public Sub ResizeForm()
If Not frmMain.Visible Then Exit Sub ' Make sure Game is Visible
If frmMain.WindowState = 1 Then Exit Sub ' Check if Minimized

Dim bdrOffsetX As Long, bdrOffsetY As Long
bdrOffsetX = (GetSystemMetrics(SM_CXFRAME) * 2)
bdrOffsetY = GetSystemMetrics(SM_CYCAPTION) + (GetSystemMetrics(SM_CYFRAME) * 2)

' Set Window Size
WindowWidth = frmMain.ScaleWidth
WindowHeight = frmMain.ScaleHeight

' Set the Game Screen Size
ScreenX = 0
ScreenY = 0
ScreenWidth = WindowWidth - ScreenOffsetX
ScreenHeight = WindowHeight - ScreenOffsetY

ScreenHyp = Sqr((CCur(ScreenWidth) * CCur(ScreenWidth)) + (CCur(ScreenHeight) * CCur(ScreenHeight)))

' Set Map size
If screenStretch Then
MAX_MAPX = START_MAX_MAPX ' Set Map Size X
MAX_MAPY = START_MAX_MAPY ' Set Map Size Y
Else
MAX_MAPX = (ScreenHyp \ PIC_X) ' Get Map Size X
MAX_MAPY = (ScreenHyp \ PIC_Y) ' Get Map Size Y
End If

If Not ScreenStretchX = 0 Then
If MAX_MAPX > Max_MapX_Orig Then MAX_MAPX = (Max_MapX_Orig + ((MAX_MAPX - Max_MapX_Orig) * (ScreenStretchX / 100))) ' 100 is the modifier
End If
If Not ScreenStretchY = 0 Then
If MAX_MAPY > Max_MapY_Orig Then MAX_MAPY = (Max_MapY_Orig + ((MAX_MAPY - Max_MapY_Orig) * (ScreenStretchY / 100))) ' 100 is the modifier
End If

' Make sure Size is Big Enough
' If Screen is too Small then Resize it (Prevents Crashing)
If MAX_MAPY <= 0 Then
frmMain.Height = frmMain.Height + (PIC_Y * Screen.TwipsPerPixelY)
MAX_MAPY = 1
End If
If MAX_MAPX <= 0 Then
frmMain.Width = frmMain.Width + (PIC_X * Screen.TwipsPerPixelX)
MAX_MAPX = 1
End If

HalfX = ScreenWidth * 0.5 ' (MAX_MAPX * 0.5) * PIC_X
HalfY = ScreenHeight * 0.5 ' (MAX_MAPY * 0.5) * PIC_Y

StartXValue = MAX_MAPX * 0.5
StartYValue = MAX_MAPY * 0.5
EndXValue = (ScreenX / PIC_X) + 1
EndYValue = (ScreenY / PIC_Y) + 1

MAX_MAPX = MAX_MAPX - 1
MAX_MAPY = MAX_MAPY - 1

Direct3D_Window.BackBufferWidth = frmMain.ScaleWidth
Direct3D_Window.BackBufferHeight = frmMain.ScaleHeight

'Reset the device
Direct3D_Device.Reset Direct3D_Window

DirectX_ReInit

GuiLocation

UpdateCamera
End Sub
```
We have to change the resizing to use the hypotenuse for the visible map size since isometric uses that.

***

Add to the bottom of the file
```
' Isometric Formulas
Public Function ConvertMapIsoX(ByVal X As Long, ByVal Y As Long) As Long
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo ErrorHandler

' Isometric Changes
ConvertMapIsoX = ConvertToIsoX(X, Y) + ((ScreenWidth * 0.5) - Camera.Left + ScreenX)

' Error handler
Exit Function
ErrorHandler:
HandleError "ConvertMapIsoX", "modGraphics", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Function
End Function

Public Function ConvertMapIsoY(ByVal Y As Long, ByVal X As Long) As Long
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo ErrorHandler

' Isometric Changes
ConvertMapIsoY = ConvertToIsoY(X, Y) - Camera.Top + ScreenY

' Error handler
Exit Function
ErrorHandler:
HandleError "ConvertMapIsoY", "modGraphics", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Function
End Function

Public Function ConvertToIsoX(ByVal X As Long, ByVal Y As Long)
ConvertToIsoX = (Int(X * 0.5) - Y)
End Function

Public Function ConvertToIsoY(ByVal X As Long, ByVal Y As Long)
ConvertToIsoY = ((Int(X * 0.5) + Y) * 0.5)
End Function

Public Function ConvertMapOrthX(ByVal X As Long, ByVal Y As Long) As Long
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo ErrorHandler

' Isometric Changes
Dim cntOffset As Long
cntOffset = (ScreenWidth * 0.5) - Camera.Left + ScreenX
ConvertMapOrthX = ConvertToOrthX(X, Y) - cntOffset

' Error handler
Exit Function
ErrorHandler:
HandleError "ConvertMapIsoX", "modGraphics", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Function
End Function

Public Function ConvertMapOrthY(ByVal X As Long, ByVal Y As Long) As Long
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo ErrorHandler

' Isometric Changes
ConvertMapOrthY = ConvertToOrthY(X, Y) + Camera.Top - ScreenY

' Error handler
Exit Function
ErrorHandler:
HandleError "ConvertMapIsoY", "modGraphics", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Function
End Function

Public Function ConvertToOrthX(ByVal X As Long, ByVal Y As Long)
ConvertToOrthX = (Y * 2) + X ' (X - Y) * Half_PIC_X
End Function

Public Function ConvertToOrthY(ByVal X As Long, ByVal Y As Long)
ConvertToOrthY = Y - (X * 0.5) ' (X + Y) * Half_PIC_Y
End Function
```
These functions will be used to find he screen position of stuff an things (mouse and map)

***
***

`modGlobals`

Remove both
```
Public screenX As Integer
Public screenY As Integer
```
and
```
Public screenStartX As Long
Public screenStartY As Long
```

***

Add to the bottom of the file
```
Public WindowWidth As Integer
Public WindowHeight As Integer

Public ScreenX As Integer
Public ScreenWidth As Integer
Public ScreenY As Integer
Public ScreenHeight As Integer

Public ScreenHyp As Currency

Public START_MAX_MAPX As Long
Public START_MAX_MAPY As Long
```
This will be used to change how the screen is drawn/sized

***
***

`modInput`

Find
```
CurX = TileView.Left + (((X + Camera.Left) * ((MAX_MAPX * PIC_X) / screenX)) \ PIC_X)
CurY = TileView.Top + (((Y + Camera.Top) * ((MAX_MAPY * PIC_Y) / screenY)) \ PIC_Y)
```
Replace it with
```
Dim tmpX As Long, tmpY As Long
tmpX = X + Camera.Left - (ScreenWidth * 0.5) - (PIC_X * 0.5)
tmpY = Y + Camera.Top

CurX = (ConvertToOrthX(tmpX, tmpY) \ PIC_X)
CurY = (ConvertToOrthY(tmpX, tmpY) \ PIC_Y)
```
This converts the mouse position to a map tile

***
***

`modText`

Find
```
Name = Trim$(Player(Index).Name)
' calc pos
TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).xOffset + (PIC_X \ 2) - (getWidth(Font_Default, (Trim$(Name))) * 0.5)
If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then
TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).yOffset - 16
Else
' Determine location for text
TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).yOffset - (Tex_Character(GetPlayerSprite(Index)).Height / 4) + 16
End If
```
Change it to
```
Name = Trim$(Player(Index).Name)
' calc pos
TextX = ConvertMapIsoX(GetPlayerX(Index) * PIC_X, GetPlayerY(Index) * PIC_Y) + Player(Index).xOffset + (PIC_X \ 2) - (getWidth(Font_Default, (Trim$(Name))) * 0.5)

' Isometric Changes
Dim tmpX As Long, tmpY As Long
tmpX = (GetPlayerX(Index) * PIC_X) + Player(Index).xOffset - (getWidth(Font_Default, (Trim$(Name))) * 2)
tmpY = (GetPlayerY(Index) * PIC_Y) + Player(Index).yOffset '- (Tex_Character(GetPlayerSprite(Index)).Height / 4)
If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then
tmpY = tmpY - (SIZE_Y * 0.5)
Else
' Determine location for text
tmpY = tmpY - (Tex_Character(GetPlayerSprite(Index)).Height / 4)
End If

TextX = ConvertMapIsoX(tmpX, tmpY)
TextY = ConvertMapIsoY(tmpY, tmpX)
```

***

Find
```
Name = Trim$(NPC(npcNum).Name) & " [" & NPCLevel(npcNum, Player(MyIndex).Map) & "]" ' NPC Name
TextX = ConvertMapX(MapNpc(Index).X * PIC_X) + MapNpc(Index).xOffset + (PIC_X \ 2) - (getWidth(Font_Default, (Trim$(Name))) * 0.5)
If NPC(npcNum).Sprite < 1 Or NPC(npcNum).Sprite > NumCharacters Then
TextY = ConvertMapY(MapNpc(Index).Y * PIC_Y) + MapNpc(Index).yOffset - 16
Else
' Determine location for text
TextY = ConvertMapY(MapNpc(Index).Y * PIC_Y) + MapNpc(Index).yOffset - (Tex_Character(NPC(npcNum).Sprite).Height / 4) + 16
End If

' Draw name
'Call DrawText(TexthDC, TextX, TextY, Name, Color)
RenderText Font_Default, Name, TextX, TextY, color

Dim i As Long

For i = 1 To MAX_QUESTS
'check if the npc is the next task to any quest: [?] symbol
If Not LenB(Quest(i).Name) = 0 Then
If Player(MyIndex).PlayerQuest(i).Status = QUEST_STARTED Then
If Trim$(NPC_Editor(Quest(i).Task(Player(MyIndex).PlayerQuest(i).ActualTask).NPC).Name) = Trim$(NPC(npcNum).Name) Then ' npcNum Then
Name = "[?]"
TextX = ConvertMapX(MapNpc(Index).X * PIC_X) + MapNpc(Index).xOffset + (PIC_X * 0.5) - (getWidth(Font_Default, (Trim$(Name))) * 0.5)
If NPC(npcNum).Sprite < 1 Or NPC(npcNum).Sprite > NumCharacters Then
TextY = ConvertMapY(MapNpc(Index).Y * PIC_Y) + MapNpc(Index).yOffset - 16
Else
TextY = ConvertMapY(MapNpc(Index).Y * PIC_Y) + MapNpc(Index).yOffset - (Tex_Character(NPC(npcNum).Sprite).Height / 4)
End If
RenderText Font_Default, Name, TextX, TextY, Yellow
Exit For
End If
End If

'check if the npc is the starter to any quest: [!] symbol
'can accept the quest as a new one?
If Player(MyIndex).PlayerQuest(i).Status = QUEST_NOT_STARTED Or Player(MyIndex).PlayerQuest(i).Status = QUEST_COMPLETED_BUT Then
'the npc gives this quest?
If NPC(npcNum).questNum = i Then
Name = "[!]"
TextX = ConvertMapX(MapNpc(Index).X * PIC_X) + MapNpc(Index).xOffset + (PIC_X \ 2) - (getWidth(Font_Default, (Trim$(Name))) * 0.5)
If NPC(npcNum).Sprite < 1 Or NPC(npcNum).Sprite > NumCharacters Then
TextY = ConvertMapY(MapNpc(Index).Y * PIC_Y) + MapNpc(Index).yOffset - 16
Else
TextY = ConvertMapY(MapNpc(Index).Y * PIC_Y) + MapNpc(Index).yOffset - (Tex_Character(NPC(npcNum).Sprite).Height / 4)
End If
RenderText Font_Default, Name, TextX, TextY, Yellow
Exit For
End If
End If
End If
Next
```
Change it to
```
Dim tmpX As Long, tmpY As Long
tmpX = MapNpc(Index).X * PIC_X
tmpY = MapNpc(Index).Y * PIC_Y

Name = Trim$(NPC(npcNum).Name) & " [" & NPCLevel(npcNum, Player(MyIndex).Map) & "]" ' NPC Name
TextX = ConvertMapIsoX(tmpX, tmpY) + MapNpc(Index).xOffset + (PIC_X \ 2) - (getWidth(Font_Default, (Trim$(Name))) * 0.5)
If NPC(npcNum).Sprite < 1 Or NPC(npcNum).Sprite > NumCharacters Then
TextY = ConvertMapIsoY(tmpY, tmpX) + MapNpc(Index).yOffset - (SIZE_Y * 0.5)
Else
' Determine location for text
TextY = ConvertMapIsoY(tmpY, tmpX) + MapNpc(Index).yOffset - (Tex_Character(NPC(npcNum).Sprite).Height / 4) + (SIZE_Y * 0.5)
End If

' Draw name
'Call DrawText(TexthDC, TextX, TextY, Name, Color)
RenderText Font_Default, Name, TextX, TextY, color

Dim I As Long

For I = 1 To MAX_QUESTS
'check if the npc is the next task to any quest: [?] symbol
If Not LenB(Quest(I).Name) = 0 Then
If Player(MyIndex).PlayerQuest(I).Status = QUEST_STARTED Then
If Trim$(NPC_Editor(Quest(I).Task(Player(MyIndex).PlayerQuest(I).ActualTask).NPC).Name) = Trim$(NPC(npcNum).Name) Then ' npcNum Then
Name = "[?]"
TextX = ConvertMapIsoX(tmpX, tmpY) + MapNpc(Index).xOffset + (PIC_X * 0.5) - (getWidth(Font_Default, (Trim$(Name))) * 0.5)
If NPC(npcNum).Sprite < 1 Or NPC(npcNum).Sprite > NumCharacters Then
TextY = ConvertMapIsoY(tmpY, tmpX) + MapNpc(Index).yOffset - (SIZE_Y * 0.5)
Else
TextY = ConvertMapIsoY(tmpY, tmpX) + MapNpc(Index).yOffset - (Tex_Character(NPC(npcNum).Sprite).Height / 4)
End If
RenderText Font_Default, Name, TextX, TextY, Yellow
Exit For
End If
End If

'check if the npc is the starter to any quest: [!] symbol
'can accept the quest as a new one?
If Player(MyIndex).PlayerQuest(I).Status = QUEST_NOT_STARTED Or Player(MyIndex).PlayerQuest(I).Status = QUEST_COMPLETED_BUT Then
'the npc gives this quest?
If NPC(npcNum).questNum = I Then
Name = "[!]"
TextX = ConvertMapIsoX(tmpX, tmpY) + MapNpc(Index).xOffset + (PIC_X \ 2) - (getWidth(Font_Default, (Trim$(Name))) * 0.5)
If NPC(npcNum).Sprite < 1 Or NPC(npcNum).Sprite > NumCharacters Then
TextY = ConvertMapIsoY(tmpY, tmpX) + MapNpc(Index).yOffset - (SIZE_Y * 0.5)
Else
TextY = ConvertMapIsoY(tmpY, tmpX) + MapNpc(Index).yOffset - (Tex_Character(NPC(npcNum).Sprite).Height / 4)
End If
RenderText Font_Default, Name, TextX, TextY, Yellow
Exit For
End If
End If
End If
Next
```

***

Find
```
For Y = TileView.Top To TileView.Bottom
If IsValidMapPoint(X, Y) Then
With Map.Tile(X, Y)
tx = ((ConvertMapX(X * PIC_X)) - 4) + (PIC_X * 0.5)
ty = ((ConvertMapY(Y * PIC_Y)) - 7) + (PIC_Y * 0.5)
Select Case .Type
Case TILE_TYPE_BLOCKED
```
Change it to
```
For Y = TileView.Top To TileView.Bottom
If IsValidMapPoint(X, Y) Then
With Map.Tile(X, Y)
tx = ((ConvertMapIsoX(X * PIC_X, Y * PIC_Y)) - 4) + (PIC_X * 0.5)
ty = ((ConvertMapIsoY(Y * PIC_Y, X * PIC_X)) - 7) + (PIC_Y * 0.5)
Select Case .Type
Case TILE_TYPE_BLOCKED
```

***

Find
```
End Select

X = ConvertMapX(X)
Y = ConvertMapY(Y)

If GetTick < ActionMsg(Index).Created + Time Then
RenderText Font_Default, ActionMsg(Index).Message, X, Y, ActionMsg(Index).color
```
Change it to
```
End Select

X = ConvertMapIsoX(X, Y)
Y = ConvertMapIsoY(Y, X)

If GetTick < ActionMsg(Index).Created + Time Then
RenderText Font_Default, ActionMsg(Index).Message, X, Y, ActionMsg(Index).color
```

***

Find
```
Name = Trim$(Map.MapEvents(Index).Name)

' calc pos
TextX = ConvertMapX(Map.MapEvents(Index).X * PIC_X) + Map.MapEvents(Index).xOffset + (PIC_X \ 2) - (getWidth(Font_Default, (Trim$(Name))) * 0.5)
If Map.MapEvents(Index).GraphicType = 0 Then
TextY = ConvertMapY(Map.MapEvents(Index).Y * PIC_Y) + Map.MapEvents(Index).yOffset - 16
ElseIf Map.MapEvents(Index).GraphicType = 1 Then
If Map.MapEvents(Index).GraphicNum < 1 Or Map.MapEvents(Index).GraphicNum > NumCharacters Then
TextY = ConvertMapY(Map.MapEvents(Index).Y * PIC_Y) + Map.MapEvents(Index).yOffset - 16
Else
' Determine location for text
TextY = ConvertMapY(Map.MapEvents(Index).Y * PIC_Y) + Map.MapEvents(Index).yOffset - (Tex_Character(Map.MapEvents(Index).GraphicNum).Height / 4) + 16
End If
ElseIf Map.MapEvents(Index).GraphicType = 2 Then
If Map.MapEvents(Index).GraphicY2 > 0 Then
TextY = ConvertMapY(Map.MapEvents(Index).Y * PIC_Y) + Map.MapEvents(Index).yOffset - ((Map.MapEvents(Index).GraphicY2 - Map.MapEvents(Index).GraphicY) * 32) + 16
Else
TextY = ConvertMapY(Map.MapEvents(Index).Y * PIC_Y) + Map.MapEvents(Index).yOffset - 32 + 16
End If
End If

' Draw name
RenderText Font_Default, Name, TextX, TextY, color
```
Change it to
```
Name = Trim$(Map.MapEvents(Index).Name)

' calc pos
Dim tmpX As Long, tmpY As Long
tmpX = Map.MapEvents(Index).X * PIC_X
tmpY = Map.MapEvents(Index).Y * PIC_Y

TextX = ConvertMapIsoX(tmpX, tmpY) + Map.MapEvents(Index).xOffset + (PIC_X \ 2) - (getWidth(Font_Default, (Trim$(Name))) * 0.5)
If Map.MapEvents(Index).GraphicType = 0 Then
TextY = ConvertMapIsoY(tmpY, tmpX) + Map.MapEvents(Index).yOffset - (SIZE_Y * 0.5)
ElseIf Map.MapEvents(Index).GraphicType = 1 Then
If Map.MapEvents(Index).GraphicNum < 1 Or Map.MapEvents(Index).GraphicNum > NumCharacters Then
TextY = ConvertMapIsoY(tmpY, tmpX) + Map.MapEvents(Index).yOffset - (SIZE_Y * 0.5)
Else
' Determine location for text
TextY = ConvertMapIsoY(tmpY, tmpX) + Map.MapEvents(Index).yOffset - (Tex_Character(Map.MapEvents(Index).GraphicNum).Height / 4) + (SIZE_Y * 0.5)
End If
ElseIf Map.MapEvents(Index).GraphicType = 2 Then
If Map.MapEvents(Index).GraphicY2 > 0 Then
TextY = ConvertMapIsoY(tmpY, tmpX) + Map.MapEvents(Index).yOffset - ((Map.MapEvents(Index).GraphicY2 - Map.MapEvents(Index).GraphicY) * PIC_Y) + (SIZE_Y * 0.5)
Else
TextY = ConvertMapIsoY(tmpY, tmpX) + Map.MapEvents(Index).yOffset - (SIZE_Y * 0.5)
End If
End If

tmpX = TextX
tmpY = TextY

TextX = ConvertMapIsoX(tmpX, tmpY)
TextY = ConvertMapIsoY(tmpY, tmpX)

' Draw name
RenderText Font_Default, Name, TextX, TextY, color
```

***

Find
```
With chatBubble(Index)
If .targetType = TARGET_TYPE_PLAYER Then
' it's a player
If GetPlayerMap(.target) = GetPlayerMap(MyIndex) Then
' it's on our map - get co-ords
X = ConvertMapX((Player(.target).X * 32) + Player(.target).xOffset) + 16
Y = ConvertMapY((Player(.target).Y * 32) + Player(.target).yOffset) - 40
End If
ElseIf .targetType = TARGET_TYPE_NPC Then
' it's on our map - get co-ords
X = ConvertMapX((MapNpc(.target).X * 32) + MapNpc(.target).xOffset) + 16
Y = ConvertMapY((MapNpc(.target).Y * 32) + MapNpc(.target).yOffset) - 40
ElseIf .targetType = TARGET_TYPE_EVENT Then
X = ConvertMapX((Map.MapEvents(.target).X * 32) + Map.MapEvents(.target).xOffset) + 16
Y = ConvertMapY((Map.MapEvents(.target).Y * 32) + Map.MapEvents(.target).yOffset) - 40
End If
```
Change it to
```
With chatBubble(Index)
If .targetType = TARGET_TYPE_PLAYER Then
tmpX = (Player(.target).X * PIC_X) + Player(.target).xOffset
tmpY = (Player(.target).Y * PIC_Y) + Player(.target).yOffset

' it's a player
If GetPlayerMap(.target) = GetPlayerMap(MyIndex) Then
' it's on our map - get co-ords
X = ConvertMapIsoX(tmpX, tmpY) + (PIC_X * 0.5)
Y = ConvertMapIsoY(tmpY, tmpX) - (PIC_Y * 1.25) ' 40
End If
ElseIf .targetType = TARGET_TYPE_NPC Then
tmpX = (MapNpc(.target).X * PIC_X) + MapNpc(.target).xOffset
tmpY = (MapNpc(.target).Y * PIC_Y) + MapNpc(.target).yOffset

' it's on our map - get co-ords
X = ConvertMapIsoX(tmpX, tmpY) + (PIC_X * 0.5)
Y = ConvertMapIsoY(tmpY, tmpX) - (PIC_Y * 1.25) ' 40
ElseIf .targetType = TARGET_TYPE_EVENT Then
tmpX = (Map.MapEvents(.target).X * PIC_X) + Map.MapEvents(.target).xOffset
tmpY = (Map.MapEvents(.target).Y * PIC_Y) + Map.MapEvents(.target).yOffset

X = ConvertMapIsoX(tmpX, tmpY) + (PIC_X * 0.5)
Y = ConvertMapIsoY(tmpY, tmpX) - (PIC_Y * 1.25) ' 40
End If
```

Edited by Mohenjo Daro
Link to comment
Share on other sites

  • 3 weeks later...

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...