Mirage Source
Hp/Mp Bars Fucked up - 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: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Hp/Mp Bars Fucked up (/showthread.php?tid=1558)



Hp/Mp Bars Fucked up - Ramsey - 11-02-2008

[Image: 2004729557467268187_th.jpg]
^ Pic

\/ 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
            'frmMainGame.lblHP.Caption = Int(GetPlayerHP(MyIndex) / GetPlayerMaxHP(MyIndex) * 100) & "%"
            [b]frmMainGame.picHP.Width = ((GetPlayerHP(MyIndex) / 256) / (GetPlayerMaxHP(MyIndex) / 256)) * 256[/b]
        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
            'frmMainGame.lblMP.Caption = Int(GetPlayerMP(MyIndex) / GetPlayerMaxMP(MyIndex) * 100) & "%"
            [b]frmMainGame.PicMP.Width = ((GetPlayerMP(MyIndex) / 256) / (GetPlayerMaxMP(MyIndex) / 256)) * 256[/b]
        End If
        Exit Sub
    End If


Do you see anything in the code that might lead to this? I did the math myself and it works out nice but it's all messed up in the GUI...

Pay no attention to the horrid GUI that is just for test :lol:


Re: Hp/Mp Bars [edit] up - Robin - 11-02-2008

Add a:

Code:
* screen.twipsperpixelx

at the end?


Re: Hp/Mp Bars [edit] up - Ramsey - 11-02-2008

Do you have like the answer to everything?!?! Thank you.


Re: Hp/Mp Bars [edit] up - Robin - 12-02-2008

Yes.

Yes I do.


Re: Hp/Mp Bars [edit] up - Robin - 12-02-2008

Yeah, but I'd know the problem anyway as it's obvious that bar is 1/15 of what it should be.

Plus, I get a lot of people asking me about this. Tongue