Dx8 Error [Easy Question!]

I wanted to add chat drawn to screen in robs version of 3.0 but i get an error.

Error: Unrecoverable DX8 Error

i used this

http://www.touchofde…rawn-to-screen/

and

for some reason this link will not work but its in the last post on the first topic

*might not work

http://www.touchofde…__+chat +screen

That first one is DD7. And the second link is broken.

the second link is the code you change to make it dx8

Bump i really need this! fixed second link

bumpero

Bump i really need this!

is it against the rules to bump once a day until i get help?

In the sub that loops through to render, comment out the error handler. Then run it. debug at the line that causes the error.

so comment out the error handler in sub addtext

The DX8 Render_**** does the rendering part. in that sub comment out the line


on error goto errohandler

or similar. Then run and when the error occurs debug. It will take you to the line that is causing the error. Paste that line over here.

gave this error in debug


RenderText Font_Default, Chat(i).Text, Camera.Left + 10, (Camera.Bottom - 20) - (i * 20), Chat(i).Text, Chat(i).Colour

bump, 50 forum credits to the person who solves this.

bump

Sub?

Render_Graphics

Try commenting and try again. If the errr occurs again then something messed up seriously. If not try changing putting it under some other block of code.

The error was is public sub DrawChat

Paste the entire sub here.

Sub Render_Graphics

! ```
Public Sub Render_Graphics()
! Dim x As Long
! Dim y As Long
! Dim i As Long
! Dim rec As RECT
! Dim rec_pos As RECT, srcRect As D3DRECT
! ’ If debug mode, handle error then exit out
! 'On Error GoTo errorhandler
! 'Check for device lost.
! If Direct3D_Device.TestCooperativeLevel = D3DERR_DEVICELOST Or Direct3D_Device.TestCooperativeLevel = D3DERR_DEVICENOTRESET Then HandleDeviceLost: Exit Sub
! ’ don’t render
! If frmMain.WindowState = vbMinimized Then Exit Sub
! If GettingMap Then Exit Sub
! ’ update the viewpoint
! UpdateCamera
! Direct3D_Device.Clear 0, ByVal 0, D3DCLEAR_TARGET, D3DColorARGB(0, 0, 0, 0), 1#, 0
! Direct3D_Device.BeginScene
! ’ 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
! ’ render the decals
! For i = 1 To MAX_BYTE
! Call DrawBlood(i)
! Next
! ’ Blit out the items
! If numitems > 0 Then
! For i = 1 To MAX_MAP_ITEMS
! If MapItem(i).num > 0 Then
! Call DrawItem(i)
! End If
! Next
! End If
! If Map.CurrentEvents > 0 Then
! For i = 1 To Map.CurrentEvents
! If Map.MapEvents(i).Position = 0 Then
! DrawEvent i
! End If
! Next
! End If
! ’ draw animations
! If NumAnimations > 0 Then
! For i = 1 To MAX_BYTE
! If AnimInstance(i).Used(0) Then
! DrawAnimation i, 0
! End If
! Next
! End If
! ’ Y-based render. Renders Players, Npcs and Resources based on Y-axis.
! For y = 0 To Map.MaxY
! If NumCharacters > 0 Then
! If Map.CurrentEvents > 0 Then
! For i = 1 To Map.CurrentEvents
! If Map.MapEvents(i).Position = 1 Then
! If y = Map.MapEvents(i).y Then
! DrawEvent i
! End If
! End If
! Next
! End If
! ’ Players
! For i = 1 To Player_HighIndex
! If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
! If Player(i).y = y Then
! Call DrawPlayer(i)
! End If
! End If
! Next
! ’ Npcs
! For i = 1 To Npc_HighIndex
! If MapNpc(i).y = y Then
! Call DrawNpc(i)
! End If
! Next
! End If
! 'Projectiles
! For i = 1 To MAX_MAP_PROJECTILES
! If MapProjectile(i).active = 1 Then
! Call DrawMapProjectile(i)
! End If
! Next i
! ’ Resources
! If NumResources > 0 Then
! If Resources_Init Then
! If Resource_Index > 0 Then
! For i = 1 To Resource_Index
! If MapResource(i).y = y Then
! Call DrawMapResource(i)
! End If
! Next
! End If
! End If
! End If
! Next
! ’ animations
! If NumAnimations > 0 Then
! For i = 1 To MAX_BYTE
! If AnimInstance(i).Used(1) Then
! DrawAnimation i, 1
! End If
! Next
! End If
! ’ 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
! If Map.CurrentEvents > 0 Then
! For i = 1 To Map.CurrentEvents
! If Map.MapEvents(i).Position = 2 Then
! DrawEvent i
! End If
! Next
! End If
! 'For i = 1 To MAX_MAP_PROJECTILES
! ’ If Map.Projectile(i).active = True Then
! ’ End If
! ’
! 'Next
! If IsNight = True Then
! DrawNight
! End If
! DrawWeather
! DrawFog
! DrawTint
! ’ blit out a square at mouse cursor
! If InMapEditor Then
! If frmEditor_Map.optBlock.value = True Then
! For x = TileView.Left To TileView.Right
! For y = TileView.Top To TileView.Bottom
! If IsValidMapPoint(x, y) Then
! Call DrawDirection(x, y)
! End If
! Next
! Next
! End If
! Call DrawTileOutline
! End If
! ’ Render the bars
! DrawBars
! ’ 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
! ’ Draw the hover icon
! For i = 1 To Player_HighIndex
! If IsPlaying(i) Then
! If Player(i).Map = Player(MyIndex).Map Then
! If CurX = Player(i).x And CurY = Player(i).y Then
! If myTargetType = TARGET_TYPE_PLAYER And myTarget = i Then
! ’ dont render lol
! Else
! DrawHover TARGET_TYPE_PLAYER, i, (Player(i).x * 32) + Player(i).xOffset, (Player(i).y * 32) + Player(i).yOffset
! End If
! End If
! End If
! End If
! Next
! For i = 1 To Npc_HighIndex
! If MapNpc(i).num > 0 Then
! If CurX = MapNpc(i).x And CurY = MapNpc(i).y Then
! 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.picScreen.ScaleWidth, frmMain.picScreen.ScaleHeight, 32, 32, D3DColorRGBA(255, 255, 255, 160): DrawThunder = DrawThunder - 1
! ’ Get rec
! With rec
! .Top = Camera.Top
! .Bottom = .Top + ScreenY
! .Left = Camera.Left
! .Right = .Left + ScreenX
! End With
! ’ rec_pos
! With rec_pos
! .Bottom = ScreenY
! .Right = ScreenX
! End With
! With srcRect
! .x1 = 0
! .x2 = frmMain.picScreen.ScaleWidth
! .y1 = 0
! .y2 = frmMain.picScreen.ScaleHeight
! End With
! 'Evilbunnie’s DrawnChat System
! DrawChat
! If BFPS Then
! RenderText Font_Default, "FPS: " & CStr(GameFPS), 2, 39, Yellow, 0
! End If
! ’ draw cursor, player X and Y locations
! If BLoc Then
! RenderText Font_Default, Trim$(“cur x: " & CurX & " y: " & CurY), 2, 1, Yellow, 0
! RenderText Font_Default, Trim$(“loc x: " & GetPlayerX(MyIndex) & " y: " & GetPlayerY(MyIndex)), 2, 15, Yellow, 0
! RenderText Font_Default, Trim$(” (map #” & GetPlayerMap(MyIndex) & “)”), 2, 27, Yellow, 0
! End If
! ’ draw player names
! For i = 1 To Player_HighIndex
! If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
! Call DrawPlayerName(i)
! End If
! Next
! For i = 1 To Map.CurrentEvents
! If Map.MapEvents(i).Visible = 1 Then
! If Map.MapEvents(i).ShowName = 1 Then
! DrawEventName (i)
! End If
! End If
! Next
! ’ draw npc names
! For i = 1 To Npc_HighIndex
! If MapNpc(i).num > 0 Then
! Call DrawNpcName(i)
! End If
! Next
! ’ draw the messages
! For i = 1 To MAX_BYTE
! If chatBubble(i).active Then
! DrawChatBubble i
! End If
! Next
! For i = 1 To Action_HighIndex
! Call DrawActionMsg(i)
! Next i
! ’ Render the minimap
! DrawMiniMap
! If Map.ViewFog = 1 Then
! Call DrawLightmap
! End If
! 'Draw the HUD Overlay
! Call DrawHUD
! ’ Draw map name
! RenderText Font_Default, Map.name, DrawMapNameX, DrawMapNameY, DrawMapNameColor, 0
! If InMapEditor And frmEditor_Map.optEvent.value = True Then DrawEvents
! If InMapEditor Then Call DrawMapAttributes
! If FadeAmount > 0 Then RenderTexture Tex_Fade, 0, 0, 0, 0, frmMain.picScreen.ScaleWidth, frmMain.picScreen.ScaleHeight, 32, 32, D3DColorRGBA(255, 255, 255, FadeAmount)
! If FlashTimer > GetTickCount Then RenderTexture Tex_White, 0, 0, 0, 0, frmMain.picScreen.ScaleWidth, frmMain.picScreen.ScaleHeight, 32, 32, -1
! Direct3D_Device.EndScene
! If Direct3D_Device.TestCooperativeLevel = D3DERR_DEVICELOST Or Direct3D_Device.TestCooperativeLevel = D3DERR_DEVICENOTRESET Then
! HandleDeviceLost
! Exit Sub
! Else
! If InShop = False And InBank = False Then Direct3D_Device.Present srcRect, ByVal 0, 0, ByVal 0
! DrawGDI
! End If
! ’ Error handler
! Exit Sub
! errorhandler:
! If Direct3D_Device.TestCooperativeLevel = D3DERR_DEVICELOST Or Direct3D_Device.TestCooperativeLevel = D3DERR_DEVICENOTRESET Then
! HandleDeviceLost
! Exit Sub
! Else
! If Options.Debug = 1 Then
! HandleError “Render_Graphics”, “modGraphics”, Err.Number, Err.Description, Err.Source, Err.HelpContext
! Err.Clear
! End If
! MsgBox “Unrecoverable DX8 error.”
! DestroyGame
! End If
! End Sub


Sub DrawChat

>! ```
'Evilbunnie's DrawnChat system
>! Public Sub DrawChat()
>! Dim i As Integer
>! For i = 1 To 6
>! RenderText Font_Default, Chat(i).Text, Camera.Left + 10, (Camera.Bottom - 20) - (i * 20), Chat(i).Text, Chat(i).Colour
>! Next
>! End Sub

bump

Log in to reply