Jump to content

Monsters Health in Percentage


Recommended Posts

M2 Download Center

Download Here ( Internal )

Hey,

 

I'd like to release the following modification for monsters targetboards:

 

Spoiler

17262017FEh.png.e04d67f62c4ffffa9d1182e6

 

How to add:

 

open uiTarget.py

search for

def __init__(self):

and add under

		hpGauge = ui.Gauge()
		hpGauge.SetParent(self)
		hpGauge.MakeGauge(130, "red")
		hpGauge.Hide()
		hpPercenttxt = ui.TextLine()
		hpPercenttxt.SetParent(self)
		hpPercenttxt.SetPosition(160, 13)
		hpPercenttxt.SetText("")
		hpPercenttxt.Hide()

Search for 

		self.name = name
		self.hpGauge = hpGauge

and add under this

		self.hpPercenttxt = hpPercenttxt

Search

def Destroy(self):

add it under

self.hpPercenttxt = None

Search

def ResetTargetBoard(self):

Find

self.hpGauge.Hide()

add it under

self.hpPercenttxt.Hide()

Now search for

def SetHP(self, hpPercentage):

and add under

			self.UpdatePosition()
			self.hpPercenttxt.SetPosition(200 + 7*self.nameLength-205, 13)
			self.hpPercenttxt.Show()

and under 

		self.hpGauge.SetPercentage(hpPercentage, 100)
		self.hpPercenttxt.SetText("%d%%" % (hpPercentage))

Have fun!

  • Love 12
Link to post

0705 18:46:27105 ::   File "game.py", line 1088, in SetHPTargetBoard

0705 18:46:27105 ::   File "uiTarget.py", line 338, in SetHP

0705 18:46:27105 :: AttributeError
0705 18:46:27105 :: : 
0705 18:46:27105 :: 'TargetBoard' object has no attribute 'hpPercenttxt'
0705 18:46:27105 :: 

Link to post

0705 18:46:27105 ::   File "game.py", line 1088, in SetHPTargetBoard

0705 18:46:27105 ::   File "uiTarget.py", line 338, in SetHP

0705 18:46:27105 :: AttributeError
0705 18:46:27105 :: : 
0705 18:46:27105 :: 'TargetBoard' object has no attribute 'hpPercenttxt'
0705 18:46:27105 :: 

Under

self.name = name

add this

self.hpPercenttxt = hpPercenttxt

 

  • Love 1
Link to post

0705 20:58:26508 :: Traceback (most recent call last):

0705 20:58:26508 ::   File "networkModule.py", line 247, in SetGamePhase

0705 20:58:26508 ::   File "game.py", line 126, in __init__

0705 20:58:26508 ::   File "uiTarget.py", line 156, in __init__

0705 20:58:26509 :: NameError
0705 20:58:26509 :: : 
0705 20:58:26509 :: global name 'hpPercenttxt' is not defined
0705 20:58:26509 :: 

Link to post

It works, but buggy.

Select a mob, then select a player, and the percent appers too. But the value is not true, and the position in under the player's name.

Edited by TheSLZ
Link to post

It works, but buggy.

Select a mob, then select a player, and the percent appers too. But the value is not true, and the position in under the player's name.

Well if you have a gauge on PvP players you have to check if the opponent is a pvp instance:

like this

			self.hpPercenttxt.SetPosition(200 + 7*self.nameLength-205, 13)
			self.hpPercenttxt.Show()
			if player.IsPVPInstance(self.vid):
				self.hpPercenttxt.Hide()

 

Link to post

I tried, problem still there.

Not only in pvp, see:

My uitarget.py: http://pastebin.com/mcjucf92

 

Search

def Destroy(self):

add it under

self.hpPercenttxt = None

 

Search

def ResetTargetBoard(self):

Find

self.hpGauge.Hide()

add it under

self.hpPercenttxt.Hide()

 

I am sorry, I just forgot to write it in this topic. I did it in my code but forgot to edit it here.

  • Love 1
Link to post
  • 4 months later...

Hey guys :) Great tut but:

Spoiler

1204 07:22:27048 :: Traceback (most recent call last):

1204 07:22:27049 ::   File "networkModule.py", line 253, in SetGamePhase

1204 07:22:27049 ::   File "game.py", line 112, in __init__

1204 07:22:27049 ::   File "uiTarget.py", line 47, in __init__

1204 07:22:27049 ::   File "ui.py", line 128, in SetParent

1204 07:22:27049 :: AttributeError
1204 07:22:27049 :: : 
1204 07:22:27049 :: 'TargetBoard' object has no attribute 'hWnd'
1204 07:22:27049 :: 

1204 07:23:59110 :: Exception 
1204 07:23:59110 :: exceptions.AttributeError
1204 07:23:59110 :: : 
1204 07:23:59110 :: "'TargetBoard' object has no attribute 'hWnd'"
1204 07:23:59110 ::  in 
1204 07:23:59110 :: <bound method TargetBoard.__del__ of <uiTarget.TargetBoard object at 0x0F24BE10>>
1204 07:23:59110 ::  ignored

 

Link to post
  • 2 weeks later...
  • 1 month later...
On 05.07.2015 at 7:03 PM, DasSchwarzeT said:

Hey,

Bu konuya göre:

Ben canavarlar targetboards için aşağıdaki değişikliği serbest İstediklerim:

17FEh.png

Nasıl eklemek için:

Açık uiTarget.py

aramak

ve altına eklediğiniz

 
 

Aramak 

		

ve bu altına eklediğiniz

		

Arama

 

altında ekleyin

 

 

Arama

 

Bulmak

altında ekleyin

Şimdi orada aramak

 

ve altına eklediğiniz

			
			   
			

altında 

		 
		  

Şimdi bitirdiniz ve gibi görünmelidir:

lipBb.png

 

İyi eğlenceler

http://prntscr.com/9wtznl :S 

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



Shoutbox

Shoutbox

Chatroom Rules

 

Join our Discord

A request for help = Shoutbox Ban

Be respectful & Respect the rules

 

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.