HP/AP amount in bar

Results 1 to 14 of 14
  1. #1
    Infraction Banned maxolahird is offline
    MemberRank
    Sep 2010 Join Date
    195Posts

    HP/AP amount in bar

    How can I show like


    "HP : 115/115"
    "AP : 58/58'

    In the HP/AP bars ?

    Thanks.
    Last edited by maxolahird; 12-08-16 at 12:09 AM.


  2. #2
    Member iFinn is offline
    MemberRank
    Dec 2013 Join Date
    62Posts

    Re: HP/AP amount in bar

    Go to ZCombatInterface.cpp

    in void ZCombatInterface::OnDraw(MDrawContext* pDC)

    use TextRelative function or pDC->Text to print on the screen and use zcharacter to get your hp and ap

  3. #3
    Infraction Banned maxolahird is offline
    MemberRank
    Sep 2010 Join Date
    195Posts

    Re: HP/AP amount in bar

    Quote Originally Posted by iFinn View Post
    Go to ZCombatInterface.cpp

    in void ZCombatInterface::OnDraw(MDrawContext* pDC)

    use TextRelative function or pDC->Text to print on the screen and use zcharacter to get your hp and ap
    Sorry but I'm new to coding I'm not sure how to do that.. if you could help me I appreciate.

  4. #4
    Member iFinn is offline
    MemberRank
    Dec 2013 Join Date
    62Posts

    Re: HP/AP amount in bar

    Quote Originally Posted by maxolahird View Post
    Sorry but I'm new to coding I'm not sure how to do that.. if you could help me I appreciate.
    in if (!m_bSkipUIDrawByRule)

    Code:
    ZCharacter* pCharacter = ZGetGame()->m_pMyCharacter;
                    if (pCharacter && !pCharacter->IsDie())
                    {
                        MFont* pFont = MFontManager::Get("FONTa6_O2Wht");
                        pDC->SetFont(pFont);
                        pDC->SetColor(MCOLOR(0xFFFFFFFF));
    
    
                        char szMsg[128] = { 0, };
    
    
                        sprintf(szMsg, "HP : %i / %i", (int)pCharacter->GetHP(), (int)pCharacter->GetMaxHP());
                        TextRelative(pDC, 100.f / 800.f, 23.f / 600.f, szMsg);
    
    
                        sprintf(szMsg, "AP : %i / %i", (int)pCharacter->GetAP(), (int)pCharacter->GetMaxAP());
                        TextRelative(pDC, 100.f / 800.f, 50.f / 600.f, szMsg);
                    }

  5. #5
    Infraction Banned maxolahird is offline
    MemberRank
    Sep 2010 Join Date
    195Posts

    Re: HP/AP amount in bar

    Quote Originally Posted by iFinn View Post
    in if (!m_bSkipUIDrawByRule)

    Code:
    ZCharacter* pCharacter = ZGetGame()->m_pMyCharacter;
                    if (pCharacter && !pCharacter->IsDie())
                    {
                        MFont* pFont = MFontManager::Get("FONTa6_O2Wht");
                        pDC->SetFont(pFont);
                        pDC->SetColor(MCOLOR(0xFFFFFFFF));
    
    
                        char szMsg[128] = { 0, };
    
    
                        sprintf(szMsg, "HP : %i / %i", (int)pCharacter->GetHP(), (int)pCharacter->GetMaxHP());
                        TextRelative(pDC, 100.f / 800.f, 23.f / 600.f, szMsg);
    
    
                        sprintf(szMsg, "AP : %i / %i", (int)pCharacter->GetAP(), (int)pCharacter->GetMaxAP());
                        TextRelative(pDC, 100.f / 800.f, 50.f / 600.f, szMsg);
                    }
    Thanks a lot man!! You are the best! It worked, thx so much

  6. #6
    Valued Member itsmemario is offline
    MemberRank
    Aug 2016 Join Date
    103Posts

    Re: HP/AP amount in bar

    Hi, how can I remove that HP/AP text from replays? Thanks

  7. #7
    Valued Member Keristrasza is offline
    MemberRank
    Jun 2015 Join Date
    128Posts

    Re: HP/AP amount in bar

    Quote Originally Posted by itsmemario View Post
    Hi, how can I remove that HP/AP text from replays? Thanks
    Check for ZGetGame()->IsReplay() before printing it

  8. #8
    Valued Member itsmemario is offline
    MemberRank
    Aug 2016 Join Date
    103Posts

    Re: HP/AP amount in bar

    Quote Originally Posted by Keristrasza View Post
    Check for ZGetGame()->IsReplay() before printing it
    I use an 'if' statement? Oh well, I'm really bad at coding I cant figure out the right way to add that to the code

    PHP Code:
                        sprintf(szMsg"HP : %i", (int)pCharacter->GetHP());
                        
    TextRelative(pDC100.f 800.f23.f 600.fszMsg);

                        
    sprintf(szMsg"AP : %i", (int)pCharacter->GetAP());
                        
    TextRelative(pDC100.f 800.f50.f 600.fszMsg); 

  9. #9
    Valued Member Keristrasza is offline
    MemberRank
    Jun 2015 Join Date
    128Posts

    Re: HP/AP amount in bar

    Yep, if statement

  10. #10
    Valued Member itsmemario is offline
    MemberRank
    Aug 2016 Join Date
    103Posts

    Re: HP/AP amount in bar

    Quote Originally Posted by Keristrasza View Post
    Yep, if statement
    It worked! But at the end of the replay it shows the HP / AP text.. I have no idea what could be causing that because as you can see it was supposed to show it only when not in replay.

    if (!ZGetGame()->IsReplay())
    {
    sprintf(szMsg, "HP : %i", (int)pCharacter->GetHP());
    //sprintf(szMsg, "HP : %i / %i", (int)pCharacter->GetHP(), (int)pCharacter->GetMaxHP());
    TextRelative(pDC, 100.f / 800.f, 23.f / 600.f, szMsg);

    sprintf(szMsg, "AP : %i", (int)pCharacter->GetAP());
    //sprintf(szMsg, "AP : %i / %i", (int)pCharacter->GetAP(), (int)pCharacter->GetMaxAP());
    TextRelative(pDC, 100.f / 800.f, 50.f / 600.f, szMsg);
    }

  11. #11
    Valued Member Keristrasza is offline
    MemberRank
    Jun 2015 Join Date
    128Posts

    Re: HP/AP amount in bar

    what do you mean by at the end of the replay? o.o

  12. #12
    Valued Member itsmemario is offline
    MemberRank
    Aug 2016 Join Date
    103Posts

    Re: HP/AP amount in bar

    Quote Originally Posted by Keristrasza View Post
    what do you mean by at the end of the replay? o.o
    When you go to the lobby when replay is over... like 2 seconds before it ends, it shows the HP / AP text. Not really important but I really like things perfect. If its not "fixable" its ok...

    I tried putting the if statement in many places around the code but same result.
    Last edited by itsmemario; 24-08-16 at 04:16 AM.

  13. #13
    Valued Member Keristrasza is offline
    MemberRank
    Jun 2015 Join Date
    128Posts

    Re: HP/AP amount in bar

    That's incredibly strange and doesn't at all happen for me so I'm not sure what to say

  14. #14
    Enthusiast dupetion is offline
    MemberRank
    May 2014 Join Date
    IsraelLocation
    25Posts

    Re: HP/AP amount in bar

    iFin i add the source code it's showing that it compiled normally without any errors but for some reason it's not showing up at the game no matter what kinde of code i add to the soruce ( i used to try many diffraent code's for the hp bar but none of them seems to show at the game but were good compiled at the soruce , hope to hear from u or at list from someone :P



Advertisement