![]() |
Live Stats+ - 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: Live Stats+ (/showthread.php?tid=406) |
Live Stats+ - DarkX - 06-11-2006 Ok this is my 4th tutorial; I am not going to take all the credit; Programmers; DarkX; Leighland; Sonire difficulty: 1 out 5 This tutorial is going to show you how to do multiple things, here's a list: displaying your str, def, speed, magi, exp, and level. Extra's(not needed but looks spiffy) Displaying your Critical Hit Chance, Blocking Chance, and next level. This part is by Leighland Ok let's start off with the easiest part; server side... make a timer anywhere on frmServer name it w/e you want then double click it and add this into it Code: Dim i As Byte Ok what this does is it makes the stats update every 1 minute or second( I can't remember(And there are other; better ways to do this part)) In modServerTCP find SendStats make it look like this Code: Sub SendStats(ByVal Index As Long) Ok now to Client side in modHandleData find "Player Stats Packet" This is something almost anyone can figure out now that everythings done server side(let you know some features don't need to be put into Sub SendStats) make the Player Stats Packet look like this. Code: Call SetPlayerSTR(MyIndex, Val(Parse(1))) FrmMirage ok Now make each of those labels on frmMirage somewhere; and name them lblstr, lbldef, lblspeed, lbllevel, lblmagi, and lblexp and that's all for the short end of the tutorial; Now for the extra's ![]() In the PlayerStatsPacket, just below Code: frmMirage.lblExp = GetplayerExp(MyIndex) Code: frmMirage.lblBLOCK = Int(GetPlayerDEF(MyIndex) / 2) + Int(GetPlayerLevel(MyIndex) / 2) Now to finish the extra's. On frmMirage add 3 more labels name them lblblock, lblHit, and lblNextLvl and your done. Hope this helps someone. ![]() - Salt - 06-11-2006 and some people (like myself) are too lazy to register, so copy and paste may be a good idea ![]() - DarkX - 06-11-2006 I booted the guy who is my other admin he's the one who turned that register thing on, but it's fixed now you can view without registering. - ArchAngel - 07-11-2006 When I did this I got the "subscript out of range" error and it brought me to this Code: Sub SetPlayerSTR(ByVal Index As Long, ByVal STR As Long) - DarkX - 08-11-2006 Post your "playerstats" packet that has the things from the tutorial and I'll see if I can help you. But subscript out of range was something that I had a while back while trying to figure out the tut that was origanally posted here, when it said that to me it turned out that the way the data was sent server side from sub SendStats was not matching the way it was recieved client side... In short try making the parses look the same way they are in "playerStats" as they are in Sendstats. here's an example Code: Packet = "PLAYERSTATS" & SEP_CHAR & GetPlayerSTR(Index) & SEP_CHAR & GetPlayerDEF(Index) & SEP_CHAR & GetPlayerSPEED(Index) & SEP_CHAR & GetPlayerMAGI(Index) & SEP_CHAR & GetPlayerLevel(Index) & SEP_CHAR & GetPlayerExp(Index) & SEP_CHAR & END_CHAR Code: If LCase(Parse(0)) = "playerstats" Then - ArchAngel - 08-11-2006 This is my Player Stats Packet: Code: ' ::::::::::::::::::::::::: and my Send Stats Code: Sub SendStats(ByVal Index As Long) I'm going to try to change the parses like you said, i'l post what happens. - DarkX - 09-11-2006 If you change the parses IF I remember correctly you have to change them to the same order in sendstats or you'll get this problem when you log into the game code(I'm purposely doing it like this so don't freak out) Run-Time error '6': Overflow now what happened here is I changed the str to parse6(Client Side) and level to parse 1 without changing it server side to match the client side. So I got Run-Time Error '6': which I think ment that the data doesn't match. - DarkX - 09-11-2006 EDIT:::: I'm Sorry about double posting, it truely was an accident. :::::::EDIT Ok here's the origanal tutorial all this came from I don't remember who made it. [QOUTE] Here is my Visual Stats code. In modClientTCP go to Code: Sub HandleData Scroll down to Code: ' ::::::::::::::::::::::::: Replace Code: If LCase(Parse(0)) = "playerstats" Then With Code: If LCase(Parse(0)) = "playerstats" Then And then go to frmMirage and make some labels and don't name them and set their captions to be STR, DEF, Speed, Magi, Level, and Exp. Make more labels except this time give them a null caption and Name them lblSTR, lblDEF, lblSPEED, lblMAGI, lblLevel, lblExp. and then put those where you want them to be and you're done! [/QOUTE] Ok do that then try the parts of this tutorial that are missing from it, assuming it doesn't work. - ArchAngel - 10-11-2006 Ok, thanks a lot for all your help. I'l try this when I get home. - Matt - 12-12-2006 Just looking at the tut and what not, but wouldn't it be better to take this part: Code: Call SetPlayerSTR(MyIndex, Val(Parse(1))) And make it look like this: Code: frmMirage.lblSTR = val(parse(1)) ? Now, I didn't try this, so I could be wrong. Just the method you used, looked odd to me. - William - 12-12-2006 Why would you want to send it constantly with a timer, and not only when its needed? - Robin - 12-12-2006 William Wrote:Why would you want to send it constantly with a timer, and not only when its needed? Well, we managed to create a shit, perfectly un-optimized server using Timers already (for everything! How messed up is that?) so why not f*ck it up even more? [/sarcasm] - William - 12-12-2006 Haha.. won't even answer that. - Robin - 12-12-2006 lol. The sarcasm/insult wasn't aimed at you xD Just mirage's poor server programming. And Advocate's 'l33t' timing script. - Matt - 12-12-2006 Huh? Wouldn't we be able to convert all timers to use gettickcount or something? - Robin - 12-12-2006 Advocate Wrote:Huh? -_- - Matt - 12-12-2006 I know.. I only suggested getting rid of the timers, because if someone knows what they are doing, timers can be froze. Meaning anything that needs the timer, will not happen. I know this from experience. |