05-14-2021, 07:16 PM
Hello.
I'd like to show current mob hp (example fox has 150 hp) such as : 150/150, like a life searcher for mobs.
This for EP4, June source.
Anyone know how to do it or how to starts?
Thanks in advance.
|
How to show HP points and HP life bar on Monster?
|
|
05-14-2021, 07:16 PM
Hello. I'd like to show current mob hp (example fox has 150 hp) such as : 150/150, like a life searcher for mobs. This for EP4, June source. Anyone know how to do it or how to starts? Thanks in advance.
05-15-2021, 11:20 AM
You should send the hp info from gs to client and then draw it ... never tested it so i don't have code to share ?
05-15-2021, 11:30 AM
I‘m not sure since i never tried it, but i think if you search for the life searcher item id in server source you might find some message to client which will bring you to the code to show the hp, and you might be able to enable it for monsters, too. But as I said, I have never looked into it so this is just a guess
05-15-2021, 12:23 PM
52 minutes ago, Desarija said: I‘m not sure since i never tried it, but i think if you search for the life searcher item id in server source you might find some message to client which will bring you to the code to show the hp, and you might be able to enable it for monsters, too. But as I said, I have never looked into it so this is just a guess Guess is not needed since the mob should already have the hp value for show the hp bar, you just need to write the value in the right position... As we did for ping and framerate
05-15-2021, 10:51 PM
Thank you guys. I found it, in InventoryManager: CNetMsg::SP rmsg(new CNetMsg); rmsg->Init(MSG_PK); RefMsg(rmsg) << (unsigned char)MSG_PK_TARGET_SHOWHP << (char)0 ; SEND_Q( rmsg, owner_->m_desc); I'd like to ask a question about the rendering of this in the client: Why there is TargetInfoNewUI.cpp and UiTargetInfo that seems to be do the same things?
05-15-2021, 11:33 PM
40 minutes ago, Andrein95 said: Thank you guys. I found it, in InventoryManager: CNetMsg::SP rmsg(new CNetMsg); rmsg->Init(MSG_PK); RefMsg(rmsg) << (unsigned char)MSG_PK_TARGET_SHOWHP << (char)0 ; SEND_Q( rmsg, owner_->m_desc); I'd like to ask a question about the rendering of this in the client: Why there is TargetInfoNewUI.cpp and UiTargetInfo that seems to be do the same things? inventory manager ? Pretty strange ... should be linked at TargetInfoNewUI.cpp UiTargetInfo imo (didn't checked so idk). The information about hp should be already in the client since they are used for set the max hp bar and correctly subtract the damage value at the mobs. It should be already used for create the NPC HP BAR
05-15-2021, 11:57 PM
1 hour ago, Andrein95 said: Thank you guys. I found it, in InventoryManager: CNetMsg::SP rmsg(new CNetMsg); rmsg->Init(MSG_PK); RefMsg(rmsg) << (unsigned char)MSG_PK_TARGET_SHOWHP << (char)0 ; SEND_Q( rmsg, owner_->m_desc); I'd like to ask a question about the rendering of this in the client: Why there is TargetInfoNewUI.cpp and UiTargetInfo that seems to be do the same things? I think in earlier versions of the client there was only uitargetinfo.cpp, and then they basically replaced it with targetinfonewui.cpp so that’s the file it uses now
05-16-2021, 09:24 AM
9 hours ago, Desarija said: I think in earlier versions of the client there was only uitargetinfo.cpp, and then they basically replaced it with targetinfonewui.cpp so that’s the file it uses now Correct, I deleted the old Ui cpp file. 9 hours ago, Scura said: inventory manager ? Pretty strange ... should be linked at TargetInfoNewUI.cpp UiTargetInfo imo (didn't checked so idk). The information about hp should be already in the client since they are used for set the max hp bar and correctly subtract the damage value at the mobs. It should be already used for create the NPC HP BAR Inventory manager its the part when Is activated Life Searcher in the inventory and then set the variable showHp in UiTargetInfo. Now I got a problem: I can show the correct HP for mob but It does not refresh when it got a damage (only If a focus out and re-focus the mob). I was thinking to call CTargetInfoUI::UpdateTargetInfo() After a damage battle calculation, is this legit? And do you know the position of this calculation? BTW thanks for your support.
05-16-2021, 09:59 AM
1 hour ago, Andrein95 said: Correct, I deleted the old Ui cpp file. Inventory manager its the part when Is activated Life Searcher in the inventory and then set the variable showHp in UiTargetInfo. Now I got a problem: I can show the correct HP for mob but It does not refresh when it got a damage (only If a focus out and re-focus the mob). I was thinking to call CTargetInfoUI::UpdateTargetInfo() After a damage battle calculation, is this legit? And do you know the position of this calculation? BTW thanks for your support. Show us the code the entire code, maybe is not necessary update the damage calc if have used the life search function ... I've found those function which should be placed at the end of UpdateHPInfo() fHealth = pInfo->GetTargetCurHP(eTARGET); strHp.PrintF("%d",(int)fHealth);
05-19-2021, 06:06 PM
On 5/16/2021 at 11:59 AM, Scura said: Show us the code the entire code, maybe is not necessary update the damage calc if have used the life search function ... I've found those function which should be placed at the end of UpdateHPInfo() fHealth = pInfo->GetTargetCurHP(eTARGET); strHp.PrintF("%d",(int)fHealth); Thanks for your answer. I've already added this at the end of the function but does not refresh the HP when I have focus on that target and the HP changes. Only If u focus back i can see Refreshed hp. |
|
« Next Oldest | Next Newest »
|