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

[EO 2.0/3.0] Guilds


Scott
 Share

Recommended Posts

  • Replies 328
  • Created
  • Last Reply

Top Posters In This Topic

@Goldside There is examples of this in other areas of the source/online.

@tslusny These are the steps dealing with drawing the guild name, make sure yours looks like it.

FIND:

```
Public Sub DrawPlayerName(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim color As Long
Dim Name As String

```
UNDER ADD:

```
Dim Text2X As Long
Dim Text2Y As Long
Dim GuildString As String
```

–------------------------------------------------------------

FIND:

   ```
Name = Trim$(Player(Index).Name)
    ' calc pos
    TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Name)))
```

UNDER ADD:

```
    GuildString = Player(Index).GuildName
    Text2X = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(GuildString)))
```

–------------------------------------------------------------

FIND:
```
    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 - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 16
    End If

```
REPLACE WITH:

 ```
  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 - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 16
        'Guild TUT
        Text2Y = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 4
    End If

```
–------------------------------------------------------------

FIND:

```
    ' Draw name
    Call DrawText(TexthDC, TextX, TextY, Name, color)
```

UNDER ADD:

```
    If Not Player(Index).GuildName = vbNullString Then
        Call DrawText(TexthDC, Text2X, Text2Y, GuildString, color)
    End If
```
If your still having problems than the server is probly sending the client a NullString (If Not Player(Index).GuildName = vbNullString Then) so it would not be displayed, in that case you messed with something in the PlayerData Function.
Link to comment
Share on other sites

Is this what I need to change to make the player name above the guild name. Like

Playername
Guildname

If so do I just change textx to text2x? ect. Still learning.

```
Public Sub DrawPlayerName(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim color As Long
Dim Name As String

UNDER ADD:

Dim Text2X As Long
Dim Text2Y As Long
Dim GuildString As String
```
Link to comment
Share on other sites

@grim - go learn graphcs again… x is left and right and y is up and down.....

Snoozey you dont change the x values. you change the Y value. think of x and y as graphs. So make the guild name y smaller than the name and vice versa. make the name y higher than the guild y...
Link to comment
Share on other sites

New issue! It seems I can make a guild name very, very long. Is it possible to make it lets say only 10 characters long? I was trying to look for where the current limit is, but I can't seem to find it. Any help?

@crzy:

> @grim - go learn graphcs again… x is left and right and y is up and down.....
>
> Snoozey you dont change the x values. you change the Y value. think of x and y as graphs. So make the guild name y smaller than the name and vice versa. make the name y higher than the guild y...

Still not working :/
```
Public Sub DrawPlayerName(ByVal Index As Long)
Dim TextX As Long
Dim Text2Y As Long
Dim color As Long
Dim Name As String
Dim Text2X As Long
Dim TextY As Long
Dim GuildString As String
```
Figured it out after playing for awhile. Look further down and you will see +16 or something like that. These are the values he was talking about.
Link to comment
Share on other sites

@crzy:

> like i said the + 16 is a y value… no one ever listens.... And the code you keep pasting has nothing to do with it....

The code is the original code I posted. I just edited my post because I figured it out. I did listen, however I misunderstood your original post. I figured it out and explained a little on where to find the values you were originally talking about.

Also, Still looking for where to limit the amount of characters in a guild name.
Link to comment
Share on other sites

Server side modGuild

```
Public Type GuildRec
    In_Use As Boolean

    Guild_Name As String

    Guild_Fileid As Long

    Guild_Members(1 To MAX_GUILD_MEMBERS) As GuildMemberRec
    Guild_Ranks(1 To MAX_GUILD_RANKS) As GuildRanksRec

    'Message of the day
    Guild_MOTD As String * 100

    Guild_RecruitRank As Integer
    Guild_Color As Integer

End Type
```
Change
```
Guild_Name As String
```
to

```
Guild_Name As String * 20
```
would limit it to 20
Link to comment
Share on other sites

@Scott:

> Server side modGuild
>
> ```
> Public Type GuildRec
>     In_Use As Boolean
>    
>     Guild_Name As String
>    
>     Guild_Fileid As Long
>    
>     Guild_Members(1 To MAX_GUILD_MEMBERS) As GuildMemberRec
>     Guild_Ranks(1 To MAX_GUILD_RANKS) As GuildRanksRec
>    
>     'Message of the day
>     Guild_MOTD As String * 100
>    
>     Guild_RecruitRank As Integer
>     Guild_Color As Integer
>
> End Type
> ```
> Change
> ```
> Guild_Name As String
> ```
> to
>
> ```
> Guild_Name As String * 20
> ```
> would limit it to 20

I was staring at that line wondering if that is what I needed. Thank you :]
Link to comment
Share on other sites

@Snoozey:

> When I send a message the guild chat looks like this
>
> [Guild name here          ] Snoozey: Hello
>
> Any ideas?

```
Guild_Name As String * 20
```You tell VB its a 20 character string (text) so I would imagine the extra spaces you see are 20 - guildname.
Link to comment
Share on other sites

@Joost:

> ```
> Guild_Name As String * 20
> ```You tell VB its a 20 character string (text) so I would imagine the extra spaces you see are 20 - guildname.

Makes sense, while testing with this I found a bug I think. not sure if it is with only my game but, I can make the same guild name multiple times. They all act independent of each other, but they all can be exactly the same. Looking for a fix right now, but I am pretty  new for coding.
Link to comment
Share on other sites

@Joost:

> Look at
>
> ```
> Function FindChar
> Sub AddChar
>
> ```
> EO saves all the in-game names in a big text and uses that to make sure there are no 2 people named the same. Read the code and try to figure it out I guess.

Well this is the guild names, not player names. looking in the guild.dats they are all exactly the same. just the owners and stuff are different. I am guessing I broke my check functions for guilds.
Link to comment
Share on other sites

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