shado360 Posted February 8, 2011 Author Share Posted February 8, 2011 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 desireThe 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 More sharing options...
Marsh Posted February 8, 2011 Share Posted February 8, 2011 Approved try to get some more info on the system. Link to comment Share on other sites More sharing options...
shado360 Posted February 8, 2011 Author Share Posted February 8, 2011 Which system Marshy?Regards,Pain Link to comment Share on other sites More sharing options...
Rob Janes Posted February 8, 2011 Share Posted February 8, 2011 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 accounts2) On the Server, in modTypes, find Public Type PlayerRecJust 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 AddCharJust 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 Suberrorhandler: HandleError "SetPlayerTitle", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd 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 LongDim TextY As LongDim TitleX As LongDim TitleY As LongDim color As LongDim Name As StringDim 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 More sharing options...
shado360 Posted February 8, 2011 Author Share Posted February 8, 2011 wow, thanks, but these are not selectable, are they :PThanks,PainP.S: Will still do this deal :P Link to comment Share on other sites More sharing options...
Rob Janes Posted February 8, 2011 Share Posted February 8, 2011 These aren't selectable no, to do that1. 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 StringCurrentTitle 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_TITLESPlayer(index).Title(I) = ""Next IPlayer(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 theBuffer.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 More sharing options...
Rob Janes Posted February 8, 2011 Share Posted February 8, 2011 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 StringCurrentTitle as Integer``````for I = 1 to MAX_PLAYER_TITLESPlayer(index).Title(I) = ""Next IPlayer(index).Title(1) = "Newbie"Player(index).CurrentTitle=1``````Buffer.WriteString Player(index).Title(Player(index).CurrentTitle))``` Link to comment Share on other sites More sharing options...
shado360 Posted February 8, 2011 Author Share Posted February 8, 2011 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 More sharing options...
Rob Janes Posted February 8, 2011 Share Posted February 8, 2011 I certainly don't mind helping people out ;)If there is a neat feature people want added and it's not a lot of work, i'll do tutorials for it. Link to comment Share on other sites More sharing options...
shado360 Posted February 10, 2011 Author Share Posted February 10, 2011 This is still a valid deal, and is still wanted to happen xD.Regards,Païn Link to comment Share on other sites More sharing options...
crzyone9584 Posted February 11, 2011 Share Posted February 11, 2011 Your not going to use the system samu gave you? If not I'll set something up. Would you like a form to add/edit the titles? Link to comment Share on other sites More sharing options...
Thor7 Posted February 11, 2011 Share Posted February 11, 2011 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! :DSeen 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now