Mirage Source
http://www.miragesource.net/forums/

Display stats on screen
http://www.miragesource.net/forums/viewtopic.php?f=183&t=4335
Page 1 of 56

Author:  Egon [ Tue Sep 16, 2008 7:28 am ]
Post subject:  Display stats on screen

I'm going to give you two ways of setting this up so that you don't need the stat labels. The first way is going to have your stats under your character just like your character's name is above The second way will put your stats in the lower left corner.

1st Way
Image
Difficulty: 1/5

::Client Side::

Find:
Code:
For i = 1 To MAX_PLAYERS
                    If IsPlaying(i) Then
                        If GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
                            'If CurX = GetPlayerX(i) Then
                                'If CurY = GetPlayerY(i) Then
                                    Call DrawPlayerName(i)
                                'End If
                            'End If
                        End If
                    End If
                Next i

Replace with:
Code:
For i = 1 To MAX_PLAYERS
                    If IsPlaying(i) Then
                        If GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
                            'If CurX = GetPlayerX(i) Then
                                'If CurY = GetPlayerY(i) Then
                                    Call DrawPlayerName(i)
                                    Call DrawPlayerHP(i)
                                    Call DrawPlayerMP(i)
                                    Call DrawPlayerSP(i)
                                'End If
                            'End If
                        End If
                    End If
                Next i

At the bottom of modText, add:
Code:
Sub DrawPlayerHP(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim Color As Long
Dim HP As String

HP = "HP: " & (GetPlayerVital(MyIndex, Vitals.HP) / GetPlayerMaxVital(MyIndex, Vitals.HP) * 100) & "%"

    ' Check access level to determine color
    If GetPlayerPK(Index) = NO Then
        Select Case GetPlayerAccess(Index)
            Case 0
                Color = QBColor(Brown)
            Case 1
                Color = QBColor(DarkGrey)
            Case 2
                Color = QBColor(Cyan)
            Case 3
                Color = QBColor(Blue)
            Case 4
                Color = QBColor(Pink)
        End Select
    Else
        Color = QBColor(BrightRed)
    End If

    ' Determine location for text
    TextX = GetPlayerX(Index) * PIC_X + Player(Index).XOffset + (PIC_X \ 2) - 30
    TextY = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - (PIC_Y \ 2) + 44
   
    ' Draw name
    Call DrawText(TexthDC, TextX, TextY, HP, Color)
End Sub

Sub DrawPlayerMP(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim Color As Long
Dim MP As String

MP = "MP: " & (GetPlayerVital(MyIndex, Vitals.MP) / GetPlayerMaxVital(MyIndex, Vitals.MP) * 100) & "%"

    ' Check access level to determine color
    If GetPlayerPK(Index) = NO Then
        Select Case GetPlayerAccess(Index)
            Case 0
                Color = QBColor(Brown)
            Case 1
                Color = QBColor(DarkGrey)
            Case 2
                Color = QBColor(Cyan)
            Case 3
                Color = QBColor(Blue)
            Case 4
                Color = QBColor(Pink)
        End Select
    Else
        Color = QBColor(BrightRed)
    End If

    ' Determine location for text
    TextX = GetPlayerX(Index) * PIC_X + Player(Index).XOffset + (PIC_X \ 2) - 30
    TextY = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - (PIC_Y \ 2) + 54
   
    ' Draw name
    Call DrawText(TexthDC, TextX, TextY, MP, Color)
End Sub

Sub DrawPlayerSP(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim Color As Long
Dim SP As String

SP = "SP: " & (GetPlayerVital(MyIndex, Vitals.SP) / GetPlayerMaxVital(MyIndex, Vitals.SP) * 100) & "%"

    ' Check access level to determine color
    If GetPlayerPK(Index) = NO Then
        Select Case GetPlayerAccess(Index)
            Case 0
                Color = QBColor(Brown)
            Case 1
                Color = QBColor(DarkGrey)
            Case 2
                Color = QBColor(Cyan)
            Case 3
                Color = QBColor(Blue)
            Case 4
                Color = QBColor(Pink)
        End Select
    Else
        Color = QBColor(BrightRed)
    End If

    ' Determine location for text
    TextX = GetPlayerX(Index) * PIC_X + Player(Index).XOffset + (PIC_X \ 2) - 30
    TextY = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - (PIC_Y \ 2) + 64
   
    ' Draw name
    Call DrawText(TexthDC, TextX, TextY, SP, Color)
End Sub

Done


2nd Way

Image
Difficulty: 1/5

::Client Side::

Search for:
Code:
' Checking fps

Under:
Code:
' Checking fps
        If Mid$(MyText, 1, 4) = "/fps" Then
       
            BFPS = Not BFPS
            MyText = vbNullString
            frmMirage.txtMyChat.Text = vbNullString
            Exit Sub
        End If

Add:
Code:
' Show stats
        If Mid$(MyText, 1, 5) = "/Show" Then
       
            Show = Not Show
            MyText = vbNullString
            frmMirage.txtMyChat.Text = vbNullString
            Exit Sub
        End If

Search for:
Code:
Public BFPS As Boolean

Under:
Code:
Public BFPS As Boolean
Public BLoc As Boolean

Add:
Code:
' Puts your stats on screen
Public Show As Boolean

Search for:
Code:
Dim rec_pos As DXVBLib.RECT

Under add:
Code:
Dim HP As String, MP As String, SP As String

Search for:
Code:
' draw FPS

Under add:
Code:
' draw FPS
                If BFPS Then
                    Call DrawText(TexthDC, (MAX_MAPX - 1) * PIC_X, 1, Trim$("FPS: " & GameFPS), QBColor(Yellow))
                End If

Add:
Code:
' draw Stats
                If Show Then
                    HP = (GetPlayerVital(MyIndex, Vitals.HP) / GetPlayerMaxVital(MyIndex, Vitals.HP) * 100) & "%"
                    MP = (GetPlayerVital(MyIndex, Vitals.MP) / GetPlayerMaxVital(MyIndex, Vitals.MP) * 100) & "%"
                    SP = (GetPlayerVital(MyIndex, Vitals.SP) / GetPlayerMaxVital(MyIndex, Vitals.SP) * 100) & "%"
                    Call DrawText(TexthDC, (MAX_MAPY - 11) * PIC_Y, 350, Trim$("HP: " & HP), QBColor(Yellow))
                    Call DrawText(TexthDC, (MAX_MAPY - 11) * PIC_Y, 360, Trim$("MP: " & MP), QBColor(Yellow))
                    Call DrawText(TexthDC, (MAX_MAPY - 11) * PIC_Y, 370, Trim$("SP: " & SP), QBColor(Yellow))
                End If

Done

Author:  wanai [ Wed Dec 01, 2021 7:29 am ]
Post subject:  Re: Display stats on screen

audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.rugageboard.rugagrule.rugallduct.rugalvanometric.rugangforeman.rugangwayplatform.rugarbagechute.rugardeningleave.rugascautery.rugashbucket.rugasreturn.rugatedsweep.rugaugemodel.rugaussianfilter.rugearpitchdiameter.ru
geartreating.rugeneralizedanalysis.rugeneralprovisions.rugeophysicalprobe.rugeriatricnurse.rugetintoaflap.rugetthebounce.ruhabeascorpus.ruhabituate.ruhackedbolt.ruhackworker.ruhadronicannihilation.ruhaemagglutinin.ruhailsquall.ruhairysphere.ruhalforderfringe.ruhalfsiblings.ruhallofresidence.ruhaltstate.ruhandcoding.ruhandportedhead.ruhandradar.ruhandsfreetelephone.ru
hangonpart.ruhaphazardwinding.ruhardalloyteeth.ruhardasiron.ruhardenedconcrete.ruharmonicinteraction.ruhartlaubgoose.ruhatchholddown.ruhaveafinetime.ruhazardousatmosphere.ruheadregulator.ruheartofgold.ruheatageingresistance.ruheatinggas.ruheavydutymetalcutting.rujacketedwall.rujapanesecedar.rujibtypecrane.rujobabandonment.rujobstress.rujogformation.rujointcapsule.rujointsealingmaterial.ru
journallubricator.rujuicecatcher.rujunctionofchannels.rujusticiablehomicide.rujuxtapositiontwin.rukaposidisease.rukeepagoodoffing.rukeepsmthinhand.rukentishglory.rukerbweight.rukerrrotation.rukeymanassurance.rukeyserum.rukickplate.rukillthefattedcalf.rukilowattsecond.rukingweakfish.rukinozones.rukleinbottle.rukneejoint.ruknifesethouse.ruknockonatom.ruknowledgestate.ru
kondoferromagnet.rulabeledgraph.rulaborracket.rulabourearnings.rulabourleasing.rulaburnumtree.rulacingcourse.rulacrimalpoint.rulactogenicfactor.rulacunarycoefficient.ruladletreatediron.rulaggingload.rulaissezaller.rulambdatransition.rulaminatedmaterial.rulammasshoot.rulamphouse.rulancecorporal.rulancingdie.rulandingdoor.rulandmarksensor.rulandreform.rulanduseratio.ru
languagelaboratory.rulargeheart.rulasercalibration.rulaserlens.rulaserpulse.rulaterevent.rulatrinesergeant.rulayabout.ruleadcoating.ruleadingfirm.rulearningcurve.ruleaveword.rumachinesensible.rumagneticequator.rumagnetotelluricfield.rumailinghouse.rumajorconcern.rumammasdarling.rumanagerialstaff.rumanipulatinghand.rumanualchoke.rumedinfobooks.rump3lists.ru
nameresolution.runaphtheneseries.runarrowmouthed.runationalcensus.runaturalfunctor.runavelseed.runeatplaster.runecroticcaries.runegativefibration.runeighbouringrights.ruobjectmodule.ruobservationballoon.ruobstructivepatent.ruoceanmining.ruoctupolephonon.ruofflinesystem.ruoffsetholder.ruolibanumresinoid.ruonesticket.rupackedspheres.rupagingterminal.rupalatinebones.rupalmberry.ru
papercoating.ruparaconvexgroup.ruparasolmonoplane.ruparkingbrake.rupartfamily.rupartialmajorant.ruquadrupleworm.ruqualitybooster.ruquasimoney.ruquenchedspark.ruquodrecuperet.rurabbetledge.ruradialchaser.ruradiationestimator.rurailwaybridge.rurandomcoloration.rurapidgrowth.rurattlesnakemaster.rureachthroughregion.rureadingmagnifier.rurearchain.rurecessioncone.rurecordedassignment.ru
rectifiersubstation.ruredemptionvalue.rureducingflange.rureferenceantigen.ruregeneratedprotein.rureinvestmentplan.rusafedrilling.rusagprofile.rusalestypelease.rusamplinginterval.rusatellitehydrology.ruscarcecommodity.ruscrapermat.ruscrewingunit.ruseawaterpump.rusecondaryblock.rusecularclergy.ruseismicefficiency.ruselectivediffuser.ruсайтsemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoningtechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.ruhttp://temperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru

Author:  wanai [ Sun Dec 26, 2021 5:38 am ]
Post subject:  Re: Display stats on screen

Obse

Author:  wanai [ Sun Dec 26, 2021 5:39 am ]
Post subject:  Re: Display stats on screen

32.3

Author:  wanai [ Sun Dec 26, 2021 5:40 am ]
Post subject:  Re: Display stats on screen

Bett

Author:  wanai [ Sun Dec 26, 2021 5:41 am ]
Post subject:  Re: Display stats on screen

Bett

Author:  wanai [ Sun Dec 26, 2021 5:42 am ]
Post subject:  Re: Display stats on screen

Troi

Author:  wanai [ Sun Dec 26, 2021 5:43 am ]
Post subject:  Re: Display stats on screen

Ashl

Author:  wanai [ Sun Dec 26, 2021 5:44 am ]
Post subject:  Re: Display stats on screen

Like

Author:  wanai [ Sun Dec 26, 2021 5:45 am ]
Post subject:  Re: Display stats on screen

Jerz

Author:  wanai [ Sun Dec 26, 2021 5:47 am ]
Post subject:  Re: Display stats on screen

Busi

Author:  wanai [ Sun Dec 26, 2021 5:48 am ]
Post subject:  Re: Display stats on screen

Erns

Author:  wanai [ Sun Dec 26, 2021 5:49 am ]
Post subject:  Re: Display stats on screen

Acid

Author:  wanai [ Sun Dec 26, 2021 5:50 am ]
Post subject:  Re: Display stats on screen

Drin

Author:  wanai [ Sun Dec 26, 2021 5:51 am ]
Post subject:  Re: Display stats on screen

colo

Author:  wanai [ Sun Dec 26, 2021 5:52 am ]
Post subject:  Re: Display stats on screen

Ever

Author:  wanai [ Sun Dec 26, 2021 5:53 am ]
Post subject:  Re: Display stats on screen

Oxyg

Author:  wanai [ Sun Dec 26, 2021 5:54 am ]
Post subject:  Re: Display stats on screen

Inte

Author:  wanai [ Sun Dec 26, 2021 5:55 am ]
Post subject:  Re: Display stats on screen

Orie

Author:  wanai [ Sun Dec 26, 2021 5:57 am ]
Post subject:  Re: Display stats on screen

Geis

Author:  wanai [ Sun Dec 26, 2021 5:58 am ]
Post subject:  Re: Display stats on screen

Cisc

Author:  wanai [ Sun Dec 26, 2021 5:59 am ]
Post subject:  Re: Display stats on screen

Opti

Author:  wanai [ Sun Dec 26, 2021 6:00 am ]
Post subject:  Re: Display stats on screen

Carn

Author:  wanai [ Sun Dec 26, 2021 6:01 am ]
Post subject:  Re: Display stats on screen

Show

Author:  wanai [ Sun Dec 26, 2021 6:02 am ]
Post subject:  Re: Display stats on screen

Walt

Page 1 of 56 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/