![]() |
Sex Determines Name Color - Printable Version +- Mirage Source (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49) +---- Thread: Sex Determines Name Color (/showthread.php?tid=1301) |
Sex Determines Name Color - Hayashi - 20-09-2007 Okey, This is only my first tutorial so don't yell at me. ![]() ![]() Server Side: First, you should add these two functions at the bottom of modGameLogic. Code: Function GetPlayerSex(ByVal Index As Long) As Long Once you have those two functions added, head over to modServerTCP and search for "Sub SendStats(ByVal Index As Long)". Change that entire sub to: Code: Sub SendStats(ByVal Index As Long) Done with Server! Client Time! Now that we are in the client, we need to make changes to the SendStats packet so that we can receive the player's sex. To do this we need to search for, "' :: Player stats packet ::" in modHandleData. Change this entire packet to: Code: ' ::::::::::::::::::::::::: Now that our client recieves the player's sex, it still doesn't have the function to actually make the client know what sex they have. So we need to two functions to the client. In modGameLogic add these two functions at the bottom. Code: Sub SetPlayerSex(ByVal Index As Long, ByVal Sex As Byte) There, now our client receives the player's sex and knows what to do with it. Finally we need to make the client check if the player is Male or Female and then blt their name. Go to modGameLogic and search for, "Sub BltPlayerName(ByVal Index As Long)" and change the entire sub to: Code: Sub BltPlayerName(ByVal Index As Long) In that sub, we check to see if the person is a male or female. If the player is a male, then their name will show up to be Orange. If they're a female then it will be a purplish color. To change the color of the names, find the RGB(Blah, Blah, Blah) beside the SEX_MALE or SEX_FEMALE and change it to the desired color. That should be it for this tutorial so if there is any problems, post back! I'll try to help as much as I can and I'm sure the community will help also! Edit: I forgot to add the Sex to the Player Type. Go into modTypes and go to Type PlayerRec and under, "Name As String * NAME_LENGTH" add, "Sex as Byte". Also, go into frmNewChar and change all three Label3, optMale, and optFemale's visibility to True instead of false. Re: Sex Determines Name Color - Hayashi - 20-09-2007 Hmm, I'm not sure. I haven't tested it with more than one person on. I'll test it when I get home from college. ![]() Re: Sex Determines Name Color - Robin - 20-09-2007 It should work on all players. Re: Sex Determines Name Color - Tony - 20-09-2007 Kuja Robin Big tutorial done by a new user :] Great way to start off! Re: Sex Determines Name Color - Rezeyu - 20-09-2007 Holy shit, I can see Dave's avatar and sig. o.O I did something like this for human - vampire(transformed) But took it off cus it annoyed me immensely. Re: Sex Determines Name Color - Hayashi - 21-09-2007 So, has anyone tried this with multiple user's on at the same time? I would try to get more than one on at the same time but I don't know how to do that multiple logging because when I log in the second character I get an automation error. But anyway, thanks for all the replies! ![]() Re: Sex Determines Name Color - Rezeyu - 21-09-2007 No, it should work fine. I know once I messed up displaying player names on the GUI, and it showed whoever the last person was that logged on instead of the actual player's name though. |