[CS:DE]Show Guild Name DX8

Hello Guys, i was modifying this Guild System Tutorial and “converted” it to a CS:DE Engine. But now my problem is, since im new to the CS:DE engine which everything is rendered in DX8 and which is completly different to EO2.0/3.0, i want to show the Guild Name above the Head of the Characters when they are in the guild, since i cant find the recomented methods to place the tutorial code.

This is the Tutorial Code to show the Guild Name in E.O 3.0 using Directx8

FIND:

[code]    Name = Trim$(Player(Index).Name)
    ' calc pos
    TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).xOffset + (PIC_X \ 2) - (getWidth(Font_Default, (Trim$(Name))) / 2)[/code]

UNDER ADD:

[code]    'guild
    GuildString = Player(Index).GuildName
    Text2X = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).xOffset + (PIC_X \ 2) - (getWidth(Font_Default, (Trim$(GuildString))) / 2)
[/code]
--------------------------------------------------------------

FIND:

[code]
    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
[/code]

REPLACE WITH:

[code]
    'new
    If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then
        TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).yOffset - 16
        'Guild TUT
        Text2Y = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).yOffset
    Else
        ' Determine location for text
        TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).yOffset - (Tex_Character(GetPlayerSprite(Index)).Height / 4) + 16
        'Guild TUT
        Text2Y = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).yOffset - (Tex_Character(GetPlayerSprite(Index)).Height / 4)
    End If
[/code]

--------------------------------------------------------------

FIND:

[code]    ' Draw name
    'Call DrawText(TexthDC, TextX, TextY, Name, Color)
    RenderText Font_Default, Name, TextX, TextY, color, 0[/code]

UNDER ADD:

[code]    If Not Player(Index).GuildName = vbNullString Then
        'Call DrawText(TexthDC, Text2X, Text2Y, GuildString, color)
        RenderText Font_Default, GuildString, Text2X, Text2Y, color, 0
    End If[/code]

But i cant find the recomented stuff i have to replace or add something. For example i dont have

 Name = Trim$(Player(Index).Name)
    ' calc pos
    TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).xOffset + (PIC_X \ 2) - (getWidth(Font_Default, (Trim$(Name))) / 2)

to add this below

 'guild
    GuildString = Player(Index).GuildName
    Text2X = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).xOffset + (PIC_X \ 2) - (getWidth(Font_Default, (Trim$(GuildString))) / 2)

Like i was looking around the source but i cant find anything similiar, may you guys can help out there.

You can find those at “DrawPlayerName” sub and “DrawPlayerSprite”

Press Ctrl + F and find those word throughout the module

Log in to reply