Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Display NPC Names
#1
It's really simple to do really...Just gotta add a few things, and all done. I've tested it and it works.

Difficulty: 1/5

::Client Side::

Go to modGameLogic and at the bottom add this:

Code:
Sub BltNPCName(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long

    With Npc(MapNpc(Index).Num)
    
    'Draw name
TextX = MapNpc(Index).X * PIC_X + MapNpc(Index).XOffset + CLng(PIC_X / 2) - ((Len(Trim$(.Name)) / 2) * 8)
TextY = MapNpc(Index).Y * PIC_Y + MapNpc(Index).YOffset - CLng(PIC_Y / 2) - 4
DrawText TexthDC, TextX, TextY, Trim$(.Name), vbWhite
    End With
End Sub

Then find(still in modGameLogic):

Code:
' Lock the backbuffer so we can draw text and names
                TexthDC = DD_BackBuffer.GetDC

Below that add:

Code:
'Draw npc name
                For i = LBound(MapNpc) To UBound(MapNpc)
                If MapNpc(i).Num > 0 Then
                    BltNPCName i
                End If
            Next i
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 6 Guest(s)