| Mirage Source http://www.miragesource.net/forums/ |
|
| HP, MP and SP Progress bar's http://www.miragesource.net/forums/viewtopic.php?f=210&t=1189 |
Page 1 of 1 |
| Author: | willgtjr [ Sat Jan 20, 2007 8:55 am ] |
| Post subject: | HP, MP and SP Progress bar's |
Well...first of all, let me say hi I am a new user here, but I'm using MS for a week or so, and one of the first things that I wanted to change was the HP, MP and SP labels to progress bars... So let's start Difficulty: Easy 1/5 :: All Client Side:: Right click your ToolBox and click in the "Components..." button. There search and select the "Microsoft Windows Common Controls 6.0 (SP6)". If you look in your ToolBox now you will see the Progress Bar thing... just draw 3 of it (HP, MP and SP) anywhere you want it to be... Now name then prgHP, prgMP and prgSP Now inside modHandleData search for this code Code: ' :::::::::::::::::::::: ' :: Player hp packet :: ' :::::::::::::::::::::: If LCase(Parse(0)) = "playerhp" Then Player(MyIndex).MaxHP = Val(Parse(1)) Call SetPlayerHP(MyIndex, Val(Parse(2))) If GetPlayerMaxHP(MyIndex) > 0 Then frmMirage.lblHP.Caption = Int(GetPlayerHP(MyIndex) / GetPlayerMaxHP(MyIndex) * 100) & "%" (MyIndex) * 100 End If Exit Sub End If ' :::::::::::::::::::::: ' :: Player mp packet :: ' :::::::::::::::::::::: If LCase(Parse(0)) = "playermp" Then Player(MyIndex).MaxMP = Val(Parse(1)) Call SetPlayerMP(MyIndex, Val(Parse(2))) If GetPlayerMaxMP(MyIndex) > 0 Then frmMirage.lblMP.Caption = Int(GetPlayerMP(MyIndex) / GetPlayerMaxMP(MyIndex) * 100) & "%" (MyIndex) * 100 End If Exit Sub End If ' :::::::::::::::::::::: ' :: Player sp packet :: ' :::::::::::::::::::::: If LCase(Parse(0)) = "playersp" Then Player(MyIndex).MaxSP = Val(Parse(1)) Call SetPlayerSP(MyIndex, Val(Parse(2))) If GetPlayerMaxSP(MyIndex) > 0 Then frmMirage.lblSP.Caption = Int(GetPlayerSP(MyIndex) / GetPlayerMaxSP(MyIndex) * 100) & "%" (MyIndex) * 100 End If Exit Sub End If And if you still want the old labels to show the % of the HP, Mp or Sp of the player, replace it all for this code... Code: ' :::::::::::::::::::::: ' :: Player hp packet :: ' :::::::::::::::::::::: ' prgHP = HP progress bar..added by WiLL If LCase(Parse(0)) = "playerhp" Then Player(MyIndex).MaxHP = Val(Parse(1)) Call SetPlayerHP(MyIndex, Val(Parse(2))) If GetPlayerMaxHP(MyIndex) > 0 Then frmMirage.lblHP.Caption = Int(GetPlayerHP(MyIndex) / GetPlayerMaxHP(MyIndex) * 100) & "%" frmMirage.prgHP.Value = GetPlayerHP(MyIndex) / GetPlayerMaxHP(MyIndex) * 100 End If Exit Sub End If ' :::::::::::::::::::::: ' :: Player mp packet :: ' :::::::::::::::::::::: ' prgMP = MP progress bar..added by WiLL If LCase(Parse(0)) = "playermp" Then Player(MyIndex).MaxMP = Val(Parse(1)) Call SetPlayerMP(MyIndex, Val(Parse(2))) If GetPlayerMaxMP(MyIndex) > 0 Then frmMirage.lblMP.Caption = Int(GetPlayerMP(MyIndex) / GetPlayerMaxMP(MyIndex) * 100) & "%" frmMirage.prgMP.Value = GetPlayerMP(MyIndex) / GetPlayerMaxMP(MyIndex) * 100 End If Exit Sub End If ' :::::::::::::::::::::: ' :: Player sp packet :: ' :::::::::::::::::::::: ' prgSP = SP progress bar..added by WiLL If LCase(Parse(0)) = "playersp" Then Player(MyIndex).MaxSP = Val(Parse(1)) Call SetPlayerSP(MyIndex, Val(Parse(2))) If GetPlayerMaxSP(MyIndex) > 0 Then frmMirage.lblSP.Caption = Int(GetPlayerSP(MyIndex) / GetPlayerMaxSP(MyIndex) * 100) & "%" frmMirage.prgSP.Value = GetPlayerSP(MyIndex) / GetPlayerMaxSP(MyIndex) * 100 End If Exit Sub End If But if you want to take the labels off, first you have to delete the labels and replace it for this code: Code: ' ::::::::::::::::::::::
' :: Player hp packet :: ' :::::::::::::::::::::: ' prgHP = HP progress bar..added by WiLL If LCase(Parse(0)) = "playerhp" Then Player(MyIndex).MaxHP = Val(Parse(1)) Call SetPlayerHP(MyIndex, Val(Parse(2))) If GetPlayerMaxHP(MyIndex) > 0 Then frmMirage.prgHP.Value = GetPlayerHP(MyIndex) / GetPlayerMaxHP(MyIndex) * 100 End If Exit Sub End If ' :::::::::::::::::::::: ' :: Player mp packet :: ' :::::::::::::::::::::: ' prgMP = MP progress bar..added by WiLL If LCase(Parse(0)) = "playermp" Then Player(MyIndex).MaxMP = Val(Parse(1)) Call SetPlayerMP(MyIndex, Val(Parse(2))) If GetPlayerMaxMP(MyIndex) > 0 Then frmMirage.prgMP.Value = GetPlayerMP(MyIndex) / GetPlayerMaxMP(MyIndex) * 100 End If Exit Sub End If ' :::::::::::::::::::::: ' :: Player sp packet :: ' :::::::::::::::::::::: ' prgSP = SP progress bar..added by WiLL If LCase(Parse(0)) = "playersp" Then Player(MyIndex).MaxSP = Val(Parse(1)) Call SetPlayerSP(MyIndex, Val(Parse(2))) If GetPlayerMaxSP(MyIndex) > 0 Then frmMirage.prgSP.Value = GetPlayerSP(MyIndex) / GetPlayerMaxSP(MyIndex) * 100 End If Exit Sub End If OBS: I did not test the code above...i'm using the labels above the progress bar so the player will know his\her HP, MP or SP percentage. How it works: Well when the player lose HP, MP or SP the progress bar ".Value" property changes to the % of the actual HP, MP or SP of the player... Well... Hope you guys like it... Bye |
|
| Author: | Robin [ Sat Jan 20, 2007 1:12 pm ] |
| Post subject: | |
Man, that is one of the best first posts I have ever seen. If you're making tutorials in your first post I think you'll get along just fine |
|
| Author: | William [ Sat Jan 20, 2007 1:34 pm ] |
| Post subject: | |
Very good start indeed |
|
| Author: | Lea [ Sat Jan 20, 2007 1:57 pm ] |
| Post subject: | |
Welcome to MS |
|
| Author: | willgtjr [ Sat Jan 20, 2007 6:01 pm ] |
| Post subject: | :) |
oh... thanks I wanted to make a good and simple tutorial. and I guess it worked. And sorry if I did any english grammar errors, you know, it is not my native language... thanks again bye |
|
| Author: | Robin [ Sat Jan 20, 2007 6:22 pm ] |
| Post subject: | Re: :) |
willgtjr wrote: oh... thanks
I wanted to make a good and simple tutorial. and I guess it worked. And sorry if I did any english grammar errors, you know, it is not my native language... thanks again bye Don't worry, you're English is better than some of the English/American people here! |
|
| Author: | willgtjr [ Sat Jan 20, 2007 6:51 pm ] |
| Post subject: | |
Thanks I really appreciate that. And by the way, if anyone have any questions or bugs, PM me or just post it here, I will be glad to help |
|
| Author: | Da Undead [ Tue Apr 17, 2007 10:40 pm ] |
| Post subject: | |
Not saying this is dumb, but wouln't it be better to use a picture box instead of progress bar? Just to make it look more better. |
|
| Author: | Rian [ Tue Apr 17, 2007 11:08 pm ] |
| Post subject: | |
It's all a matter of opinion. If you fancy picture boxes, then use them |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|