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

Looking to Trade


shado360
 Share

Recommended Posts

Fore-Note:
Hi there! I'm Païn, some of you might know me, but that isn't the point. We have a lot of talented programmers out there and I'd like to make a trade. A transparent form dealy-ma-boby for a title system.

Information:
The Transparency:

>! ![](http://www.freemmorpgmaker.com/files/imagehost/pics/a68501407165b5cb2156bd25b7768b59.png)
![](http://www.freemmorpgmaker.com/files/imagehost/pics/be8c98feb453d20263309d7696122c83.png) I would also teach you how to add a level of transparency bar, and a predefined transparency for the chat-box, if that is what you desire

The Title System:
What I would like is a title system where a player would be able to choose his/her  **unlock-able** title, and it would then appear above their head for all to see. An example of this is seen here: http://img35.imageshack.us/img35/8144/hotbartitles.png.

Closing Note:
I believe I am a reasonable man, and this is a reasonable deal. I hope one of those talented programmers out there will put this trade in mind.

Thank you for your time,
Païn
Link to comment
Share on other sites

Robin already posted this code (for transparent forms) somewhere on the forums, however, I will certainly give you some pointers on your title system.  It's pretty easy to do ;)

1) Wipe all player accounts

2) On the Server, in modTypes, find Public Type PlayerRec
Just after Dir as Byte add
```
Title As String
```
3) On the Server, in modServerTCP, find Function PlayerData(byval Index as Long) as Byte()
Just after buffer.WriteLong GetPlayerPK(index), add
```
buffer.WriteString Player(index).Title
```*Note you can also create a GetPlayerTitle Function if you truly wanted to, that's your call, this is just the easiest dirtiest method.

4) On the Server, in modDatabase, find Sub AddChar
Just after you see Player(index).dir = DIR_DOWN add
```
Player(index).title = "Newbie"
```
5) On the Client, in modTypes, find Private Type PlayerRec, and just after you see Step as byte, add
```
Title as String
```
6) On the Client, in modHandleData, just after call SetPlayerPK(I, Buffer.ReadLong), add
```
Call SetPlayerTitle(I, Buffer.ReadString)
```
7) On the Client go to modDatabase, at the end add
```
Sub SetPlayerTitle(ByVal Index As Long, ByVal Title As String)
    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    If Index > MAX_PLAYERS Then Exit Sub
    Player(Index).Title = Title   
    ' Error handler
    Exit Sub
errorhandler:
    HandleError "SetPlayerTitle", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub
```
8) On the Client, in modText, we're going to add Draw their Title now, my tutorial will draw their Title Under their name, you can change the Position later.  Replace your Public Sub DrawPlayerName(Byval Index as Long) with this new one
```
Public Sub DrawPlayerName(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim TitleX As Long
Dim TitleY As Long

Dim color As Long
Dim Name As String
Dim Title As String

    ' Check access level
    If GetPlayerPK(Index) = NO Then

        Select Case GetPlayerAccess(Index)
            Case 0
                color = RGB(255, 96, 0)
            Case 1
                color = QBColor(DarkGrey)
            Case 2
                color = QBColor(Cyan)
            Case 3
                color = QBColor(BrightGreen)
            Case 4
                color = QBColor(Yellow)
        End Select

    Else
        color = QBColor(BrightRed)
    End If

    Name = Trim$(Player(Index).Name)
    Title = Trim$(Player(Index).Title)
    ' calc pos
    TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Name)))
    TitleX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Title)))
    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) + 0
    End If

    If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then
        TitleY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16
    Else
        ' Determine location for text
        TitleY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 16
    End If

    ' Draw name
    Call DrawText(TexthDC, TextX, TextY, Name, color)
    Call DrawText(TexthDC, TitleX, TitleY, Title, color)
End Sub
```
Now, whatever your players 'Title' is, will now appear.  We defined their title as "Newbie" earlier, however you can simply make it now so when your player achieves certain goals, his title will change. 

Cheers
Link to comment
Share on other sites

These aren't selectable no, to do that

1.  Add this to your Server, modConstants
```
Public Const MAX_PLAYER_TITLES As Integer = 10
```
2\. On the server, in modTypes, in Public Type PlayerRec, you'd want to do
```
Title(1 to MAX_PLAYER_TITLES) as String
CurrentTitle as String
```
3\. On the Server, in modDatabase, in AddChar, instead of doing Player(index).title = "Newbie" change it to
```
for I = 1 to MAX_PLAYER_TITLES
Player(index).Title(I) = ""
Next I
Player(index).Title(1) = "Newbie"
Player(index).CurrentTitle = Player(index).Title(1)
```*This just sets their titles to empty strings and gives them a first rank title of Newbie.

4.  Then on the Server in modServerTCP, for Function PlayerData, change the
Buffer.WriteString Player(index).Title to
```
Buffer.WriteString Player(index).CurrentTitle
```
This method, you can store up to 10 titles on a players account, and their 'CurrentTitle' string is what will be sent to each client.

So what you'd need to do is make a Sub for the player to change their titles accordingly later, I can help with this too if need be.  You'd want to A) Send the player a list of all of their titles B) Make it so a player can select the title they want (basically selecting the Title(slot); and send that back to the server, and then it would change their CurrentTitle to whatever Title(slot) they selected.
Link to comment
Share on other sites

You could also make CurrentTitle an Integer that simply points to one of their existing titles such as; the choice is up to you which one you want to use, they both do the same, some point just like to use integers to point to certain fields in an array.  Again, they both do the same thing so, no worries on which you choose.

```
Title(1 to MAX_PLAYER_TITLES) as String
CurrentTitle as Integer
```
```
for I = 1 to MAX_PLAYER_TITLES
Player(index).Title(I) = ""
Next I
Player(index).Title(1) = "Newbie"
Player(index).CurrentTitle=1

```
```
Buffer.WriteString Player(index).Title(Player(index).CurrentTitle))
```
Link to comment
Share on other sites

Samu, you are probably one of the most kind and considerate people on these forums. For that, I salute you. But this, I don't feel as I deserve it. I'm not the kind of person to steal others work, unless I give them something in return. So Samu, please implement this in your game, and please take it off of these forums. I don't think I earned it. To Everyone Else: I will still keep this up so people can make me a title system and I'll give them the transparency thing.

Thanks,
Païn
Link to comment
Share on other sites

Samu seemed to think u were worthy of having it Pain, thats why he done it for ya ;)

Good tut Samu I've been trying to put a title system in my game aswell so thanks! :D

Seen my mate playing a game called Iris, It has a title system with buffs. So each title has its own buff which makes the title more worth while working for and getting, and this can added to Samus tut.
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...